#include <opennurbs_mesh.h>

Public Types

enum  MESH_PARAMETER_ID : unsigned int {
  MESH_PARAMETER_ID::unspecified_mesh_parameter_id = 0, MESH_PARAMETER_ID::bComputeCurvature_parameter_id = 1, MESH_PARAMETER_ID::bSimplePlanes_parameter_id = 2, MESH_PARAMETER_ID::bRefine_parameter_id = 3,
  MESH_PARAMETER_ID::bJaggedSeams_parameter_id = 4, MESH_PARAMETER_ID::bDoublePrecision_parameter_id = 5, MESH_PARAMETER_ID::mesher_parameter_id = 6, MESH_PARAMETER_ID::texture_range_parameter_id = 7,
  MESH_PARAMETER_ID::tolerance_parameter_id = 8, MESH_PARAMETER_ID::relative_tolerance_parameter_id = 9, MESH_PARAMETER_ID::min_tolerance_parameter_id = 10, MESH_PARAMETER_ID::min_edge_length_parameter_id = 11,
  MESH_PARAMETER_ID::max_edge_length_parameter_id = 12, MESH_PARAMETER_ID::grid_aspect_ratio_parameter_id = 13, MESH_PARAMETER_ID::grid_min_count_parameter_id = 14, MESH_PARAMETER_ID::grid_max_count_parameter_id = 15,
  MESH_PARAMETER_ID::grid_angle_parameter_id = 16, MESH_PARAMETER_ID::grid_amplification_parameter_id = 17, MESH_PARAMETER_ID::refine_angle_parameter_id = 18, MESH_PARAMETER_ID::face_type_parameter_id = 19,
  MESH_PARAMETER_ID::srf_domain_parameter_id = 20, MESH_PARAMETER_ID::bClosedObjectPostProcess_id = 21, MESH_PARAMETER_ID::mesher_id = 22, MESH_PARAMETER_ID::crv_tess_min_num_segments_parameter_id = 23,
  MESH_PARAMETER_ID::crv_tess_angle_tol_in_degrees_parameter_id = 24, MESH_PARAMETER_ID::crv_tess_max_dist_between_points_parameter_id = 25, MESH_PARAMETER_ID::crv_tess_min_parametric_ratio_parameter_id = 26, MESH_PARAMETER_ID::bEvaluatorBasedTessellation_parameter_id = 27,
  MESH_PARAMETER_ID::srf_tess_chord_height_parameter_id = 28, MESH_PARAMETER_ID::srf_tess_angle_tol_in_degrees_parameter_id = 29, MESH_PARAMETER_ID::srf_tess_max_edge_length_parameter_id = 30, MESH_PARAMETER_ID::srf_tess_min_edge_length_parameter_id = 31,
  MESH_PARAMETER_ID::srf_tess_min_edge_length_ratio_uv_parameter_id = 32, MESH_PARAMETER_ID::srf_tess_max_aspect_ratio_parameter_id = 33, MESH_PARAMETER_ID::smoothing_passes_parameter_id = 34, MESH_PARAMETER_ID::max_mesh_parameter_id
}
 
enum  MESH_STYLE : unsigned char {
  MESH_STYLE::unset_mesh_style = 0, MESH_STYLE::render_mesh_fast = 1, MESH_STYLE::render_mesh_quality = 2, MESH_STYLE::render_mesh_custom = 9,
  MESH_STYLE::render_mesh_per_object = 10
}
 

Public Member Functions

 ON_MeshParameters ()=default
 
 ON_MeshParameters (const ON_MeshParameters &)=default
 
 ON_MeshParameters (double density, double min_edge_length=ON_UNSET_VALUE)
 Tool for provding a simple slider interface. More...
 
 ~ON_MeshParameters ()=default
 
const bool ClosedObjectPostProcess () const
 
const bool ComputeCurvature () const
 
ON_SHA1_Hash ContentHash () const
 
const bool CustomSettings () const
 
const bool CustomSettingsEnabled () const
 
ON__UINT32 DataCRC (ON__UINT32) const
 
const bool DoublePrecision () const
 
void Dump (ON_TextLog &test_log) const
 
const unsigned int FaceType () const
 
const int GeometrySettingsDensityPercentage (int no_match_found_result) const
 
ON_SHA1_Hash GeometrySettingsHash () const
 
const ON_MeshParameters::MESH_STYLE GeometrySettingsRenderMeshStyle (const ON_MeshParameters *custom_mp, ON_MeshParameters::MESH_STYLE no_match_found_result) const
 
const double GridAmplification () const
 
const double GridAngleDegrees () const
 
const double GridAngleRadians () const
 
const double GridAspectRatio () const
 
const int GridMaxCount () const
 desired masimum number of quads in initial grid More...
 
const int GridMinCount () const
 minimum number of quads in initial grid More...
 
const bool JaggedSeams () const
 
const double MaximumEdgeLength () const
 
const unsigned int Mesher () const
 0 = slow mesher, 1 = fast mesher More...
 
ON_UUID MesherId () const
 
const double MinimumEdgeLength () const
 
const double MinimumTolerance () const
 
ON_MeshParametersoperator= (const ON_MeshParameters &)=default
 
bool Read (ON_BinaryArchive &)
 
const bool Refine () const
 
const double RefineAngleDegrees () const
 
const double RefineAngleRadians () const
 
const double RelativeTolerance () const
 
void SetClosedObjectPostProcess (bool bClosedObjectPostProcess)
 
void SetComputeCurvature (bool bComputeCurvature)
 
void SetCustomSettings (bool bCustomSettings)
 
void SetCustomSettingsEnabled (bool bCustomSettingsEnabled)
 
void SetDoublePrecision (bool bDoublePrecision)
 
void SetFaceType (unsigned int face_type)
 
void SetGridAmplification (double grid_amplification)
 
void SetGridAngleDegrees (double grid_angle_degrees)
 
void SetGridAngleRadians (double grid_angle_radians)
 
void SetGridAspectRatio (double grid_aspect_ratio)
 
void SetGridMaxCount (int grid_max_count)
 
void SetGridMinCount (int grid_min_count)
 
void SetJaggedSeams (bool bJaggedSeams)
 
void SetMaximumEdgeLength (double maximum_edge_length)
 
void SetMesher (unsigned int mesher)
 
void SetMesherId (ON_UUID)
 
void SetMinimumEdgeLength (double minimum_edge_length)
 
void SetMinimumTolerance (double minimum_tolerance)
 
void SetRefine (bool bRefine)
 
void SetRefineAngleDegrees (double refine_angle_degrees)
 
void SetRefineAngleRadians (double refine_angle_radians)
 
void SetRelativeTolerance (double relative_tolerance)
 
void SetSimplePlanes (bool bSimplePlanes)
 
void SetTextureRange (unsigned int texture_range)
 
void SetTextureRangePictureFrameHack ()
 
void SetTolerance (double tolerance)
 
const bool SimplePlanes () const
 
unsigned int SubDDisplayMeshDensity () const
 
const unsigned int TextureRange () const
 
const bool TextureRangeIsValid () const
 
const double Tolerance () const
 These controls are used in both stages. More...
 
bool Write (ON_BinaryArchive &) const
 

Static Public Member Functions

static int Compare (const ON_MeshParameters &a, const ON_MeshParameters &b)
 
static int CompareGeometrySettings (const ON_MeshParameters &a, const ON_MeshParameters &b)
 Compares all meshing parameters that control mesh geometry. Does not compare m_bCustomSettings, CustomSettingsEnabled(), m_bComputeCurvature, m_bDoublePrecision, MinimumTolerance(), m_texture_range, m_srf_domain0 and m_srf_domain1. More...
 
static ON_MeshParameters::MESH_PARAMETER_ID MeshParameterIdFromUnsigned (unsigned int mesh_parameter_id_as_unsigned)
 
static ON_MeshParameters::MESH_STYLE MeshStyleFromUnsigned (unsigned int mesh_style_as_unsigned)
 
static double MinimumEdgeLengthFromTolerance (double max_edge_length, double tolerance)
 Get a value to use for minimum edge length base on max_edge_length and tolerance settings. More...
 
static double ToleranceFromObjectSize (double relative_tolerance, double actual_size)
 Get a value to use for tolerance based on the relative_tolerance and actual size. More...
 

Static Public Attributes

static const ON_MeshParameters DefaultAnalysisMesh
 Mesh creationg parameters to create the default analysis mesh. More...
 
static const ON_MeshParameters DefaultMesh
 Mesh creationg parameters to create the default render mesh. More...
 
static const ON_MeshParameters FastRenderMesh
 Mesh creationg parameters to create the a render mesh when meshing speed is prefered over mesh quality. More...
 
static const ON_UUID PangolinMesherId
 {EB6F6F3F-F975-4546-9D1C-64E9423BEB7F} More...
 
static const ON_MeshParameters QualityRenderMesh
 Mesh creationg parameters to create the a render mesh when mesh quality is prefered over meshing speed. More...
 
static const ON_UUID RhinoLegacyMesherId
 surface meshing perameters More...
 

Member Enumeration Documentation

◆ MESH_PARAMETER_ID

enum ON_MeshParameters::MESH_PARAMETER_ID : unsigned int
strong
Enumerator
unspecified_mesh_parameter_id 
bComputeCurvature_parameter_id 
bSimplePlanes_parameter_id 
bRefine_parameter_id 
bJaggedSeams_parameter_id 
bDoublePrecision_parameter_id 
mesher_parameter_id 
texture_range_parameter_id 
tolerance_parameter_id 
relative_tolerance_parameter_id 
min_tolerance_parameter_id 
min_edge_length_parameter_id 
max_edge_length_parameter_id 
grid_aspect_ratio_parameter_id 
grid_min_count_parameter_id 
grid_max_count_parameter_id 
grid_angle_parameter_id 
grid_amplification_parameter_id 
refine_angle_parameter_id 
face_type_parameter_id 
srf_domain_parameter_id 
bClosedObjectPostProcess_id 
mesher_id 

UUID parameter identifying what mesher code created the mesh.

crv_tess_min_num_segments_parameter_id 
crv_tess_angle_tol_in_degrees_parameter_id 
crv_tess_max_dist_between_points_parameter_id 
crv_tess_min_parametric_ratio_parameter_id 
bEvaluatorBasedTessellation_parameter_id 
srf_tess_chord_height_parameter_id 
srf_tess_angle_tol_in_degrees_parameter_id 
srf_tess_max_edge_length_parameter_id 
srf_tess_min_edge_length_parameter_id 
srf_tess_min_edge_length_ratio_uv_parameter_id 
srf_tess_max_aspect_ratio_parameter_id 
smoothing_passes_parameter_id 
max_mesh_parameter_id 

◆ MESH_STYLE

enum ON_MeshParameters::MESH_STYLE : unsigned char
strong
Enumerator
unset_mesh_style 
render_mesh_fast 
render_mesh_quality 
render_mesh_custom 

3 - 8 reserved for future predefined render mesh styles

render_mesh_per_object 

Constructor & Destructor Documentation

◆ ON_MeshParameters() [1/3]

ON_MeshParameters::ON_MeshParameters ( )
default

◆ ~ON_MeshParameters()

ON_MeshParameters::~ON_MeshParameters ( )
default

◆ ON_MeshParameters() [2/3]

ON_MeshParameters::ON_MeshParameters ( const ON_MeshParameters )
default

◆ ON_MeshParameters() [3/3]

ON_MeshParameters::ON_MeshParameters ( double  density,
double  min_edge_length = ON_UNSET_VALUE 
)

Tool for provding a simple slider interface.

Parameters
density[in] 0.0 <= density <= 1.0 0 quickly creates coarse meshes. 1 slowly creates dense meshes.
min_edge_length[in] > 0.0 custom value ON_UNSET_VALUE: for default (0.0001)

Member Function Documentation

◆ ClosedObjectPostProcess()

const bool ON_MeshParameters::ClosedObjectPostProcess ( ) const

◆ Compare()

static int ON_MeshParameters::Compare ( const ON_MeshParameters a,
const ON_MeshParameters b 
)
static

◆ CompareGeometrySettings()

static int ON_MeshParameters::CompareGeometrySettings ( const ON_MeshParameters a,
const ON_MeshParameters b 
)
static

Compares all meshing parameters that control mesh geometry. Does not compare m_bCustomSettings, CustomSettingsEnabled(), m_bComputeCurvature, m_bDoublePrecision, MinimumTolerance(), m_texture_range, m_srf_domain0 and m_srf_domain1.

◆ ComputeCurvature()

const bool ON_MeshParameters::ComputeCurvature ( ) const

◆ ContentHash()

ON_SHA1_Hash ON_MeshParameters::ContentHash ( ) const

◆ CustomSettings()

const bool ON_MeshParameters::CustomSettings ( ) const

◆ CustomSettingsEnabled()

const bool ON_MeshParameters::CustomSettingsEnabled ( ) const

◆ DataCRC()

ON__UINT32 ON_MeshParameters::DataCRC ( ON__UINT32  ) const

◆ DoublePrecision()

const bool ON_MeshParameters::DoublePrecision ( ) const

◆ Dump()

void ON_MeshParameters::Dump ( ON_TextLog test_log) const

◆ FaceType()

const unsigned int ON_MeshParameters::FaceType ( ) const

◆ GeometrySettingsDensityPercentage()

const int ON_MeshParameters::GeometrySettingsDensityPercentage ( int  no_match_found_result) const
Returns
n in the range 0 to 100, inclusive, when (0 == ON_MeshParameters::CompareGeometrySettings(*this,ON_MeshParameters(n/100.0)) no_match_found_result: otherwise

◆ GeometrySettingsHash()

ON_SHA1_Hash ON_MeshParameters::GeometrySettingsHash ( ) const

◆ GeometrySettingsRenderMeshStyle()

const ON_MeshParameters::MESH_STYLE ON_MeshParameters::GeometrySettingsRenderMeshStyle ( const ON_MeshParameters custom_mp,
ON_MeshParameters::MESH_STYLE  no_match_found_result 
) const
Returns
ON_MeshParameters::render_mesh_fast ON_MeshParameters::FastRenderMesh and this have the same geometry settings ON_MeshParameters::render_mesh_quality ON_MeshParameters::QualityRenderMesh and this have the same geometry settings ON_MeshParameters::render_mesh_custom custom_mp is not null and has the same geometry settings no_match_found_result otherwise

◆ GridAmplification()

const double ON_MeshParameters::GridAmplification ( ) const

◆ GridAngleDegrees()

const double ON_MeshParameters::GridAngleDegrees ( ) const

◆ GridAngleRadians()

const double ON_MeshParameters::GridAngleRadians ( ) const

◆ GridAspectRatio()

const double ON_MeshParameters::GridAspectRatio ( ) const

◆ GridMaxCount()

const int ON_MeshParameters::GridMaxCount ( ) const

desired masimum number of quads in initial grid

◆ GridMinCount()

const int ON_MeshParameters::GridMinCount ( ) const

minimum number of quads in initial grid

◆ JaggedSeams()

const bool ON_MeshParameters::JaggedSeams ( ) const

◆ MaximumEdgeLength()

const double ON_MeshParameters::MaximumEdgeLength ( ) const

◆ Mesher()

const unsigned int ON_MeshParameters::Mesher ( ) const

0 = slow mesher, 1 = fast mesher

◆ MesherId()

ON_UUID ON_MeshParameters::MesherId ( ) const

◆ MeshParameterIdFromUnsigned()

static ON_MeshParameters::MESH_PARAMETER_ID ON_MeshParameters::MeshParameterIdFromUnsigned ( unsigned int  mesh_parameter_id_as_unsigned)
static

◆ MeshStyleFromUnsigned()

static ON_MeshParameters::MESH_STYLE ON_MeshParameters::MeshStyleFromUnsigned ( unsigned int  mesh_style_as_unsigned)
static

◆ MinimumEdgeLength()

const double ON_MeshParameters::MinimumEdgeLength ( ) const

◆ MinimumEdgeLengthFromTolerance()

static double ON_MeshParameters::MinimumEdgeLengthFromTolerance ( double  max_edge_length,
double  tolerance 
)
static

Get a value to use for minimum edge length base on max_edge_length and tolerance settings.

Parameters
max_edge_length[in] 3d maximum edge length used to create mesh.
tolerance[in] 3d distance tolerance used to create mesh.
Returns
A value that can be used for m_min_edge_length if no user specified value is available.

◆ MinimumTolerance()

const double ON_MeshParameters::MinimumTolerance ( ) const

◆ operator=()

ON_MeshParameters& ON_MeshParameters::operator= ( const ON_MeshParameters )
default

◆ Read()

bool ON_MeshParameters::Read ( ON_BinaryArchive )

◆ Refine()

const bool ON_MeshParameters::Refine ( ) const

◆ RefineAngleDegrees()

const double ON_MeshParameters::RefineAngleDegrees ( ) const

◆ RefineAngleRadians()

const double ON_MeshParameters::RefineAngleRadians ( ) const

◆ RelativeTolerance()

const double ON_MeshParameters::RelativeTolerance ( ) const

◆ SetClosedObjectPostProcess()

void ON_MeshParameters::SetClosedObjectPostProcess ( bool  bClosedObjectPostProcess)

◆ SetComputeCurvature()

void ON_MeshParameters::SetComputeCurvature ( bool  bComputeCurvature)

◆ SetCustomSettings()

void ON_MeshParameters::SetCustomSettings ( bool  bCustomSettings)

◆ SetCustomSettingsEnabled()

void ON_MeshParameters::SetCustomSettingsEnabled ( bool  bCustomSettingsEnabled)

◆ SetDoublePrecision()

void ON_MeshParameters::SetDoublePrecision ( bool  bDoublePrecision)

◆ SetFaceType()

void ON_MeshParameters::SetFaceType ( unsigned int  face_type)

◆ SetGridAmplification()

void ON_MeshParameters::SetGridAmplification ( double  grid_amplification)

◆ SetGridAngleDegrees()

void ON_MeshParameters::SetGridAngleDegrees ( double  grid_angle_degrees)

◆ SetGridAngleRadians()

void ON_MeshParameters::SetGridAngleRadians ( double  grid_angle_radians)

◆ SetGridAspectRatio()

void ON_MeshParameters::SetGridAspectRatio ( double  grid_aspect_ratio)

◆ SetGridMaxCount()

void ON_MeshParameters::SetGridMaxCount ( int  grid_max_count)

◆ SetGridMinCount()

void ON_MeshParameters::SetGridMinCount ( int  grid_min_count)

◆ SetJaggedSeams()

void ON_MeshParameters::SetJaggedSeams ( bool  bJaggedSeams)

◆ SetMaximumEdgeLength()

void ON_MeshParameters::SetMaximumEdgeLength ( double  maximum_edge_length)

◆ SetMesher()

void ON_MeshParameters::SetMesher ( unsigned int  mesher)

◆ SetMesherId()

void ON_MeshParameters::SetMesherId ( ON_UUID  )

◆ SetMinimumEdgeLength()

void ON_MeshParameters::SetMinimumEdgeLength ( double  minimum_edge_length)

◆ SetMinimumTolerance()

void ON_MeshParameters::SetMinimumTolerance ( double  minimum_tolerance)

◆ SetRefine()

void ON_MeshParameters::SetRefine ( bool  bRefine)

◆ SetRefineAngleDegrees()

void ON_MeshParameters::SetRefineAngleDegrees ( double  refine_angle_degrees)

◆ SetRefineAngleRadians()

void ON_MeshParameters::SetRefineAngleRadians ( double  refine_angle_radians)

◆ SetRelativeTolerance()

void ON_MeshParameters::SetRelativeTolerance ( double  relative_tolerance)

◆ SetSimplePlanes()

void ON_MeshParameters::SetSimplePlanes ( bool  bSimplePlanes)

◆ SetTextureRange()

void ON_MeshParameters::SetTextureRange ( unsigned int  texture_range)

◆ SetTextureRangePictureFrameHack()

void ON_MeshParameters::SetTextureRangePictureFrameHack ( )

◆ SetTolerance()

void ON_MeshParameters::SetTolerance ( double  tolerance)

◆ SimplePlanes()

const bool ON_MeshParameters::SimplePlanes ( ) const

◆ SubDDisplayMeshDensity()

unsigned int ON_MeshParameters::SubDDisplayMeshDensity ( ) const
Returns
SubD display mesh density.
Use ON_MeshParameters to control the density of a SubD limit mesh.
ON_Mesh* mesh = subd->GetLimitSurfaceMesh(
ON_SubDDisplayParameters::CreateFromDisplayDensity( mp.SubDDisplayMeshDensity() ),
nullptr
);

◆ TextureRange()

const unsigned int ON_MeshParameters::TextureRange ( ) const

◆ TextureRangeIsValid()

const bool ON_MeshParameters::TextureRangeIsValid ( ) const

◆ Tolerance()

const double ON_MeshParameters::Tolerance ( ) const

These controls are used in both stages.

approximate maximum distance from center of edge to surface

◆ ToleranceFromObjectSize()

static double ON_MeshParameters::ToleranceFromObjectSize ( double  relative_tolerance,
double  actual_size 
)
static

Get a value to use for tolerance based on the relative_tolerance and actual size.

Parameters
relative_tolerance[in] See m_relative_tolerance field
actual_size[in] Length of object's bounding box diagonal or some similar measure of the object's 3d size.
Returns
A value that can be used for m_tolerance if no user specified value is available.

◆ Write()

bool ON_MeshParameters::Write ( ON_BinaryArchive ) const

Member Data Documentation

◆ DefaultAnalysisMesh

const ON_MeshParameters ON_MeshParameters::DefaultAnalysisMesh
static

Mesh creationg parameters to create the default analysis mesh.

◆ DefaultMesh

const ON_MeshParameters ON_MeshParameters::DefaultMesh
static

Mesh creationg parameters to create the default render mesh.

◆ FastRenderMesh

const ON_MeshParameters ON_MeshParameters::FastRenderMesh
static

Mesh creationg parameters to create the a render mesh when meshing speed is prefered over mesh quality.

◆ PangolinMesherId

const ON_UUID ON_MeshParameters::PangolinMesherId
static

{EB6F6F3F-F975-4546-9D1C-64E9423BEB7F}

◆ QualityRenderMesh

const ON_MeshParameters ON_MeshParameters::QualityRenderMesh
static

Mesh creationg parameters to create the a render mesh when mesh quality is prefered over meshing speed.

◆ RhinoLegacyMesherId

const ON_UUID ON_MeshParameters::RhinoLegacyMesherId
static

surface meshing perameters