KernelCAD Documentation

DInsight Home
Skip Navigation Links.
Start page
Quick Start
Installation
Overview of the software
What is new
Collapse KernelCAD ModelsKernelCAD Models
Collapse KernelCAD ComponentsKernelCAD Components
KernelCAD Control
KernelCAD .NET Control
Methods and Properties
Menu
Model Explorer
Birds Eye View
Programming
Direct User Access
Direct Operations
Interface Queries
Printing Support
Data Types
Modes of KernelCAD Control
DIObjectGenerator class
Properties
FlatObjectArray Poperty
Context
64 bit development
Dual Mode
Initialisation Context
Overlay Editor
Memory Management
Input validation
Collapse Advanced functionalityAdvanced functionality
Collapse InterfacesInterfaces
Alphabetical list
I3DGrid
I3DBugger
I3Dpt
IAxiBase
IAxis
IBoolSection
IBoolSectionEx
IBoundary
IColor
IConstraint
IData
IDiffSurface_KC
IDIFont
IDraw
IDrawUtil
IDraw2
IElem
IElement
IKCLine
ILightSource
ILocation
ILocationEx
IMaterial
IMetrics
IMetrics2
IModel
IModel2
IModelEx
IPatch
IKCPathCollisionDetector
IProfiles
IPropertyArray
IPropertyArray2
IStdShape
IStrip
ISurface
IText
ITexture
ITransform
IUnknown
Collapse Open Cascade TechnologyOpen Cascade Technology
Collapse DataData
Collapse MovementMovement
Collapse FramesFrames
Collapse Oriented ObjectsOriented Objects
Collapse SectionsSections
Collapse GeneralGeneral
Collapse Topological InterfacesTopological Interfaces
Collapse Viewing InterfacesViewing Interfaces
Collapse Lines And CurvesLines And Curves
Collapse Symmetry InterfacesSymmetry Interfaces
Collapse Clipping plane interfacesClipping plane interfaces
Collapse AlgorithmsAlgorithms
Collapse 2D Geometry2D Geometry
Collapse Programming Samples and TutorialsProgramming Samples and Tutorials
Collapse OverviewOverview
Collapse DeploymentDeployment
Collapse .NET Samples.NET Samples
Collapse C++ SamplesC++ Samples
Collapse Visual Basic SamplesVisual Basic Samples
Collapse Delphi SamplesDelphi Samples
Collapse 3D Debugger3D Debugger
Collapse DeploymentDeployment
Licensing
Model Viewer
Open C++ Source
Technical Support
Skip Navigation LinksHome Page > KernelCAD Models > Import/Export > Adanced Data Exchange > STL Tree
STL Directory Tree

STL Directory Tree

As STL file format is designed to store a single triangulated mesh, KernelCAD Enterprise offers a way to store structured models in a file directory, called STL Directory Tree (STL Tree). The directory has specific structure described below.

See also DataFlow sample.

In this release any STL tree contains only .stl files and folders. The directory structure is designed to preserve structure of the mode with respect its child/parent relationship.

Example:

Above is an STL tree created for a model called "MyModel". 

There are two types of folders inside an STL Tree: Children folder and Object folder. 

Object folder can contains only a single (or none) stl file, which keeps geometry of a single object. and a single (or none) folder named "Children". Name of the stl file in an object folder must coincide with the name of the object folder.  Rectangle, Box and Triangle are the object folders in the above example. Rectangle folder contains a single file named Rectangle.stl.

A Children folder contains any (or none) number of stl files with arbitrary names and any number (or none) of Object folders. Children folders should not be empty. Top level folder or folder of the model ("MyModel" in the above example) is a Children folder.

Assuming that top level folder is at the level 0 all children folders are located at even levels in the tree. All Object folders are at odd levels.

During saving or loading of a KernelCAD model to/from an STL Tree objects are saved/loaded in separate stl files with the same name as the object..

Persistence to an STL tree can be performed with the help of IModelEx interface, which can be queried via: GetModel method of the  KernelCAD component -> IModel ->IModelEx. Methods IModelEx.SaveEx and IModelEx.LoadEx take a path of the top level folder (Path of MyModel in example above) and reference to an ISTLDataContext interface. The later interface is queried from the same IModelEx.  Mehtods of ISTLDataContext allow setting various options for the import/export operations. See main documentation for details. Call ISTLDataContext SetSeparateObjects(true) prior the save/ load operation will cause persistence to an STL tree as opposite to persistance to asingle STL file

Note that any model can be saved as single stl file if one does not set the SeparateObjects above or uses  ModelEx.Save, IModelEx.Load or simple by setting ModelPath property of the component. In this case whole model is considered as a single triangulated object. During every load of a single STL file the software detects if there are separate linked triangulated components inside the stl file, although it is not strictly conforms the STL standard . If such components are detected, they will be loaded as separate top-level objects in the model.