Defines parameters used by the mesh generator. More...
Public Types | |
enum class | GranularityType { Coarse , Medium , Fine , Custom } |
Defines target accuracy of the mesh to be generated. More... | |
![]() | |
typedef std::shared_ptr< internal::BaseObjectImpl > | ImplType |
Public Member Functions | |
MeshGeneratorParameters () | |
Constructor. | |
MeshGeneratorParameters (GranularityType theGranularity) | |
Constructor. | |
GranularityType | Granularity () const |
Returns a granularity value. | |
void | SetGranularity (GranularityType theGranularity) |
double | ChordalDeflection () const |
Returns chordal deflection. | |
void | SetChordalDeflection (double theValue) |
Sets chordal deflection. | |
bool | IsRelativeChordalDeflection () const |
Returns whether ChordalDeflection() contains an absolute or relative value. | |
void | SetIsRelativeChordalDeflection (bool theValue) |
Sets if ChordalDeflection() contains an absolute or relative value. | |
double | AngularDeflection () const |
Returns angular deflection. | |
void | SetAngularDeflection (double theValue) |
Sets angular deflection. | |
![]() | |
size_t | Id () const |
Return unique identifier of public object. | |
internal::BaseObjectImpl * | Impl () const |
bool | IsNull () const |
operator bool () const | |
template<typename T > | |
bool | IsOfType () const |
template<typename T > | |
T * | Impl () const |
Reserved for internal use. | |
Additional Inherited Members | |
![]() | |
BaseObject (const ImplType &theImpl) | |
Defines parameters used by the mesh generator.
Parameters can be set to and retrieved from the mesh generator using MeshGenerator::SetParameters() and MeshGenerator::Parameters() methods respectively.
|
strong |
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 MeshGeneratorParameters::SetGranularity().
Chordal and angular deflections can also be set to explicitly specified values using MeshGeneratorParameters::SetChordalDeflection() and MeshGeneratorParameters::SetAngularDeflection() methods.
cadex::ModelAlgo::MeshGeneratorParameters::MeshGeneratorParameters | ( | ) |
Constructor.
Sets default parameter values according to GranularityType::Fine.
cadex::ModelAlgo::MeshGeneratorParameters::MeshGeneratorParameters | ( | GranularityType | theGranularity | ) |
double cadex::ModelAlgo::MeshGeneratorParameters::AngularDeflection | ( | ) | const |
Returns angular deflection.
double cadex::ModelAlgo::MeshGeneratorParameters::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.
MeshGeneratorParameters::GranularityType cadex::ModelAlgo::MeshGeneratorParameters::Granularity | ( | ) | const |
Returns a granularity value.
bool cadex::ModelAlgo::MeshGeneratorParameters::IsRelativeChordalDeflection | ( | ) | const |
Returns whether ChordalDeflection() contains an absolute or relative value.
By default is true.
void cadex::ModelAlgo::MeshGeneratorParameters::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::MeshGeneratorParameters::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::MeshGeneratorParameters::SetGranularity | ( | GranularityType | theGranularity | ) |
If theGranularity 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 GranularityType. IsRelativeChordalDeflection() is set to true.
void cadex::ModelAlgo::MeshGeneratorParameters::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.