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... | |
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
void CheckAutoSurfaceIsSpring | ( | Dtk_bool | inBval | ) |
: Enable or disable automatically check of surface is periodic
[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 )
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 )
void CheckUseEdgeTolerance | ( | Dtk_bool | inBval | ) |
: Enable or disable if we use the tolerance of edge/face read from the part
[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
int Dtk_GetMailleFacesVerif | ( | ) |
: return status of control of face/boundaries
[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 |
void Dtk_SetMailleFacesVerif | ( | int | bval | ) |
: enable or disable control of faces
[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 |
int end_stl_fic | ( | int * | ient | ) |
Close the STL File.
[out] | ient : number of facettes written |
Sample:
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
void get_tesselation_activateSplitMode | ( | int & | outmode, |
double & | outratio | ||
) |
: read value of splitting of surface
[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 )
Dtk_bool get_tesselationSuppressDuplicateFace | ( | ) |
: return current status of suppress duplicate face option default value is enable to deactivate this option use set_tesselationSuppressDuplicateFace(0)
int init_stl_write | ( | Dtk_string | sfic | ) |
: Open and initialize the STL File
[in] | sfic : Name of File to be write |
Sample:
void reinit_SplitMode | ( | ) |
: disable splitting of surface
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 )
void set_TesselateSurfaceMethod | ( | int | ival | ) |
: select computation method for surface tesselation
[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 |
void set_tesselation_activateSplitMode | ( | const int | inmode, |
const double | inratio | ||
) |
: memorize option for splitting of surfaces before tessellation
[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 )
void set_tesselationSuppressDuplicateFace | ( | Dtk_bool | inBval | ) |
: Enable or disable the suppression of duplicate face before tessellation
[in] | value of option 1=enable 0=disable Default value : Enable (1) |
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,
int tess_AddNaturalBoundariesForUnBounded | ( | ) |
: return status of option add natural external boundary for an unbounded surface
[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 |
void tess_AddNaturalBoundariesForUnBounded | ( | int | value | ) |
: enable or disable option add natural external boundary for an unbounded surface
[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 |
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
[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 ) |
Remark: the result contain one Dtk_mesh per shell
int tess_ComputeBoundariesFromMesh | ( | ) |
: Check value of option memorize noundaries of mesh
void tess_ComputeBoundariesFromMesh | ( | int | value | ) |
: enable or disable compute boundaries from mesh
[in] | value of option 1= enable 0 disable if this option is enable the memory occupation of Dtk_mesh is smaller |
int tess_ComputeNormalesFromSurface | ( | ) |
: Check value of option compute normales of vertex from real surface
void tess_ComputeNormalesFromSurface | ( | int | value | ) |
: enable or disable compute normales from surfaces
[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 |
Dtk_bool tess_disableTolAngular | ( | ) |
: return state of Angular tolerance method
void tess_disableTolAngular | ( | Dtk_bool | bval | ) |
: activate or not the Angular tolerance method
[in] | DTK_TRUE to disable Angular tolerance method ( default value ) DTK_FALSE to enable linear tolerance method see tess_set_angular() for angle explanation |
Dtk_bool tess_disableTolLinear | ( | ) |
: return state of linear tolerance method
void tess_disableTolLinear | ( | Dtk_bool | bval | ) |
: activate or not the linear tolerance method
[in] | DTK_TRUE to disable linear tolerance method DTK_FALSE to enable linear tolerance method ( default value ) |
void tess_EndTesselation | ( | ) |
Free the data used by tesselation library.
Sample:
Dtk_ErrorStatus tess_FacesArrayToMesh | ( | Dtk_tab< Dtk_FacePtr > & | inTabFace, |
Dtk_MeshPtr & | outMesh, | ||
Dtk_Int32 * | outIsSolid | ||
) |
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
[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));
Dtk_ErrorStatus tess_FaceToMesh | ( | Dtk_FacePtr & | inTabFace, |
Dtk_MeshPtr & | outMesh | ||
) |
: Tesselate a Face from a Dtk_body
[in] | inTabFace = face to be tesselate | |
[out] | outMesh = result of tesselation The Dtk_body of the Dtk_face must be alive |
Dtk_ErrorStatus tess_FaceToMesh | ( | Dtk_OrientedFaceStr & | inTabFace, |
Dtk_MeshPtr & | outMesh | ||
) |
: Tesselate a Face from a Dtk_body
[in] | inTabFace = face with her orientation to be tessellate | |
[out] | outMesh = result of tesselation The Dtk_body of the Dtk_face must be alive |
double tess_get_angular | ( | ) |
: return the current Angle used for cord heigh ratio
double tess_get_linear | ( | ) |
: return current linear tolerance
double tess_get_MaxSize | ( | ) |
: gets maximum size of triangles
Sample:
int tess_get_optimize_mesh | ( | ) |
: return status of the optimization of the vertex map in the detk_mesh class
Sample:
double tess_get_Ratio | ( | ) |
: return the current ratio
Remark: See function tess_set_Ratio() above for information
double tess_get_Wireframe_Discretisation | ( | ) |
: return current linear tolerance for Wrireframe entities
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
[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
. Dtk_tab<Dtk_tab<Dtk_PolylinePtr>> bound;\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
|
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()
int tess_InitTesselation | ( | ) |
Init the tesselation library.
Sample:
int tess_InitTesselation | ( | Dtk_string | inWorkingDirectory, |
double | inTolerance | ||
) |
Init the tesselation library.
[in] | inWorkingDirectory : Directory for temporary file used for tesselation | |
[in] | inTolerance : Tolerance :chordal error on triangles |
Sample:
void tess_set_angular | ( | double | angle | ) |
: Set angle for cord heigh ratio method
[in] | Angle value in radian if the value is greatest than 0 the method will enable tolerance angular ![]() |
void tess_set_linear | ( | double | tol | ) |
: Set tolerance for linear tolerance method
[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() ) ![]() |
void tess_set_MaxSize | ( | double | tol | ) |
: sets maximum size of triangles
[in] | tol : maximun size of a triangle in the current unit |
Remark: by default this value is infinity
void tess_set_optimize_mesh | ( | int | ival | ) |
: Activate or not the optimization of the vertex map
[in] | ival : value 0 = no optimization 1 = optimization |
Sample:
void tess_set_Ratio | ( | double | tol | ) |
: define a ratio
[in] | tol : ratio value |
Remark:
[in] | Ratio (is the maximun value between the biggest and smallest side of a triangle) sample with ratio= 1.0 ![]() ![]() |
void tess_set_Wireframe_Discretisation | ( | double | tol | ) |
: Set tolerance for linear tolerance method for Wireframe entities
[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 |
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
[in] | inShell : Shell to be tesselate | |
[out] | outMesh : result of tesselate | |
[out] | outIsSolid : status of mesh ( 1 is solid 0 is open ) |
Dtk_ErrorStatus tess_TesselateFeature_to_dtk_mesh | ( | Dtk_FeaturePtr & | feat, |
Dtk_MeshPtr & | outMesh | ||
) |
: Tesselate a Feature entity
[in] | feat = Feature to be tesselate | |
[out] | outMesh = result of tesselation Only Features Pipe from CATIA V4 implemented |
int tess_TesselateMemo | ( | Dtk_MeshPtr & | outMesh, |
int * | outIsSolid | ||
) |
Dtk_ErrorStatus TesselationIsStarted | ( | ) |
: Check if tesselation is initialized
int write_mesh_solid | ( | const Dtk_MeshPtr & | tm | ) |
Write a Dtk_mesh into the STL file.
[in] | tm : Dtk_meshPtr to be written |
Sample: