KernelCAD Documentation

DInsight Home
Skip Navigation Links. Skip Navigation LinksHome Page > KernelCAD Models > Model Structure
GLC Models

Structure of KernelCAD models

DInsight Models consist of Scene Items. The most common scene items are geometric objects, which in DInsight software interchangeably are called "sections"  An object can be moved in 3D and attached to another objects. Shape and dimensions of any object in the model can also be modified.

Available types types of sections are described in Section Types.

Objects can be added or deleted from the model by using commands from Model sub menu of 3D Debugger. Command Model > Import Sections will add all sections of a saved model to the model currently opened in 3D Debugger.

Programmatically array of top level objects of the model can be manipulated with IArray or IArray2 queried form IModel interface. Methods of IModel2 interface provide shortcuts for the most common operations.

Empty models (models, which do not contain any objects) are considered valid.

One of objects in DInsight model can be selected as Current Object. To modify shape or view properties of an object in 3D Debugger, the object has to be selected as current. The model does not have to a current object, which is the default when the model is used by a KernelCAD component. Current object is highlighted in 3D View with a selection color. By default it is reddish gray color. Selection color can be changed from Menu >Current > Options > Color page dialog of 3D Debugger. The current object can be changed using the Model Explorer or by picking an object in 3D View in Modify mode. Programmatically Current Object property is managed via IModel2 interface.

Any three dimensional display in DInsight software by default displays global axes of coordinates (Global Frame). Axes are colored by Red for x-axis, Green for y-axis and Blue for z-axis.

Each object in a DInsight model has additional associated axes of coordinates, which are called Local Frame. Visually local axes are drawn with flat triangle as pointers.  Global axes are drawn with conical pointers.  The local frame should be though of as a skeleton of the object. When local frame is being moved in 3D the whole object moves with it without changing its internal geometry. Geometrical properties of each object (dimensions which appear in edit boxes when editing an object in 3D Debugger or sample applications) are relative to the local axes of the object. Moving object in 3D does not change its internal geometrical properties.

An object can be joined to another object so that they will behave as a single 3D object (See Topological Commands). If object A is joined to object B, than object B is called parent of A, and A is called a child of B. Number of children is not limited. An object can have only one parent. A child object can have its own children and level of the hierarchy is not limited.

Structure of a DInsight model can be viewed in Model Explorer, available on Model > Explore menu command. Model Explorer also allows editing common properties of an object and perform Delete, Join and Detach operations on objects in the model without changing the current object.

Query IArray or IArray2 from ISection to manipulate array of children of the section programmatically.   

Model Persistance

Models can be loaded or saved by KernelCAD component programmatically at runtime. To save model use either Save or SaveAs methods of the component or Save method of IModelEx.interface. To load a model either change the ModelPath property to anew location or use IModelEx.Load.. 

Methods LoadEx and SaveEx of IModelEx.interface allow saving and loading models in CAD formats other than native GLM. IModelEx also provides methods for saving and loading the model to and from a memory buffer bypassing the file system, which allows embedding KernelCAD models in application documents and other tasks.

It is possible to change the default .glm model file extension. Details. Models can also be saved to or loaded form a memory buffer, embedded into the application's .exe file or/and encrypted for security. Details