Hide menu
Loading...
Searching...
No Matches
cadex::ModelAlgo_BRepMesherParameters Class Reference

Defines parameters used by the B-Rep mesher. More...

Public Types

enum  Granularity { Coarse , Medium , Fine , Custom }
 Defines target accuracy of the mesh to be generated. More...
 
enum  TriangulatorVersion { V1 = 1 , V2 = 2 , V3 = 3 }
 Defines the version of the triangulator used by visualization mesher. More...
 

Public Member Functions

 ModelAlgo_BRepMesherParameters (Granularity theGranularity=Fine, bool theMergeFaceSets=true)
 Constructor.
 
 ModelAlgo_BRepMesherParameters (const ModelAlgo_BRepMesherParameters &theOther)
 Constructor.
 
void SetGranularity (Granularity theVal)
 Sets mesh granularity policy.
 
Granularity GetGranularity () const
 Returns a granularity value.
 
void SetChordalDeflection (double theValue)
 Sets chordal deflection.
 
double ChordalDeflection () const
 Returns chordal deflection.
 
void SetIsRelativeChordalDeflection (bool theValue)
 Sets if ChordalDeflection() contains an absolute or relative value.
 
bool IsRelativeChordalDeflection () const
 Returns whether ChordalDeflection() contains an absolute or relative value.
 
void SetMaxEdgeLength (double theValue)
 Sets maximum length of triangle's edges.
 
double MaxEdgeLength () const
 Returns maximum length of triangle's edges.
 
void SetIsRelativeMaxEdgeLength (bool theValue)
 Sets if MaxEdgeLength() contains an absolute or relative value.
 
bool IsRelativeMaxEdgeLength () const
 Returns whether MaxEdgeLength() contains an absolute or relative value.
 
void SetAngularDeflection (double theValue)
 Sets angular deflection.
 
double AngularDeflection () const
 Returns angular deflection.
 
void SetTriangulatorVersion (TriangulatorVersion theValue)
 Sets an internal version of the triangulator.
 
TriangulatorVersion GetTriangulatorVersion () const
 Returns an internal version of the triangulator.
 
bool MergeFaceSets () const
 Returns true if the triangle sets from B-Rep faces should be merged.
 
bool & MergeFaceSets ()
 Returns true if the triangle sets from B-Rep faces should be merged.
 
bool GenerateFaceMeshAssociations () const
 Returns true if associations between faces and meshes should be generated.
 
bool & GenerateFaceMeshAssociations ()
 Returns true if associations between faces and meshes should be generated.
 
bool GetUVCoordinates () const
 Returns true if the UV coordinates on B-Rep faces should be retrieved during mesh generation.
 
bool & GetUVCoordinates ()
 Returns true if the UV coordinates on B-Rep faces should be retrieved during mesh generation.
 
bool PreserveVisualizationMesh () const
 Returns true if the existing visualization mesh must be preserved before using a computational mesher.
 
bool & PreserveVisualizationMesh ()
 Returns true if the existing visualization mesh must be preserved before using a computational mesher.
 
void SetSaveBRepToPolyAssociations (bool theValue)
 Sets whether associations between ModelData_Shapes and meshes should be generated.
 
bool SaveBRepToPolyAssociations () const
 Returns true if associations between ModelData_Shapes and meshes should be generated.
 
void SetSaveAppearances (bool theValue)
 Sets whether to save appearance during meshing or not.
 
bool SaveAppearances () const
 Returns whether to save appearance during meshing or not.
 

Detailed Description

Defines parameters used by the B-Rep mesher.

Contains parameters used by the visualization mesher and optionally a reference to the computational mesher (see SetComputationalMeshAlgo() and ComputationalMeshAlgo()).

Parameters can be set to and retrieved from the mesher using ModelAlgo_BRepMesher::Parameters().

Examples
exploring/polyrepresentation/Program.cs, meshing/lods/Program.cs, meshing/lods/main.cxx, meshing/mefisto/Program.cs, meshing/mefisto/main.cxx, meshing/netgen/Program.cs, meshing/netgen/main.cxx, meshing/remeshing/Program.cs, meshing/remeshing/main.cxx, meshing/visualizationmesher/Program.cs, meshing/visualizationmesher/main.cxx, wall_thickness/visualization/Program.cs, and wall_thickness/visualization/main.cxx.

Member Enumeration Documentation

◆ Granularity

Defines target accuracy of the mesh to be generated.

Defines pre-defined values for chordal and angular deflections:

  Fine Medium Coarse
chordal deflection 0.004 (0.4%) 0.01 (1%) 0.05 (5%)
angular deflection 20 degrees 45 degrees 60 degrees

The pre-defined values are applied when invoking ModelAlgo_BRepMesherParameters::SetGranularity().

Chordal and angular deflections can also be set to explicitly specified values using ModelAlgo_BRepMesherParameters::SetChordalDeflection() and ModelAlgo_BRepMesherParameters::SetAngularDeflection() methods.

Examples
exploring/polyrepresentation/Program.cs, meshing/lods/Program.cs, meshing/remeshing/Program.cs, and wall_thickness/visualization/Program.cs.

◆ TriangulatorVersion

Defines the version of the triangulator used by visualization mesher.

Version V3 (default) is generally faster and produces fewer triangles, V2 sometimes produces more accurate mesh but runs slower. V3 is basically an improved version of V1, which is only kept for compatibility.

Constructor & Destructor Documentation

◆ ModelAlgo_BRepMesherParameters() [1/2]

cadex::ModelAlgo_BRepMesherParameters::ModelAlgo_BRepMesherParameters ( Granularity  theGranularity = Fine,
bool  theMergeFaceSets = true 
)

Constructor.

Sets default parameter values according to theGranularity.

See also
SetGranularity().

◆ ModelAlgo_BRepMesherParameters() [2/2]

cadex::ModelAlgo_BRepMesherParameters::ModelAlgo_BRepMesherParameters ( const ModelAlgo_BRepMesherParameters theOther)

Constructor.

Copies values from theOther (does not share internal implementation object).

Member Function Documentation

◆ AngularDeflection()

double cadex::ModelAlgo_BRepMesherParameters::AngularDeflection ( ) const

Returns angular deflection.

See also
SetAngularDeflection().

◆ ChordalDeflection()

double cadex::ModelAlgo_BRepMesherParameters::ChordalDeflection ( ) const

Returns chordal deflection.

Returns a relative or absolute value of the chordal deflection depending on the value returned by IsRelativeChordalDeflection().

Default value is 0.004 (0.4%) for IsRelativeChordalDeflection() true.

See also
SetChordalDeflection().

◆ GenerateFaceMeshAssociations() [1/2]

bool & cadex::ModelAlgo_BRepMesherParameters::GenerateFaceMeshAssociations ( )

Returns true if associations between faces and meshes should be generated.

By default returns false. If the value is set to true, then it will be possible to acquire a triangulation of a given Face from generated PolyRepresentation by calling to ModelData_PolyRepresentation::Triangulation() method.

◆ GenerateFaceMeshAssociations() [2/2]

bool cadex::ModelAlgo_BRepMesherParameters::GenerateFaceMeshAssociations ( ) const

Returns true if associations between faces and meshes should be generated.

By default returns false. If the value is set to true, then it will be possible to acquire a triangulation of a given Face from generated PolyRepresentation by calling to ModelData_PolyRepresentation::Triangulation() method.

◆ GetGranularity()

ModelAlgo_BRepMesherParameters::Granularity cadex::ModelAlgo_BRepMesherParameters::GetGranularity ( ) const

Returns a granularity value.

See also
SetGranularity().

◆ GetTriangulatorVersion()

ModelAlgo_BRepMesherParameters::TriangulatorVersion cadex::ModelAlgo_BRepMesherParameters::GetTriangulatorVersion ( ) const

Returns an internal version of the triangulator.

See also
TriangulatorVersion, SetTriangulatorVersion().

◆ GetUVCoordinates() [1/2]

bool & cadex::ModelAlgo_BRepMesherParameters::GetUVCoordinates ( )

Returns true if the UV coordinates on B-Rep faces should be retrieved during mesh generation.

This option is only taken into account if MergeFaceSets() is false. It is only used for visualization mesher and ignored for computational meshers.

If the value is set to true then UV coordinates of mesh nodes in parametric space domain of each B-Rep surface will be stored after mesh generation and can be accessed via ModelData_IndexedTriangleSet::UVCoordinate().

The default value is false.

For more details on retrieving UV coordinates refer to UV coordinates retrieval.

◆ GetUVCoordinates() [2/2]

bool cadex::ModelAlgo_BRepMesherParameters::GetUVCoordinates ( ) const

Returns true if the UV coordinates on B-Rep faces should be retrieved during mesh generation.

This option is only taken into account if MergeFaceSets() is false. It is only used for visualization mesher and ignored for computational meshers.

If the value is set to true then UV coordinates of mesh nodes in parametric space domain of each B-Rep surface will be stored after mesh generation and can be accessed via ModelData_IndexedTriangleSet::UVCoordinate().

The default value is false.

For more details on retrieving UV coordinates refer to UV coordinates retrieval.

◆ IsRelativeChordalDeflection()

bool cadex::ModelAlgo_BRepMesherParameters::IsRelativeChordalDeflection ( ) const

Returns whether ChordalDeflection() contains an absolute or relative value.

By default is true.

See also
SetIsRelativeChordalDeflection().

◆ IsRelativeMaxEdgeLength()

bool cadex::ModelAlgo_BRepMesherParameters::IsRelativeMaxEdgeLength ( ) const

Returns whether MaxEdgeLength() contains an absolute or relative value.

By default is false.

See also
SetIsRelativeMaxEdgeLength().

◆ MaxEdgeLength()

double cadex::ModelAlgo_BRepMesherParameters::MaxEdgeLength ( ) const

Returns maximum length of triangle's edges.

Returns a relative or absolute value of the maximum length of triangle's edges depending on the value returned by IsRelativeMaxEdgeLength().

See also
SetMaxEdgeLength().

◆ MergeFaceSets() [1/2]

bool & cadex::ModelAlgo_BRepMesherParameters::MergeFaceSets ( )

Returns true if the triangle sets from B-Rep faces should be merged.

The value is specified in the constructor and by default is true.

If the value is set to true then triangulations generated for B-Rep faces (ModelData_Face) in solid and sheet bodies will be merged, thereby providing water-tight topologically connected mesh (e.g. mesh nodes along face boundaries will be shared by triangles).

If the value is set to false then triangulations will be geometrically coincident but topologically disconnected, i.e. mesh nodes along face boundaries will be equal but will be duplicated in array of vertices.

Setting this value to false improves performance but slightly increases memory footprint (due to node duplication) and loses topological connectivity information.

◆ MergeFaceSets() [2/2]

bool cadex::ModelAlgo_BRepMesherParameters::MergeFaceSets ( ) const

Returns true if the triangle sets from B-Rep faces should be merged.

The value is specified in the constructor and by default is true.

If the value is set to true then triangulations generated for B-Rep faces (ModelData_Face) in solid and sheet bodies will be merged, thereby providing water-tight topologically connected mesh (e.g. mesh nodes along face boundaries will be shared by triangles).

If the value is set to false then triangulations will be geometrically coincident but topologically disconnected, i.e. mesh nodes along face boundaries will be equal but will be duplicated in array of vertices.

Setting this value to false improves performance but slightly increases memory footprint (due to node duplication) and loses topological connectivity information.

◆ PreserveVisualizationMesh() [1/2]

bool & cadex::ModelAlgo_BRepMesherParameters::PreserveVisualizationMesh ( )

Returns true if the existing visualization mesh must be preserved before using a computational mesher.

By default returns true. If the value is set to false, then the visualization mesh will always be regenerated before generating a computational mesh. The value is ignored when computing a visualization mesh.

See also
ComputationalMeshAlgo().

◆ PreserveVisualizationMesh() [2/2]

bool cadex::ModelAlgo_BRepMesherParameters::PreserveVisualizationMesh ( ) const

Returns true if the existing visualization mesh must be preserved before using a computational mesher.

By default returns true. If the value is set to false, then the visualization mesh will always be regenearted before generating a computational mesh. The value is ignored when computing a visualization mesh.

See also
ComputationalMeshAlgo().

◆ SaveAppearances()

bool cadex::ModelAlgo_BRepMesherParameters::SaveAppearances ( ) const

Returns whether to save appearance during meshing or not.

Default value is true.

See also
SetSaveAppearances().

◆ SaveBRepToPolyAssociations()

bool cadex::ModelAlgo_BRepMesherParameters::SaveBRepToPolyAssociations ( ) const

Returns true if associations between ModelData_Shapes and meshes should be generated.

Default value is false.

See also
SetSaveBRepToPolyAssociations().

◆ SetAngularDeflection()

void cadex::ModelAlgo_BRepMesherParameters::SetAngularDeflection ( double  theValue)

Sets angular deflection.

Specifies a maximum deviation (in radians) between tangents at two adjacent mesh nodes when tessellating an edge curve or between normals when tessellating a face surface.

Default value in radians is equal to 20 degrees.

Sets granularity to Custom.

Examples
meshing/visualizationmesher/Program.cs, and meshing/visualizationmesher/main.cxx.

◆ SetChordalDeflection()

void cadex::ModelAlgo_BRepMesherParameters::SetChordalDeflection ( double  theValue)

Sets chordal deflection.

Specifies either a value relative to the body bounding box (if IsRelativeChordalDeflection() is true) or an absolute value of the maximum deflection of the visualization mesh.

Chordal deflection is basically a deviation of the triangles from the original surfaces or curves. Default value is 0.004 (0.4%) for IsRelativeChordalDeflection() true.

Note that in some cases the algorithm can produce more coarse triangulation.

Sets granularity to Custom.

See also
ChordalDeflection().
Examples
meshing/visualizationmesher/Program.cs, and meshing/visualizationmesher/main.cxx.

◆ SetGranularity()

void cadex::ModelAlgo_BRepMesherParameters::SetGranularity ( Granularity  theVal)

Sets mesh granularity policy.

If theVal is Custom then does nothing.

Otherwise sets chordal and angular deflections according to the specified granularity value. Refer to the table in the description of the Granularity type. IsRelativeChordalDeflection() is set to true.

See also
GetGranularity().
Examples
exploring/polyrepresentation/Program.cs.

◆ SetIsRelativeChordalDeflection()

void cadex::ModelAlgo_BRepMesherParameters::SetIsRelativeChordalDeflection ( bool  theValue)

Sets if ChordalDeflection() contains an absolute or relative value.

Specifies whether ChordalDeflection() contains an absolute (if false) or a relative to the shape bounding box (if true, by default) value of the deflection.

Sets granularity to Custom.

See also
IsRelativeChordalDeflection()

◆ SetIsRelativeMaxEdgeLength()

void cadex::ModelAlgo_BRepMesherParameters::SetIsRelativeMaxEdgeLength ( bool  theValue)

Sets if MaxEdgeLength() contains an absolute or relative value.

Specifies whether MaxEdgeLength() contains an absolute (if false, by default) or a relative to the shape bounding box (if true) value of the maximum length of triangle's edges.

Sets granularity to Custom.

See also
IsRelativeMaxEdgeLength()

◆ SetMaxEdgeLength()

void cadex::ModelAlgo_BRepMesherParameters::SetMaxEdgeLength ( double  theValue)

Sets maximum length of triangle's edges.

Specifies either a value relative to the body bounding box (if IsRelativeMaxEdgeLength() is true) or an absolute value of the maximum length of triangle's edges of the visualization mesh.

This parameter sets an upper bound for edges length of triangles generated by visualization mesher.

Sets granularity to Custom.

See also
MaxEdgeLength().
Examples
wall_thickness/visualization/main.cxx.

◆ SetSaveAppearances()

void cadex::ModelAlgo_BRepMesherParameters::SetSaveAppearances ( bool  theValue)

Sets whether to save appearance during meshing or not.

If true, resulting mesh will share an appearance with originating shape. Otherwise, resulting mesh will have no appearance. Default value is true.

See also
ModelData_BRepToPolyAssociations.

◆ SetSaveBRepToPolyAssociations()

void cadex::ModelAlgo_BRepMesherParameters::SetSaveBRepToPolyAssociations ( bool  theValue)

Sets whether associations between ModelData_Shapes and meshes should be generated.

Default value is false. If the value is set to true, then it will be possible to acquire a produced mesh information for a given Shape from ModelData_BRepToPolyAssociations class.

See also
ModelData_BRepToPolyAssociations.
Examples
meshing/visualizationmesher/Program.cs, meshing/visualizationmesher/main.cxx, and wall_thickness/visualization/main.cxx.

◆ SetTriangulatorVersion()

void cadex::ModelAlgo_BRepMesherParameters::SetTriangulatorVersion ( TriangulatorVersion  theValue)

Sets an internal version of the triangulator.

See also
TriangulatorVersion, GetTriangulatorVersion().