DATAKIT API  V2025.1
tess.h File Reference

Go to the source code of this file.

Data Structures

struct  Dtk_OrientedFaceStr
 : This structure contain a pointer to a Dtk_Face and the Value of orientation of this face from shell When use this structure if you use the folllowing methods to tesselate : tess_AddFace() , tess_FacesArrayToMesh() , tess_FaceToMesh() you can replace the Dtk_facePtr by this structure advantage : the tesselation use the orientation boolean to reverse or not the MeshFace resulting More...
 
class  FaceBoundariesToPolylines
 

Functions

Dtk_bool CheckAutoSurfaceIsSpring ()
 : return current status of automatically check of surface is periodic available values : 0 = disable 1 = enable More...
 
void CheckAutoSurfaceIsSpring (Dtk_bool inBval)
 : Enable or disable automatically check of surface is periodic More...
 
Dtk_bool CheckUseEdgeTolerance ()
 : return current status of if we use the tolerance of edge and face read from the part available values : 0 = disable 1 = enable More...
 
void CheckUseEdgeTolerance (Dtk_bool inBval)
 : Enable or disable if we use the tolerance of edge/face read from the part More...
 
int Dtk_GetMailleFacesVerif ()
 : return status of control of face/boundaries More...
 
void Dtk_SetMailleFacesVerif (int bval)
 : enable or disable control of faces More...
 
int end_stl_fic (int *ient)
 Close the STL File. More...
 
int get_TesselateSurfaceMethod ()
 : return current computation method for surface tesselation available values : 0 = usual method 1 = fine method good for spring entities but increase number of points More...
 
void get_tesselation_activateSplitMode (int &outmode, double &outratio)
 : read value of splitting of surface More...
 
Dtk_bool get_tesselationSuppressDuplicateFace ()
 : return current status of suppress duplicate face option default value is enable to deactivate this option use set_tesselationSuppressDuplicateFace(0) More...
 
int init_stl_write (Dtk_string sfic)
 : Open and initialize the STL File More...
 
void reinit_SplitMode ()
 : disable splitting of surface More...
 
void set_activationSplitModeFromConfig ()
 : memorize option for splitting of surfaces before tessellation
More...
 
void set_TesselateSurfaceMethod (int ival)
 : select computation method for surface tesselation More...
 
void set_tesselation_activateSplitMode (const int inmode, const double inratio)
 : memorize option for splitting of surfaces before tessellation
More...
 
void set_tesselationSuppressDuplicateFace (Dtk_bool inBval)
 : Enable or disable the suppression of duplicate face before tessellation More...
 
Dtk_ErrorStatus tess_AddFace (Dtk_FacePtr &inFace)
 
Dtk_ErrorStatus tess_AddFace (Dtk_OrientedFaceStr &inFace)
 : overwriteing of tess_AddFace with an Dtk_OrientedFace in place of Dtk_Face, More...
 
int tess_AddNaturalBoundariesForUnBounded ()
 : return status of option add natural external boundary for an unbounded surface More...
 
void tess_AddNaturalBoundariesForUnBounded (int value)
 : enable or disable option add natural external boundary for an unbounded surface 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)
 : Make Tesselation from a Dtk_body and create a Set of Dtk_mesh if available More...
 
int tess_ComputeBoundariesFromMesh ()
 : Check value of option memorize noundaries of mesh More...
 
void tess_ComputeBoundariesFromMesh (int value)
 : enable or disable compute boundaries from mesh More...
 
int tess_ComputeNormalesFromSurface ()
 : Check value of option compute normales of vertex from real surface More...
 
void tess_ComputeNormalesFromSurface (int value)
 : enable or disable compute normales from surfaces More...
 
Dtk_bool tess_disableTolAngular ()
 : return state of Angular tolerance method More...
 
void tess_disableTolAngular (Dtk_bool bval)
 : activate or not the Angular tolerance method More...
 
Dtk_bool tess_disableTolLinear ()
 : return state of linear tolerance method More...
 
void tess_disableTolLinear (Dtk_bool bval)
 : activate or not the linear tolerance method 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)
 : Make Tesselation from a Dtk_tab of faces and create a Dtk_mesh if available More...
 
Dtk_ErrorStatus tess_FacesArrayToMesh (Dtk_tab< Dtk_OrientedFaceStr > &inTabFace, Dtk_MeshPtr &outMesh, Dtk_Int32 *outIsSolid)
 : Make Tesselation from a Dtk_tab of Oriented face and create a Dtk_mesh if available More...
 
Dtk_ErrorStatus tess_FaceToMesh (Dtk_FacePtr &inTabFace, Dtk_MeshPtr &outMesh)
 : Tesselate a Face from a Dtk_body More...
 
Dtk_ErrorStatus tess_FaceToMesh (Dtk_OrientedFaceStr &inTabFace, Dtk_MeshPtr &outMesh)
 : Tesselate a Face from a Dtk_body More...
 
double tess_get_angular ()
 : return the current Angle used for cord heigh ratio More...
 
double tess_get_linear ()
 : return current linear tolerance More...
 
double tess_get_MaxSize ()
 : gets maximum size of triangles More...
 
int tess_get_optimize_mesh ()
 : return status of the optimization of the vertex map in the detk_mesh class More...
 
double tess_get_Ratio ()
 : return the current ratio More...
 
double tess_get_Wireframe_Discretisation ()
 : return current linear tolerance for Wrireframe entities More...
 
void tess_getBoundariesFromMeshFace (const Dtk_MeshPtr &mesh, const Dtk_mesh_face *inFace, Dtk_tab< Dtk_tab< Dtk_MeshPolylinePtr > > &outBoundaries)
 
void tess_getBoundariesFromMeshFace (const Dtk_MeshPtr &mesh, const Dtk_mesh_face *inFace, Dtk_tab< Dtk_tab< Dtk_PolylinePtr > > &outBoundaries)
 : reorder the polylines of a Dtk_mesh_face into correct loop More...
 
int tess_InitLocalTess ()
 : method of tesselation by memorization the first call is tess_InitLocalTess(); to initialize memory after you can add in the stack a Dtk_FacePtr if you use new classes with tess_AddFace() or surface trimmed or not with tess_AddNaturalSurface() and when you want you can compute the stl of the stacked surfaces with tess_TesselateMemo() More...
 
int tess_InitTesselation ()
 Init the tesselation library. More...
 
int tess_InitTesselation (Dtk_string inWorkingDirectory, double inTolerance)
 Init the tesselation library. More...
 
void tess_set_angular (double angle)
 : Set angle for cord heigh ratio method More...
 
void tess_set_linear (double tol)
 : Set tolerance for linear tolerance method More...
 
void tess_set_MaxSize (double tol)
 : sets maximum size of triangles More...
 
void tess_set_optimize_mesh (int ival)
 : Activate or not the optimization of the vertex map More...
 
void tess_set_Ratio (double tol)
 : define a ratio More...
 
void tess_set_Wireframe_Discretisation (double tol)
 : Set tolerance for linear tolerance method for Wireframe entities More...
 
Dtk_ErrorStatus tess_ShellToMesh (const Dtk_ShellPtr &inShell, Dtk_MeshPtr &outMesh, Dtk_Int32 *outIsSolid)
 : Make Tesselation from a Dtk_shell and create a Dtk_MeshPtr if available More...
 
Dtk_ErrorStatus tess_TesselateFeature_to_dtk_mesh (Dtk_FeaturePtr &feat, Dtk_MeshPtr &outMesh)
 : Tesselate a Feature entity More...
 
int tess_TesselateMemo (Dtk_MeshPtr &outMesh, int *outIsSolid)
 
Dtk_ErrorStatus TesselationIsStarted ()
 : Check if tesselation is initialized More...
 
int write_mesh_solid (const Dtk_MeshPtr &tm)
 Write a Dtk_mesh into the STL file. More...
 

Function Documentation

◆ CheckAutoSurfaceIsSpring() [1/2]

Dtk_bool CheckAutoSurfaceIsSpring ( )

: return current status of automatically check of surface is periodic available values : 0 = disable 1 = enable

If enable each surface will be checked and if spring found the set_TesselateSurfaceMethod is called with value 1 ( fine ) for this surface only

◆ CheckAutoSurfaceIsSpring() [2/2]

void CheckAutoSurfaceIsSpring ( Dtk_bool  inBval)

: Enable or disable automatically check of surface is periodic

Parameters
[in]value of option 1=enable 0=disable

If enable each surface will be checked and if spring found the set_TesselateSurfaceMethod is called with value 1 ( fine ) for this surface only Default value : of this status 0 ( disable )

◆ CheckUseEdgeTolerance() [1/2]

Dtk_bool CheckUseEdgeTolerance ( )

: return current status of if we use the tolerance of edge and face read from the part available values : 0 = disable 1 = enable

These tolerance value can be available only from several format ( currently Parasolid format )

◆ CheckUseEdgeTolerance() [2/2]

void CheckUseEdgeTolerance ( Dtk_bool  inBval)

: Enable or disable if we use the tolerance of edge/face read from the part

Parameters
[in]value of option 1=enable 0=disable

if true we read from the Body the greatest value of tolerance present in part If we have a value greatest than a micron ( 0.001 millimeter ) and smallest than 5.0 millimeter we use this value to check connexion between faces of Body before tesselation

◆ Dtk_GetMailleFacesVerif()

int Dtk_GetMailleFacesVerif ( )

: return status of control of face/boundaries

Parameters
[in]value of option 1= enable 0 disable if the option enable each face/boundaries are checked before tesselation This option allows good results on ill-defined faces/boundaries but it's time consuming Default value : option disable

◆ Dtk_SetMailleFacesVerif()

void Dtk_SetMailleFacesVerif ( int  bval)

: enable or disable control of faces

Parameters
[in]value of option 1= enable 0 disable if the option enable each face are checked before tesselation This option allows good results on ill-defined faces but it's time consuming Default value : option disable

◆ end_stl_fic()

int end_stl_fic ( int *  ient)

Close the STL File.

Parameters
[out]ient : number of facettes written
Returns
int

Sample:

◆ get_TesselateSurfaceMethod()

int get_TesselateSurfaceMethod ( )

: return current computation method for surface tesselation available values : 0 = usual method 1 = fine method good for spring entities but increase number of points

◆ get_tesselation_activateSplitMode()

void get_tesselation_activateSplitMode ( int &  outmode,
double &  outratio 
)

: read value of splitting of surface

Parameters
[out]outmode value of option 0=none 1= based on curvature 2=based on nodal sequence
[out]outratio value of trigger to split the surface

if outmode different of 0 we check a shell to be tessellate and if necessary surfaces are splitted Default value : of this status 0 ( disable )

◆ get_tesselationSuppressDuplicateFace()

Dtk_bool get_tesselationSuppressDuplicateFace ( )

: return current status of suppress duplicate face option default value is enable to deactivate this option use set_tesselationSuppressDuplicateFace(0)

◆ init_stl_write()

int init_stl_write ( Dtk_string  sfic)

: Open and initialize the STL File

Parameters
[in]sfic : Name of File to be write
Returns
int 0

Sample:

◆ reinit_SplitMode()

void reinit_SplitMode ( )

: disable splitting of surface


◆ set_activationSplitModeFromConfig()

void set_activationSplitModeFromConfig ( )

: memorize option for splitting of surfaces before tessellation

same as set_tesselation_activateSplitMode() but the value of mode and ratio will be read directly from the current configuration file ( if available ) value read in chapter [TRANSFORMATION ENTITES] mode in SPLIT_NOC2_FACES_MODE ratio in SPLIT_RAP Default value : of this status 0 ( disable )

◆ set_TesselateSurfaceMethod()

void set_TesselateSurfaceMethod ( int  ival)

: select computation method for surface tesselation

Parameters
[in]value of option 1= spring version 0 current version value = 1 use this method when you have springs entities, usually these surfaces cannot correctly tesselate with default method But this method increase the size of mesh result Default value : option current ( 0) value

◆ set_tesselation_activateSplitMode()

void set_tesselation_activateSplitMode ( const int  inmode,
const double  inratio 
)

: memorize option for splitting of surfaces before tessellation

Parameters
[in]imode = value of option : 0=none (disable) 1=based on curvature 2=based on nodal sequence

if different of 0 we check a shell to be tessellate and if necessary surfaces are splitted Default value : of this status 0 ( disable )

◆ set_tesselationSuppressDuplicateFace()

void set_tesselationSuppressDuplicateFace ( Dtk_bool  inBval)

: Enable or disable the suppression of duplicate face before tessellation

Parameters
[in]value of option 1=enable 0=disable Default value : Enable (1)

◆ tess_AddFace() [1/2]

Dtk_ErrorStatus tess_AddFace ( Dtk_FacePtr inFace)

◆ tess_AddFace() [2/2]

Dtk_ErrorStatus tess_AddFace ( Dtk_OrientedFaceStr inFace)

: overwriteing of tess_AddFace with an Dtk_OrientedFace in place of Dtk_Face,

◆ tess_AddNaturalBoundariesForUnBounded() [1/2]

int tess_AddNaturalBoundariesForUnBounded ( )

: return status of option add natural external boundary for an unbounded surface

Parameters
[in]value of option 1= enable 0=disable -1= ERROR no Config available if the option enable each unbounded face has natural boundarie added and it will be tesselate if this option disable the face isn't tesselate Default value : option disable

◆ tess_AddNaturalBoundariesForUnBounded() [2/2]

void tess_AddNaturalBoundariesForUnBounded ( int  value)

: enable or disable option add natural external boundary for an unbounded surface

Parameters
[in]value of option 1= enable 0=disable if the option enable each unbounded face has natural boundarie added and it will be tesselate if this option disable the face isn't tesselate Default value : option disable

◆ tess_BodyToMeshes()

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 
)

: Make Tesselation from a Dtk_body and create a Set of Dtk_mesh if available

Parameters
[in]inBodyToWrite : Body to be tesselate
[in]inTessWireframe : TRUE if you want to Tesselate Wireframe
[in]inApplyRenderInfos : TRUE if you want to Apply Render from body to meshes
[out]outMeshes : result of tesselate
[out]outIsSolid : status of each mesh ( 1 is solid 0 is open )
Returns
int DtkNoError : if OK

Remark: the result contain one Dtk_mesh per shell

◆ tess_ComputeBoundariesFromMesh() [1/2]

int tess_ComputeBoundariesFromMesh ( )

: Check value of option memorize noundaries of mesh

Returns
[out] :state of config 0 no memorized , 1 memorized ( default value ) or -1 in case of error API not started

◆ tess_ComputeBoundariesFromMesh() [2/2]

void tess_ComputeBoundariesFromMesh ( int  value)

: enable or disable compute boundaries from mesh

Parameters
[in]value of option 1= enable 0 disable if this option is enable the memory occupation of Dtk_mesh is smaller

◆ tess_ComputeNormalesFromSurface() [1/2]

int tess_ComputeNormalesFromSurface ( )

: Check value of option compute normales of vertex from real surface

Returns
[out] :state of config 0 no compute , 1 compute ( default value ) or -1 in case of error API not started

◆ tess_ComputeNormalesFromSurface() [2/2]

void tess_ComputeNormalesFromSurface ( int  value)

: enable or disable compute normales from surfaces

Parameters
[in]value of option 1= enable 0 disable if the option enable each normales will be computed from the real surfaces, with the orientation of the face if enable with this option the normales of each vertex are correct value if the option is enable the normales of each vertex will be computed from the triangle. this option is most faster but less accurate

◆ tess_disableTolAngular() [1/2]

Dtk_bool tess_disableTolAngular ( )

: return state of Angular tolerance method

Returns
[in] : return DTK_TRUE if Angular tolerance method is disable ( default value ) or DTK_FALSE if enable
see tess_set_angular() for angle explanation

◆ tess_disableTolAngular() [2/2]

void tess_disableTolAngular ( Dtk_bool  bval)

: activate or not the Angular tolerance method

Parameters
[in]DTK_TRUE to disable Angular tolerance method ( default value ) DTK_FALSE to enable linear tolerance method
see tess_set_angular() for angle explanation

◆ tess_disableTolLinear() [1/2]

Dtk_bool tess_disableTolLinear ( )

: return state of linear tolerance method

Returns
[in] : return DTK_TRUE if linear tolerance method is disable or DTK_FALSE if enable ( default value )

◆ tess_disableTolLinear() [2/2]

void tess_disableTolLinear ( Dtk_bool  bval)

: activate or not the linear tolerance method

Parameters
[in]DTK_TRUE to disable linear tolerance method DTK_FALSE to enable linear tolerance method ( default value )

◆ tess_EndTesselation()

void tess_EndTesselation ( )

Free the data used by tesselation library.

Returns
void

Sample:

◆ tess_FacesArrayToMesh() [1/2]

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

: Make Tesselation from a Dtk_tab of faces and create a Dtk_mesh if available

Parameters
[in]inTabFace : Dtk_tab of faces to be tesselate
[out]outMesh : result of tesselate
[out]outIsSolid : status of mesh ( 1 is solid 0 is open )
Returns
int DtkNoError : if OK

◆ tess_FacesArrayToMesh() [2/2]

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

: Make Tesselation from a Dtk_tab of Oriented face and create a Dtk_mesh if available

Parameters
[in]inTabFace : Dtk_tab of faces to be tesselate
[out]outMesh : result of tesselate
[out]outIsSolid : status of mesh ( 1 is solid 0 is open )

: dtk_OrientedFace contain a Dtk_FacePtr with orientation of face from shell method to obtain this orientation : err = inShell->GetFace( i, face, orientation ); //face = Dtk_FacePtr //orientation = face orientation in shell inTabFace.pushback(dtk_OrientedFace(face,orientation));

Returns
int DtkNoError : if OK

◆ tess_FaceToMesh() [1/2]

Dtk_ErrorStatus tess_FaceToMesh ( Dtk_FacePtr inTabFace,
Dtk_MeshPtr outMesh 
)

: Tesselate a Face from a Dtk_body

Parameters
[in]inTabFace = face to be tesselate
[out]outMesh = result of tesselation The Dtk_body of the Dtk_face must be alive

◆ tess_FaceToMesh() [2/2]

Dtk_ErrorStatus tess_FaceToMesh ( Dtk_OrientedFaceStr inTabFace,
Dtk_MeshPtr outMesh 
)

: Tesselate a Face from a Dtk_body

Parameters
[in]inTabFace = face with her orientation to be tessellate
[out]outMesh = result of tesselation The Dtk_body of the Dtk_face must be alive

◆ tess_get_angular()

double tess_get_angular ( )

: return the current Angle used for cord heigh ratio

Returns
[double] : value of angle ( in radian ) see tess_set_angular() for angle explanation

◆ tess_get_linear()

double tess_get_linear ( )

: return current linear tolerance

Returns
: tolerance value
Remark :
if the value minus or egal at zero, linear method is disable

◆ tess_get_MaxSize()

double tess_get_MaxSize ( )

: gets maximum size of triangles

Returns
double

Sample:

◆ tess_get_optimize_mesh()

int tess_get_optimize_mesh ( )

: return status of the optimization of the vertex map in the detk_mesh class

Returns
int 0 if optimization is disable, 1 if the optimization is enable

Sample:

◆ tess_get_Ratio()

double tess_get_Ratio ( )

: return the current ratio

Returns
double

Remark: See function tess_set_Ratio() above for information

◆ tess_get_Wireframe_Discretisation()

double tess_get_Wireframe_Discretisation ( )

: return current linear tolerance for Wrireframe entities

Returns
: tolerance value
Remark :
default value is 0.001 This value is use only for curves entities in wireframe entities of a Dtk_Body

◆ tess_getBoundariesFromMeshFace() [1/2]

void tess_getBoundariesFromMeshFace ( const Dtk_MeshPtr mesh,
const Dtk_mesh_face inFace,
Dtk_tab< Dtk_tab< Dtk_MeshPolylinePtr > > &  outBoundaries 
)

◆ tess_getBoundariesFromMeshFace() [2/2]

void tess_getBoundariesFromMeshFace ( const Dtk_MeshPtr mesh,
const Dtk_mesh_face inFace,
Dtk_tab< Dtk_tab< Dtk_PolylinePtr > > &  outBoundaries 
)

: reorder the polylines of a Dtk_mesh_face into correct loop

Parameters
[in]mesh
[in]inFace = face to be processed
[out]outBoundaries = result function Remark: Since release V73 we add an attribut in info field of Polyline inf->FindAttribute("TOPO_ID_EDGE",dtk_val) Dtk_val is integer value contain TopoId of Edge Sample:
. Dtk_MeshPtr mesh;\n
. Dtk_Size_t nb_faces =mesh->get_nb_mesh_face();\n
. for ( i=0;i<nb_faces;i++) \n
. { \n
. mf = mesh->get_mesh_face(i); \n
. getBoundariesFromMeshFace(mesh,mf,bound);\n
. Dtk_Size_t nbloop = boundaries.size();\n
. //bound[0] ---> is the outer boundary\n
. // if nbloop > 1 the other is inner boundary\n
. // nb curves of outer boundary = boundaries[0].size();\n
. \n
. //after use don't forget to deallocate bound\n
. for (Dtk_Size_t k=0;k<nbloop;k++)\n
. {\n
. Dtk_Size_t nbcurv = boundaries[k].size();\n
. for (Dtk_Size_t l=0;l<nbcurv;l++)\n
. {\n
. boundaries[k][l]=NULL;\n
. }\n
. boundaries[k].clear();\n
. }\n
. boundaries.clear();\n
. }\n

◆ tess_InitLocalTess()

int tess_InitLocalTess ( )

: method of tesselation by memorization the first call is tess_InitLocalTess(); to initialize memory after you can add in the stack a Dtk_FacePtr if you use new classes with tess_AddFace() or surface trimmed or not with tess_AddNaturalSurface() and when you want you can compute the stl of the stacked surfaces with tess_TesselateMemo()

◆ tess_InitTesselation() [1/2]

int tess_InitTesselation ( )

Init the tesselation library.

Returns
int 0 if OK
-4 no licence found \Remarks : temporary working dir is folder define when you call StartAPI tolerance used is the default value , 10 degre in angular mode

Sample:

◆ tess_InitTesselation() [2/2]

int tess_InitTesselation ( Dtk_string  inWorkingDirectory,
double  inTolerance 
)

Init the tesselation library.

Parameters
[in]inWorkingDirectory : Directory for temporary file used for tesselation
[in]inTolerance : Tolerance :chordal error on triangles
Returns
int 0 if OK
-4 no licence found

Sample:

◆ tess_set_angular()

void tess_set_angular ( double  angle)

: Set angle for cord heigh ratio method

Parameters
[in]Angle value in radian if the value is greatest than 0 the method will enable tolerance angular

◆ tess_set_linear()

void tess_set_linear ( double  tol)

: Set tolerance for linear tolerance method

Parameters
[in]tolerance value
if the value minus or egal at zero, linear method is automatically disable Remark :
This value divide by 5.0 used to discretize the surfaces and boundaries into a set of points
it is the first step of the tesselate library the second step is to compute from the could of points a set of triangle with this value for cordal error
see ( tess_set_ErCorde() )

◆ tess_set_MaxSize()

void tess_set_MaxSize ( double  tol)

: sets maximum size of triangles

Parameters
[in]tol : maximun size of a triangle in the current unit
Returns
void

Remark: by default this value is infinity

◆ tess_set_optimize_mesh()

void tess_set_optimize_mesh ( int  ival)

: Activate or not the optimization of the vertex map

Parameters
[in]ival : value 0 = no optimization 1 = optimization
Returns
void

Sample:

Warning
: if you use the method detk_mesh::compute_round_normals () you must disable the optimization
tess_set_optimize_mesh(0);
By default the optimization is enable IF this option is enable each vertex from a face with same coordinates will be appear one time in vertex array of mesh
for example if you tesselate a simply cube ( 6 faces ) you obtain
without optimization a vertex array size = 36
with optimization a vertex array size = 24

◆ tess_set_Ratio()

void tess_set_Ratio ( double  tol)

: define a ratio

Parameters
[in]tol : ratio value
Returns
void

Remark:

Parameters
[in]Ratio (is the maximun value between the biggest and smallest side of a triangle) sample with ratio= 1.0
sample with ratio= 1000.0 // no contrain

◆ tess_set_Wireframe_Discretisation()

void tess_set_Wireframe_Discretisation ( double  tol)

: Set tolerance for linear tolerance method for Wireframe entities

Parameters
[in]tolerance value
if the value minus or egal at zero, tolerance value is 0.001 ( default value ) Remark :
This value is used to dicretize curves of wireframe entity from a Dtk_Body

◆ tess_ShellToMesh()

Dtk_ErrorStatus tess_ShellToMesh ( const Dtk_ShellPtr inShell,
Dtk_MeshPtr outMesh,
Dtk_Int32 outIsSolid 
)

: Make Tesselation from a Dtk_shell and create a Dtk_MeshPtr if available

Parameters
[in]inShell : Shell to be tesselate
[out]outMesh : result of tesselate
[out]outIsSolid : status of mesh ( 1 is solid 0 is open )
Returns
int DtkNoError : if OK Sample :
. Dtk_MeshPtr mesh;\n
. int iok = tess_ShellToMesh(inShell,mesh,&isSolid);\n
. // Access mesh methods using same operator (mesh->)\n
. // Important: There is no need to release it (done automatically). Anyway, you can force its release with mesh=NULL;\n

◆ tess_TesselateFeature_to_dtk_mesh()

Dtk_ErrorStatus tess_TesselateFeature_to_dtk_mesh ( Dtk_FeaturePtr feat,
Dtk_MeshPtr outMesh 
)

: Tesselate a Feature entity

Parameters
[in]feat = Feature to be tesselate
[out]outMesh = result of tesselation Only Features Pipe from CATIA V4 implemented

◆ tess_TesselateMemo()

int tess_TesselateMemo ( Dtk_MeshPtr outMesh,
int *  outIsSolid 
)

◆ TesselationIsStarted()

Dtk_ErrorStatus TesselationIsStarted ( )

: Check if tesselation is initialized

Returns
DtkNoError tesselation is ready dtkTessellationNotStarted if tesselation not started call tess_InitTesselation to initialize on

◆ write_mesh_solid()

int write_mesh_solid ( const Dtk_MeshPtr tm)

Write a Dtk_mesh into the STL file.

Parameters
[in]tm : Dtk_meshPtr to be written
Returns
int 0

Sample:

tess_ShellToMesh
Dtk_ErrorStatus tess_ShellToMesh(const Dtk_ShellPtr &inShell, Dtk_MeshPtr &outMesh, Dtk_Int32 *outIsSolid)
: Make Tesselation from a Dtk_shell and create a Dtk_MeshPtr if available
Dtk_Size_t
size_t Dtk_Size_t
Definition: define.h:712
Dtk_SmartPtr
Definition: util_ptr_dtk.hpp:37
Dtk_tab
This is a high level array class.
Definition: util_stl_dtk.hpp:85