DATAKIT SDK  V2026.1
tess.h
Go to the documentation of this file.
1 #ifndef _TESS_H
2 #define _TESS_H
3 
5 #include "util/util_mesh_dtk.hpp"
6 #include "util/error_dtk.hpp"
8 #include "def/define.h"
9 #include "util/dtk_maindoc.hpp"
10 #include "util/util_stl_dtk.hpp"
11 
16 
21 int tess_InitTesselation(Dtk_string inWorkingDirectory,double inTolerance);
22 
25 
31 
34 
42  Dtk_tab<Dtk_MeshPtr>& outMeshes,
44  Dtk_bool inTessWireframe = DTK_FALSE,
45  Dtk_bool inApplyRenderInfos = DTK_FALSE );
46 
52 
58 
62 //DTK_TOREMOVE_START
63 #ifdef AF51BDA7E49648f8AB95949F4CA52EF8
65 #else
66 //DTK_TOREMOVE_END
68 //DTK_TOREMOVE_START
69 #endif
70 //DTK_TOREMOVE_END
71 
108  const Dtk_mesh_face* inFace,
110 
112 
117 
125 void tess_set_linear(double tol);
132 
136 void tess_set_angular(double angle);
143 
149 void tess_set_Ratio(double tol);
151 double tess_get_Ratio();
152 
155 void tess_set_MaxSize(double tol);
158 
163 
170 void tess_set_optimize_mesh(int ival);
173 
178 
183 
188 
193 
194 //DTK_TOREMOVE_START
195 #ifdef AF51BDA7E49648f8AB95949F4CA52EF8
196 void tess_set_ErCorde(double tol);
197 void tess_set_Discretisation(double tol);
198 #endif
199 //DTK_TOREMOVE_END
200 
206 
211 
213 void Dtk_SetMailleFacesVerif(int bval);
216 
218 
220 {
221 private :
222  Dtk_tab<Dtk_PolylinePtr> outerpln;
224  Dtk_ErrorStatus status;
225 
226 public :
229  Dtk_ErrorStatus Create( Dtk_FacePtr &inFace,const double inTolBound);
230  void Delete();
232  Dtk_Size_t Get_Nbinner() { return(innerpln.size()) ;};
234  Dtk_ErrorStatus CheckStatus() { return (status); };
235 };
236 
238 {
241 };
242 
243 
244 
246 // Deprecated
247 
250 
251 void get_tesselation_activateSplitMode(int &outmode, double &outratio);
252 void set_tesselation_activateSplitMode(const int inmode, const double inratio);
258 int end_stl_fic(int *ient);
259 
260 SetAsDeprecated("2026.1", "Use tess_InitTesselation() instead.")
262 extern int tess_InitLocalTess();
263 
264 
267 extern Dtk_ErrorStatus tess_AddFace(Dtk_FacePtr &inFace);
268 
269 
270 SetAsDeprecated("2026.1", "Use tess_FaceToMesh or tess_FacesArrayToMesh instead.")
272 extern Dtk_ErrorStatus tess_AddFace(Dtk_OrientedFaceStr &inFace);
273 
274 SetAsDeprecated("2026.1", "Use tess_FacesArrayToMesh instead.")
276 extern int tess_TesselateMemo(Dtk_MeshPtr &outMesh, int *outIsSolid);
277 
278 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.")
280 void set_TesselateSurfaceMethod(int ival);
281 
282 SetAsDeprecated("2026.1", "Manual activation not supported anymore.")
284 int get_TesselateSurfaceMethod();
285 
289 
290 #endif
tess_ShellToMesh
Dtk_ErrorStatus tess_ShellToMesh(const Dtk_ShellPtr &inShell, Dtk_MeshPtr &outMesh, Dtk_Int32 *outIsSolid)
Tesselate a shell.
Dtk_mesh_face
This is a high level face class.
Definition: util_mesh_dtk.hpp:865
init_stl_write
int init_stl_write(Dtk_string sfic)
tess_set_MaxSize
void tess_set_MaxSize(double tol)
Set the maximum size of a triangle edge. Default value: inf (mm)
Dtk_OrientedFaceStr::_orientation
Dtk_bool _orientation
Definition: tess.h:240
FaceBoundariesToPolylines::FaceBoundariesToPolylines
FaceBoundariesToPolylines()
tess_disableTolAngular
void tess_disableTolAngular(Dtk_bool bval)
Set activation of angular tolerance.
set_activationSplitModeFromConfig
void set_activationSplitModeFromConfig()
tess_InitTesselation
int tess_InitTesselation(Dtk_string inWorkingDirectory, double inTolerance)
Init the tesselation library.
DTK_TRUE
#define DTK_TRUE
Definition: define.h:730
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 ...
tess_FaceToMesh
Dtk_ErrorStatus tess_FaceToMesh(Dtk_FacePtr &inFace, Dtk_MeshPtr &outMesh)
Tesselate a single face.
Dtk_string
This is a high level string class.
Definition: dtk_string.hpp:53
SetAsDeprecated
SetAsDeprecated("2026.1", "Use tess_InitTesselation() instead.") extern int tess_InitLocalTess()
tess_get_Ratio
double tess_get_Ratio()
Get the current maximum ratio between longest and shortest edge of each triangle. See tess_set_Ratio(...
Dtk_Size_t
size_t Dtk_Size_t
Definition: define.h:715
tess_ComputeNormalesFromSurface
void tess_ComputeNormalesFromSurface(int value)
Set normales computation from surface option. Enabled by default. If enabled, the normals of each ver...
DTK_FALSE
#define DTK_FALSE
Definition: define.h:731
Dtk_bool
char Dtk_bool
Definition: define.h:728
tess_ComputeBoundariesFromMesh
void tess_ComputeBoundariesFromMesh(int value)
Set boundaries computation from mesh option. Default value is enabled (1). See tess_getBoundariesFrom...
outIsSolid
int * outIsSolid
Definition: tess.h:276
get_tesselation_activateSplitMode
void get_tesselation_activateSplitMode(int &outmode, double &outratio)
Dtk_OrientedFaceStr::_face
Dtk_FacePtr _face
Definition: tess.h:239
FaceBoundariesToPolylines::Get_outer
Dtk_ErrorStatus Get_outer(Dtk_tab< Dtk_PolylinePtr > &outpln)
CheckUseEdgeTolerance
void CheckUseEdgeTolerance(Dtk_bool inBval)
Set usage of edge tolerance to guide the tesselation. Default value is disabled (0).
util_mesh_dtk.hpp
TesselationIsStarted
Dtk_ErrorStatus TesselationIsStarted()
Return current status of tesselation started.
get_tesselationSuppressDuplicateFace
Dtk_bool get_tesselationSuppressDuplicateFace()
Get face duplication option. Returns 1 if enabled, 0 if disabled.
util_topology_ptr_dtk.hpp
CheckAutoSurfaceIsSpring
void CheckAutoSurfaceIsSpring(Dtk_bool inBval)
Set automatic surface spring check option. If enabled, all periodic surface will be tesselated more a...
outBoundaries
const Dtk_mesh_face Dtk_tab< Dtk_tab< Dtk_MeshPolylinePtr > > & outBoundaries
Definition: tess.h:288
tess_AddNaturalBoundariesForUnBounded
void tess_AddNaturalBoundariesForUnBounded(int value)
Set boundaries computation option. Default value is enabled (1). See tess_getBoundariesFromMeshFace()...
tess_set_linear
void tess_set_linear(double tol)
Set linear tolerance (mm). Maximum chordal error accepted between the CAD surface and the tesselated ...
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)
Tesselate a body. Generates one mesh per shell in the body.
Dtk_Int32
int32_t Dtk_Int32
Definition: define.h:690
FaceBoundariesToPolylines::~FaceBoundariesToPolylines
~FaceBoundariesToPolylines()
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().
error_dtk.hpp
Dtk_ErrorStatus
Dtk_ErrorStatus
Definition: error_dtk.hpp:6
tess_get_angular
double tess_get_angular()
Get the current angular tolerance. See tess_set_angular().
Dtk_GetMailleFacesVerif
int Dtk_GetMailleFacesVerif()
Get status of additional verification of face/boundaries before tesselation. Returns 1 if enabled,...
tess_FacesArrayToMesh
Dtk_ErrorStatus tess_FacesArrayToMesh(Dtk_tab< Dtk_FacePtr > &inTabFace, Dtk_MeshPtr &outMesh, Dtk_Int32 *outIsSolid)
Tesselate an array of Faces.
Dtk_SmartPtr
Definition: util_ptr_dtk.hpp:37
dtk_maindoc.hpp
reinit_SplitMode
void reinit_SplitMode()
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 tri...
end_stl_fic
int end_stl_fic(int *ient)
tess_get_Wireframe_Discretisation
double tess_get_Wireframe_Discretisation()
Get the current linear tolerance for Wireframe tessellation. See tess_set_Wireframe_Discretisation().
util_stl_dtk.hpp
FaceBoundariesToPolylines::Get_inner
Dtk_ErrorStatus Get_inner(Dtk_tab< Dtk_PolylinePtr > &outpln, Dtk_Size_t number)
tess_TesselateFeature_to_dtk_mesh
Dtk_ErrorStatus tess_TesselateFeature_to_dtk_mesh(Dtk_FeaturePtr &feat, Dtk_MeshPtr &outMesh)
tess_getBoundariesFromMeshFace
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,...
FaceBoundariesToPolylines::Delete
void Delete()
define.h
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)....
Dtk_tab
This is a high level array class.
Definition: util_stl_dtk.hpp:84
Dtk_tab::size
Dtk_Size_t size() const
Returns the size of the array.
Definition: util_stl_dtk.hpp:503
inFace
const Dtk_mesh_face * inFace
Definition: tess.h:288
write_mesh_solid
int write_mesh_solid(const Dtk_MeshPtr &tm)
tess_set_angular
void tess_set_angular(double angle)
Set angular tolerance (radian). Default value: 10°. Maximum angle between a triangle and the CAD surf...
set_tesselationSuppressDuplicateFace
void set_tesselationSuppressDuplicateFace(Dtk_bool inBval)
Set face duplication option. Default value is enabled (1).
util_geom_ptr_dtk.hpp
tess_disableTolLinear
void tess_disableTolLinear(Dtk_bool bval)
Set activation of linear tolerance.
Dtk_OrientedFaceStr
Definition: tess.h:238
Dtk_SetMailleFacesVerif
void Dtk_SetMailleFacesVerif(int bval)
Set additional verification of face/boundaries before tesselation. Default false (0).
tess_EndTesselation
void tess_EndTesselation()
Free the data used by tesselation library.
tess_get_linear
double tess_get_linear()
Get the current linear tolerance. See tess_set_linear().
FaceBoundariesToPolylines::Create
Dtk_ErrorStatus Create(Dtk_FacePtr &inFace, const double inTolBound)
set_tesselation_activateSplitMode
void set_tesselation_activateSplitMode(const int inmode, const double inratio)
FaceBoundariesToPolylines::CheckStatus
Dtk_ErrorStatus CheckStatus()
Definition: tess.h:234
FaceBoundariesToPolylines
Definition: tess.h:220
FaceBoundariesToPolylines::Get_Nbinner
Dtk_Size_t Get_Nbinner()
Definition: tess.h:232