DATAKIT SDK  V2026.1
Tesselation options

Options to better control the tesselation process. Main functions are in section Tesselation main functions. More...

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...
 
Dtk_bool get_tesselationSuppressDuplicateFace ()
 Get face duplication option. Returns 1 if enabled, 0 if disabled. More...
 
void set_tesselationSuppressDuplicateFace (Dtk_bool inBval)
 Set face duplication option. Default value is enabled (1). More...
 
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...
 
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...
 
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_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...
 

Detailed Description

Options to better control the tesselation process. Main functions are in section Tesselation main functions.

Function Documentation

◆ CheckAutoSurfaceIsSpring() [1/2]

Dtk_bool CheckAutoSurfaceIsSpring ( )

Get automatic surface spring check option. Returns 1 if enabled, 0 if disabled.

◆ CheckAutoSurfaceIsSpring() [2/2]

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.

◆ CheckUseEdgeTolerance() [1/2]

Dtk_bool CheckUseEdgeTolerance ( )

Get usage of edge tolerance to guide the tesselation. Returns 1 if enabled, 0 if disabled.

◆ CheckUseEdgeTolerance() [2/2]

void CheckUseEdgeTolerance ( Dtk_bool  inBval)

Set usage of edge tolerance to guide the tesselation. Default value is disabled (0).

◆ Dtk_GetMailleFacesVerif()

int Dtk_GetMailleFacesVerif ( )

Get status of additional verification of face/boundaries before tesselation. Returns 1 if enabled, 0 if disabled.

◆ Dtk_SetMailleFacesVerif()

void Dtk_SetMailleFacesVerif ( int  bval)

Set additional verification of face/boundaries before tesselation. Default false (0).

◆ get_tesselationSuppressDuplicateFace()

Dtk_bool get_tesselationSuppressDuplicateFace ( )

Get face duplication option. Returns 1 if enabled, 0 if disabled.

◆ set_tesselationSuppressDuplicateFace()

void set_tesselationSuppressDuplicateFace ( Dtk_bool  inBval)

Set face duplication option. Default value is enabled (1).

◆ tess_AddNaturalBoundariesForUnBounded() [1/2]

int tess_AddNaturalBoundariesForUnBounded ( )

Get boundaries computation option. Returns 1 if enabled, 0 if disabled.

◆ tess_AddNaturalBoundariesForUnBounded() [2/2]

void tess_AddNaturalBoundariesForUnBounded ( int  value)

Set boundaries computation option. Default value is enabled (1). See tess_getBoundariesFromMeshFace().

◆ tess_ComputeBoundariesFromMesh() [1/2]

int tess_ComputeBoundariesFromMesh ( )

Get boundaries computation from mesh option. Returns 1 if enabled, 0 if disabled.

◆ tess_ComputeBoundariesFromMesh() [2/2]

void tess_ComputeBoundariesFromMesh ( int  value)

Set boundaries computation from mesh option. Default value is enabled (1). See tess_getBoundariesFromMeshFace().

◆ tess_ComputeNormalesFromSurface() [1/2]

int tess_ComputeNormalesFromSurface ( )

Get normales computation option. Returns 1 if enabled, 0 if disabled.

◆ tess_ComputeNormalesFromSurface() [2/2]

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.

◆ tess_disableTolAngular() [1/2]

Dtk_bool tess_disableTolAngular ( )

Return angular tolerance activation. DTK_TRUE if angular tolerance is disabled.

◆ tess_disableTolAngular() [2/2]

void tess_disableTolAngular ( Dtk_bool  bval)

Set activation of angular tolerance.

◆ tess_disableTolLinear() [1/2]

Dtk_bool tess_disableTolLinear ( )

Return linear tolerance activation. DTK_TRUE if linear tolerance is disabled.

◆ tess_disableTolLinear() [2/2]

void tess_disableTolLinear ( Dtk_bool  bval)

Set activation of linear tolerance.

◆ tess_get_angular()

double tess_get_angular ( )

Get the current angular tolerance. See tess_set_angular().

◆ tess_get_linear()

double tess_get_linear ( )

Get the current linear tolerance. See tess_set_linear().

◆ tess_get_MaxSize()

double tess_get_MaxSize ( )

Get the current maximum size of a triangle edge. See tess_set_MaxSize().

◆ tess_get_optimize_mesh()

int tess_get_optimize_mesh ( )

Get the current state of the vertex map optimisation. See tess_set_optimize_mesh().

◆ tess_get_Ratio()

double tess_get_Ratio ( )

Get the current maximum ratio between longest and shortest edge of each triangle. See tess_set_Ratio().

◆ tess_get_Wireframe_Discretisation()

double tess_get_Wireframe_Discretisation ( )

Get the current linear tolerance for Wireframe tessellation. See tess_set_Wireframe_Discretisation().

◆ tess_set_angular()

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.

◆ tess_set_linear()

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.

Warning
This tolerance is a distance in mm, not a ratio, therefore it is relative to the model size. If you need a single value that works for any model (common for visualisation), use the angular tolerance.
If set to 0.0, the linear tolerance is disabled. To re-enable it, set a valid linear tolerance and call tess_disableTolLinear(DTK_FALSE).

◆ tess_set_MaxSize()

void tess_set_MaxSize ( double  tol)

Set the maximum size of a triangle edge. Default value: inf (mm)

Parameters
[in]tol(mm): maximum size of a triangle edge

◆ tess_set_optimize_mesh()

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 ):

  • If enabled: vertex array size = 36
  • If disabled: vertex array size = 24
    Warning
    Not compatible with Dtk_mesh::compute_round_normals(). You must disable this optimization to use it.

◆ tess_set_Ratio()

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

Example with ratio= 1000.0 (no constraint)

◆ tess_set_Wireframe_Discretisation()

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.