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. | |
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().
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.
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.
cadex::ModelAlgo_BRepMesherParameters::ModelAlgo_BRepMesherParameters | ( | Granularity | theGranularity = Fine , |
bool | theMergeFaceSets = true |
||
) |
cadex::ModelAlgo_BRepMesherParameters::ModelAlgo_BRepMesherParameters | ( | const ModelAlgo_BRepMesherParameters & | theOther | ) |
Constructor.
Copies values from theOther (does not share internal implementation object).
double cadex::ModelAlgo_BRepMesherParameters::AngularDeflection | ( | ) | const |
Returns angular deflection.
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.
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.
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.
ModelAlgo_BRepMesherParameters::Granularity cadex::ModelAlgo_BRepMesherParameters::GetGranularity | ( | ) | const |
Returns a granularity value.
ModelAlgo_BRepMesherParameters::TriangulatorVersion cadex::ModelAlgo_BRepMesherParameters::GetTriangulatorVersion | ( | ) | const |
Returns an internal version of the triangulator.
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.
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.
bool cadex::ModelAlgo_BRepMesherParameters::IsRelativeChordalDeflection | ( | ) | const |
Returns whether ChordalDeflection() contains an absolute or relative value.
By default is true.
bool cadex::ModelAlgo_BRepMesherParameters::IsRelativeMaxEdgeLength | ( | ) | const |
Returns whether MaxEdgeLength() contains an absolute or relative value.
By default is false.
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().
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.
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.
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.
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.
bool cadex::ModelAlgo_BRepMesherParameters::SaveAppearances | ( | ) | const |
Returns whether to save appearance during meshing or not.
Default value is true.
bool cadex::ModelAlgo_BRepMesherParameters::SaveBRepToPolyAssociations | ( | ) | const |
Returns true if associations between ModelData_Shapes and meshes should be generated.
Default value is false.
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.
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.
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.
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.
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.
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.
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.
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.
void cadex::ModelAlgo_BRepMesherParameters::SetTriangulatorVersion | ( | TriangulatorVersion | theValue | ) |
Sets an internal version of the triangulator.