Hide menu
Loading...
Searching...
No Matches
cadex::ModelAlgo::MeshGeneratorParameters Class Reference

Defines parameters used by the mesh generator. More...

Inheritance diagram for cadex::ModelAlgo::MeshGeneratorParameters:
cadex::BaseObject

Public Types

enum class  GranularityType { Coarse , Medium , Fine , Custom }
 Defines target accuracy of the mesh to be generated. More...
 
- Public Types inherited from cadex::BaseObject
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.
 
- Public Member Functions inherited from cadex::BaseObject
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

- Protected Member Functions inherited from cadex::BaseObject
 BaseObject (const ImplType &theImpl)
 

Detailed Description

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.

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

Member Enumeration Documentation

◆ GranularityType

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.

Constructor & Destructor Documentation

◆ MeshGeneratorParameters() [1/2]

cadex::ModelAlgo::MeshGeneratorParameters::MeshGeneratorParameters ( )

Constructor.

Sets default parameter values according to GranularityType::Fine.

See also
SetGranularity().

◆ MeshGeneratorParameters() [2/2]

cadex::ModelAlgo::MeshGeneratorParameters::MeshGeneratorParameters ( GranularityType theGranularity)

Constructor.

Sets default parameter values according to theGranularity.

See also
SetGranularity().

Member Function Documentation

◆ AngularDeflection()

double cadex::ModelAlgo::MeshGeneratorParameters::AngularDeflection ( ) const

Returns angular deflection.

See also
SetAngularDeflection().

◆ ChordalDeflection()

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.

See also
SetChordalDeflection().

◆ Granularity()

MeshGeneratorParameters::GranularityType cadex::ModelAlgo::MeshGeneratorParameters::Granularity ( ) const

Returns a granularity value.

See also
SetGranularity().

◆ IsRelativeChordalDeflection()

bool cadex::ModelAlgo::MeshGeneratorParameters::IsRelativeChordalDeflection ( ) const

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

By default is true.

See also
SetIsRelativeChordalDeflection().

◆ SetAngularDeflection()

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.

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

◆ SetChordalDeflection()

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.

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

◆ SetGranularity()

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.

See also
GetGranularity().

◆ SetIsRelativeChordalDeflection()

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.

See also
IsRelativeChordalDeflection()