DATAKIT SDK  V2026.1
tess.h File Reference

Go to the source code of this file.

Data Structures

struct  Dtk_OrientedFaceStr
 
class  FaceBoundariesToPolylines
 

Functions

Dtk_bool CheckAutoSurfaceIsSpring ()
 Get automatic surface spring check option. Returns 1 if enabled, 0 if disabled. More...
 
void CheckAutoSurfaceIsSpring (Dtk_bool inBval)
 Set automatic surface spring check option. If enabled, all periodic surface will be tesselated more accurately using set_TesselateSurfaceMethod(1). Manual activation of set_TesselateSurfaceMethod(1) is not necessary anymore because of this option. More...
 
Dtk_bool CheckUseEdgeTolerance ()
 Get usage of edge tolerance to guide the tesselation. Returns 1 if enabled, 0 if disabled. More...
 
void CheckUseEdgeTolerance (Dtk_bool inBval)
 Set usage of edge tolerance to guide the tesselation. Default value is disabled (0). More...
 
int Dtk_GetMailleFacesVerif ()
 Get status of additional verification of face/boundaries before tesselation. Returns 1 if enabled, 0 if disabled. More...
 
void Dtk_SetMailleFacesVerif (int bval)
 Set additional verification of face/boundaries before tesselation. Default false (0). More...
 
int end_stl_fic (int *ient)
 
void get_tesselation_activateSplitMode (int &outmode, double &outratio)
 
Dtk_bool get_tesselationSuppressDuplicateFace ()
 Get face duplication option. Returns 1 if enabled, 0 if disabled. More...
 
int init_stl_write (Dtk_string sfic)
 
void reinit_SplitMode ()
 
void set_activationSplitModeFromConfig ()
 
void set_tesselation_activateSplitMode (const int inmode, const double inratio)
 
void set_tesselationSuppressDuplicateFace (Dtk_bool inBval)
 Set face duplication option. Default value is enabled (1). More...
 
 SetAsDeprecated ("2026.1", "Manual activation not needed/supported anymore, see CheckAutoSurfaceIsSpring(). If set_TesselateSurfaceMethod(0), remove this call. If set_TesselateSurfaceMethod(1), replace it by CheckAutoSurfaceIsSpring(DTK_TRUE), or lower the linear and/or angular tol to keep exactly the same results.") void set_TesselateSurfaceMethod(int ival)
 
 SetAsDeprecated ("2026.1", "Manual activation not supported anymore.") int get_TesselateSurfaceMethod()
 
 SetAsDeprecated ("2026.1", "Use tess_FacesArrayToMesh instead.") extern int tess_TesselateMemo(Dtk_MeshPtr &outMesh
 
 SetAsDeprecated ("2026.1", "Use tess_FaceToMesh or tess_FacesArrayToMesh instead.") extern Dtk_ErrorStatus tess_AddFace(Dtk_FacePtr &inFace)
 
 SetAsDeprecated ("2026.1", "Use tess_getBoundariesFromMeshFace( const Dtk_MeshPtr&, const Dtk_mesh_face *, Dtk_tab<Dtk_tab<Dtk_PolylinePtr>> &) instead") void tess_getBoundariesFromMeshFace(const Dtk_MeshPtr &mesh
 
 SetAsDeprecated ("2026.1", "Use tess_InitTesselation() instead.") extern int tess_InitLocalTess()
 
int tess_AddNaturalBoundariesForUnBounded ()
 Get boundaries computation option. Returns 1 if enabled, 0 if disabled. More...
 
void tess_AddNaturalBoundariesForUnBounded (int value)
 Set boundaries computation option. Default value is enabled (1). See tess_getBoundariesFromMeshFace(). More...
 
Dtk_ErrorStatus tess_BodyToMeshes (const Dtk_BodyPtr &inBodyToWrite, Dtk_tab< Dtk_MeshPtr > &outMeshes, Dtk_tab< Dtk_Int32 > &outIsSolid, Dtk_bool inTessWireframe=DTK_FALSE, Dtk_bool inApplyRenderInfos=DTK_FALSE)
 Tesselate a body. Generates one mesh per shell in the body. More...
 
int tess_ComputeBoundariesFromMesh ()
 Get boundaries computation from mesh option. Returns 1 if enabled, 0 if disabled. More...
 
void tess_ComputeBoundariesFromMesh (int value)
 Set boundaries computation from mesh option. Default value is enabled (1). See tess_getBoundariesFromMeshFace(). More...
 
int tess_ComputeNormalesFromSurface ()
 Get normales computation option. Returns 1 if enabled, 0 if disabled. More...
 
void tess_ComputeNormalesFromSurface (int value)
 Set normales computation from surface option. Enabled by default. If enabled, the normals of each vertex are computed from the CAD surface (smooth, more precise), otherwise they are computed from the triangles. More...
 
Dtk_bool tess_disableTolAngular ()
 Return angular tolerance activation. DTK_TRUE if angular tolerance is disabled. More...
 
void tess_disableTolAngular (Dtk_bool bval)
 Set activation of angular tolerance. More...
 
Dtk_bool tess_disableTolLinear ()
 Return linear tolerance activation. DTK_TRUE if linear tolerance is disabled. More...
 
void tess_disableTolLinear (Dtk_bool bval)
 Set activation of linear tolerance. More...
 
void tess_EndTesselation ()
 Free the data used by tesselation library. More...
 
Dtk_ErrorStatus tess_FacesArrayToMesh (Dtk_tab< Dtk_FacePtr > &inTabFace, Dtk_MeshPtr &outMesh, Dtk_Int32 *outIsSolid)
 Tesselate an array of Faces. More...
 
Dtk_ErrorStatus tess_FacesArrayToMesh (Dtk_tab< Dtk_OrientedFaceStr > &inTabFace, Dtk_MeshPtr &outMesh, Dtk_Int32 *outIsSolid)
 
Dtk_ErrorStatus tess_FaceToMesh (Dtk_FacePtr &inFace, Dtk_MeshPtr &outMesh)
 Tesselate a single face. More...
 
Dtk_ErrorStatus tess_FaceToMesh (Dtk_OrientedFaceStr &inTabFace, Dtk_MeshPtr &outMesh)
 
double tess_get_angular ()
 Get the current angular tolerance. See tess_set_angular(). More...
 
double tess_get_linear ()
 Get the current linear tolerance. See tess_set_linear(). More...
 
double tess_get_MaxSize ()
 Get the current maximum size of a triangle edge. See tess_set_MaxSize(). More...
 
int tess_get_optimize_mesh ()
 Get the current state of the vertex map optimisation. See tess_set_optimize_mesh(). More...
 
double tess_get_Ratio ()
 Get the current maximum ratio between longest and shortest edge of each triangle. See tess_set_Ratio(). More...
 
double tess_get_Wireframe_Discretisation ()
 Get the current linear tolerance for Wireframe tessellation. See tess_set_Wireframe_Discretisation(). More...
 
void tess_getBoundariesFromMeshFace (const Dtk_MeshPtr &mesh, const Dtk_mesh_face *inFace, Dtk_tab< Dtk_tab< Dtk_PolylinePtr >> &outBoundaries)
 Get the boundaries (outer and inner) of a mesh face as polylines. Each shell yields a Dtk_mesh, each face of the shell yields a Dtk_mesh_face in the Dtk_mesh, and each edge of the face yields a Dtk_Polyline that you can get with this function. To get the body indice of the corresponding edge, use polyline->get_info()->FindAttribute("TOPO_ID_EDGE",dtk_val) where dtk_val is an integer value containing the TopoId of the edge. The first polyline is the outer boundary, the others are inner boundaries (holes). More...
 
int tess_InitTesselation ()
 Init the tesselation library with parameters suited for most visualisation purposes Linear tolerance is deactivated, and angular tolerance set to 10 degrees. More...
 
int tess_InitTesselation (Dtk_string inWorkingDirectory, double inTolerance)
 Init the tesselation library. More...
 
void tess_set_angular (double angle)
 Set angular tolerance (radian). Default value: 10°. Maximum angle between a triangle and the CAD surface. This tolerance is independent of the model size, therefore a single value can be used for any model. It is well suited for visualisation purposes. More...
 
void tess_set_linear (double tol)
 Set linear tolerance (mm). Maximum chordal error accepted between the CAD surface and the tesselated mesh. Smaller value produces finer mesh, greater value produces coarser mesh. For visualization the constraint is purely visual, so an exact distance per model is unnecessary. In this case, using only an angular tolerance is sufficient. For engineering workflows (CFD, FEM, etc.), stricter geometric control is required, and a linear tolerance must be specified. A common guideline is to set it to a proportion of the model bbox diagonal. Note that angular tolerance is still relevant when linear tolerance is set, to avoids loosing details in areas with small details, like high curvature zones. More...
 
void tess_set_MaxSize (double tol)
 Set the maximum size of a triangle edge. Default value: inf (mm) More...
 
void tess_set_optimize_mesh (int ival)
 Set a vertex map optimisation that reduces the mesh memory footprint (the geometry stay the same). Enabled by default. If enabled, two vertices of the same face that have the same coordinates will be stored only once, and shared by index. For example if you tesselate a cube ( 6 faces ): More...
 
void tess_set_Ratio (double tol)
 Set a maximum ratio between longest and shortest edge of each triangle. With 1.0 only equilateral triangles are generated. With 2.0, the longest edge can be at most twice the shortest edge, etc. Example with ratio= 1.0
More...
 
void tess_set_Wireframe_Discretisation (double tol)
 Set linear tolerance for Wireframe tessellation. Default value is 0.001 (mm). Smaller value produces finer wireframes, greater value produces coarser wireframes. More...
 
Dtk_ErrorStatus tess_ShellToMesh (const Dtk_ShellPtr &inShell, Dtk_MeshPtr &outMesh, Dtk_Int32 *outIsSolid)
 Tesselate a shell. More...
 
Dtk_ErrorStatus tess_TesselateFeature_to_dtk_mesh (Dtk_FeaturePtr &feat, Dtk_MeshPtr &outMesh)
 
Dtk_ErrorStatus TesselationIsStarted ()
 Return current status of tesselation started. More...
 
int write_mesh_solid (const Dtk_MeshPtr &tm)
 

Variables

const Dtk_mesh_faceinFace
 
const Dtk_mesh_face Dtk_tab< Dtk_tab< Dtk_MeshPolylinePtr > > & outBoundaries
 
int * outIsSolid
 

Function Documentation

◆ end_stl_fic()

int end_stl_fic ( int *  ient)

◆ get_tesselation_activateSplitMode()

void get_tesselation_activateSplitMode ( int &  outmode,
double &  outratio 
)

◆ init_stl_write()

int init_stl_write ( Dtk_string  sfic)

◆ reinit_SplitMode()

void reinit_SplitMode ( )

◆ set_activationSplitModeFromConfig()

void set_activationSplitModeFromConfig ( )

◆ set_tesselation_activateSplitMode()

void set_tesselation_activateSplitMode ( const int  inmode,
const double  inratio 
)

◆ SetAsDeprecated() [1/6]

SetAsDeprecated ( "2026.1"  ,
"Manual activation not needed/supported  anymore,
see   CheckAutoSurfaceIsSpring). If set_TesselateSurfaceMethod(0,
remove this call. If   set_TesselateSurfaceMethod1,
replace it by   CheckAutoSurfaceIsSpringDTK_TRUE,
or lower the linear and/or angular tol to keep exactly the same results."   
)
Deprecated:
Manual activation not needed/supported anymore see CheckAutoSurfaceIsSpring()

◆ SetAsDeprecated() [2/6]

SetAsDeprecated ( "2026.1"  ,
"Manual activation not supported anymore."   
)
Deprecated:
Manual activation not supported anymore

◆ SetAsDeprecated() [3/6]

SetAsDeprecated ( "2026.1"  ,
"Use tess_FacesArrayToMesh instead."   
) &
Deprecated:
Use tess_FacesArrayToMesh instead

◆ SetAsDeprecated() [4/6]

SetAsDeprecated ( "2026.1"  ,
"Use tess_FaceToMesh or tess_FacesArrayToMesh instead."   
) &
Deprecated:
Use tess_FaceToMesh or tess_FacesArrayToMesh instead
Deprecated:
Use tess_AddFace instead

◆ SetAsDeprecated() [5/6]

SetAsDeprecated ( "2026.1"  ,
"Use tess_getBoundariesFromMeshFace( const Dtk_MeshPtr&, const Dtk_mesh_face *, Dtk_tab<Dtk_tab<Dtk_PolylinePtr>> &) instead"   
) const &
Deprecated:
Use tess_getBoundariesFromMeshFace instead

◆ SetAsDeprecated() [6/6]

SetAsDeprecated ( "2026.1"  ,
"Use tess_InitTesselation() instead."   
)

◆ tess_FacesArrayToMesh()

Dtk_ErrorStatus tess_FacesArrayToMesh ( Dtk_tab< Dtk_OrientedFaceStr > &  inTabFace,
Dtk_MeshPtr outMesh,
Dtk_Int32 outIsSolid 
)

◆ tess_FaceToMesh()

Dtk_ErrorStatus tess_FaceToMesh ( Dtk_OrientedFaceStr inTabFace,
Dtk_MeshPtr outMesh 
)

◆ tess_TesselateFeature_to_dtk_mesh()

Dtk_ErrorStatus tess_TesselateFeature_to_dtk_mesh ( Dtk_FeaturePtr feat,
Dtk_MeshPtr outMesh 
)

◆ write_mesh_solid()

int write_mesh_solid ( const Dtk_MeshPtr tm)

Variable Documentation

◆ inFace

const Dtk_mesh_face* inFace

◆ outBoundaries

◆ outIsSolid

int* outIsSolid