DG Kernel Documentation


Skip Navigation Links.
Start page
Quick Start
Search Page
Installation
Overview of the software
What is new
Licensing
Expand ModelsModels
Expand DG Kernel ComponentsDG Kernel Components
Collapse API ReferenceAPI Reference
Interface List
Vector Space
Expand General GeometryGeneral Geometry
Collapse ModelModel
Expand ViewView
Expand General ComputingGeneral Computing
Expand Samples and TutorialsSamples and Tutorials
Expand GraphicsGraphics
Expand Math ObjectsMath Objects
Expand DeprecatedDeprecated
Redistribution
Model Viewer
Open Source
Support
Skip Navigation LinksHome Page > API Reference > Model > Import / Export > ISTLDataContext Search Documentation


ISTLDataContext Interface

SetBinary
SetSeparateObjects
SetCreaseAngle
SetBuildTree
SetAnalysisType

ISTLDataContext is the base interface for setting different options for import/export of STL files.  Reference to this interface is used in various Save/Load methods. The set of options accessed by this interface is kept by the model object normally for the lifetime of the application.

ISTLDataContext can be queried from IModel or IModelEx interfaces

ISTLDataContext is available only in componets of DG Kernel Enterprise product

See also Interface List


HRESULT SetBinary( VARIANT_BOOL binary )

Parameters

binary - [in] - If true the solid will be saved in binary STL format.

Returns

S_OK in case of success.
Remarks:

The property has effect only during saving STL files. If binary is true the file will be saved in binary STL format. The default for this property is true.


HRESULT SetSeparateObjects( VARIANT_BOOL separate )

Parameters

separate - [in] Separate solids during load/save STL file operation.  

Return Values

S_OK in case of success.
Remarks:

By default during the load of an STL file the component analyses the loaded mesh and separates linked meshes as different objects. Set this property to false to improve performance. 

This property should also be set to true when saving or loading is performed to/from an STL Data Directory. In this case each STL file will be stored or loaded into/from different object in the model.

This property is ignored when surface analysis is disabled with a call to SetAnalysisType((int)ESTLAnalysis.eStlAnalysSkip) or if analysis type was set to auto with SetAnalysisType((int)ESTLAnalysis.eStlAnalysAuto) and the model was very large.


HRESULT SetCreaseAngle( double degrees )

Parameters

degrees - [in] Crease angle in degrees. See remarks

Return Values

S_OK in case of success.
Remarks:

This property has any effect only during load of an STL file. Crease angle is used to determine how to handle normals during the load.  When two adjoined faces have angle more than the crease angle two separate normals will be created one for each face. In the latter case edge between the face will look sharp. Set this property to a higher value to make the surface appear smooth.  The default value is 0.0.


HRESULT SetBuildTree( VARIANT_BOOL build )

Parameters

build - [in] Indicates whether to build the STL directory tree or save all objects as a flat set of STL files Default: true

Return Values

S_OK in case of success.
 
Remarks:

If the method is called with build set to false, during the next relevant saving operation the STL directory will not be created. Instead all object will be saved in a single folder.  It also would mean that any next relevant loading operation will load only files from the requested folder, not from its subdirectories, and all the objects will be made top-level objects of the model and will not have any children.


HRESULT SetAnalysisType( int type )

Parameters

type - [in] Member of ESTLAnalysis enumeration. Determines whether the surface analysis will be performed during the import

Remarks:

The method is relevant to STL load only and does not affect saving to STL. The method determines whether the surface analysis will be performed during the import. It is provided to allow faster load of very large files. The analysis separates objects which are geometrically isolated in the surface if the separation was enabled with SetSeparateObjects and recalculates normals to the surface to make the surface smooth instead of the faceted appearance common for STL models. When type is eStlAnalysAuto (value 0, default) the analysis is performed depending on size of the STL file to reduce load time when the file is large or to improve quality of the surface. The other two options force to perform improvement of the surface: eStlAnalysPerform (value 1) or skipping the analysis: eStlAnalysSkip (value 2). When analysis is not performed separation of objects is not performed either irrespectively of values set with SetSeparateObjects