Rhino C++ API  8.14
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
ON_SubDFromMeshParameters Class Reference

#include <opennurbs_subd.h>

Public Types

enum  ConcaveCornerOption : unsigned char { ConcaveCornerOption::Unset = 0, ConcaveCornerOption::None = 1, ConcaveCornerOption::AtMeshCorner = 2 }
 Defines how concave corners are treated. More...
 
enum  ConvexCornerOption : unsigned char { ConvexCornerOption::Unset = 0, ConvexCornerOption::None = 1, ConvexCornerOption::AtMeshCorner = 2 }
 Defines how convex corners are treated. More...
 
enum  InteriorCreaseOption : unsigned char { InteriorCreaseOption::Unset = 0, InteriorCreaseOption::None = 1, InteriorCreaseOption::AtMeshDoubleEdge = 2 }
 Specifies the test used to determine when an interior mesh edge generates an interior SubD creased edge. More...
 
enum  TextureCoordinatesOption : unsigned char {
  TextureCoordinatesOption::Unset = 0, TextureCoordinatesOption::None = 1, TextureCoordinatesOption::Automatic = 2, TextureCoordinatesOption::Packed = 3,
  TextureCoordinatesOption::CopyMapping = 4, TextureCoordinatesOption::CopyCoordinates = 5
}
 Specifies how texture coordinate information is transferred from the mesh to the SubD. More...
 

Public Member Functions

 ON_SubDFromMeshParameters ()=default
 Default construction is identical to ON_SubDFromMeshParameters::Smooth. More...
 
 ON_SubDFromMeshParameters (const ON_SubDFromMeshParameters &)=default
 
 ~ON_SubDFromMeshParameters ()=default
 
ON_SubDFromMeshParameters::ConcaveCornerOption CopyConcaveCornerTest (ON_SubDFromMeshParameters source_parameters)
 
ON_SubDFromMeshParameters::ConvexCornerOption CopyConvexCornerTest (ON_SubDFromMeshParameters source_parameters)
 
ON_SubDFromMeshParameters::InteriorCreaseOption CopyInteriorCreaseTest (ON_SubDFromMeshParameters source_options)
 
ON_SubDFromMeshParameters::ConcaveCornerOption GetConcaveCornerOption () const
 
ON_SubDFromMeshParameters::ConvexCornerOption GetConvexCornerOption () const
 
ON_SubDFromMeshParameters::InteriorCreaseOption GetInteriorCreaseOption () const
 
ON_SubDFromMeshParameters::TextureCoordinatesOption GetTextureCoordinatesOption () const
 
bool InterpolateMeshVertices () const
 
double MaximumConvexCornerAngleRadians () const
 
unsigned int MaximumConvexCornerEdgeCount () const
 
bool MergeColinearBoundaryEdges () const
 
bool MergeColinearInteriorEdges () const
 
double MinimumConcaveCornerAngleRadians () const
 
unsigned int MinimumConcaveCornerEdgeCount () const
 
ON_SubDFromMeshParametersoperator= (const ON_SubDFromMeshParameters &)=default
 
void SetConcaveCornerOption (ON_SubDFromMeshParameters::ConcaveCornerOption concave_corner_option)
 
void SetConvexCornerOption (ON_SubDFromMeshParameters::ConvexCornerOption convex_corner_option)
 
void SetInteriorCreaseOption (ON_SubDFromMeshParameters::InteriorCreaseOption interior_crease_option)
 
void SetInterpolateMeshVertices (bool bInterpolateMeshVertices)
 
void SetMaximumConvexCornerAngleRadians (double maximum_convex_corner_angle_radians)
 
void SetMaximumConvexCornerEdgeCount (unsigned int maximum_convex_corner_edge_count)
 
void SetMergeColinearBoundaryEdges (bool bMergeColinearBoundaryEdges)
 
void SetMergeColinearInteriorEdges (bool bMergeColinearInteriorEdges)
 
void SetMinimumConcaveCornerAngleRadians (double minimum_concave_corner_angle_radians)
 
void SetMinimumConcaveCornerEdgeCount (unsigned int minimum_concave_corner_edge_count)
 
void SetTextureCoordinatesOption (ON_SubDFromMeshParameters::TextureCoordinatesOption texture_coordinates_opton)
 

Static Public Member Functions

static ON_SubDFromMeshParameters::ConcaveCornerOption ConcaveCornerOptionFromUnsigned (unsigned int concave_corner_option_as_unsigned)
 
static ON_SubDFromMeshParameters::ConvexCornerOption ConvexCornerOptionFromUnsigned (unsigned int convex_corner_option_as_unsigned)
 
static ON_SubDFromMeshParameters::InteriorCreaseOption InteriorCreaseOptionFromUnsigned (unsigned int interior_crease_option_as_unsigned)
 
static ON_SubDFromMeshParameters::TextureCoordinatesOption TextureCoordinatesOptionFromUnsigned (unsigned int texture_coordinates_opton_as_unsigned)
 

Static Public Attributes

static const ON_SubDFromMeshParameters ConvexAndConcaveCornersAndInteriorCreases
 
static const ON_SubDFromMeshParameters ConvexCornersAndInteriorCreases
 
static const ON_SubDFromMeshParameters InteriorCreases
 Create an interior sub-D crease along all input mesh double edges. More...
 
static const ON_SubDFromMeshParameters Smooth
 No interior creases and no corners. More...
 

Detailed Description

ON_SubDFromMeshParameters

Member Enumeration Documentation

◆ ConcaveCornerOption

Defines how concave corners are treated.

Concave corner options

Enumerator
Unset 

summary>The option is not set.

summary>No concave corners. In general, this is the best choice.

None 

summary> A concave subd corner will appear at input mesh boundary vertices where the corner angle >= MinimumConcaveCornerAngleRadians() and the number of edges the end at the vertex is >= MinimumConcaveCornerEdgeCount(). /summary>

AtMeshCorner 

◆ ConvexCornerOption

enum ON_SubDFromMeshParameters::ConvexCornerOption : unsigned char
strong

Defines how convex corners are treated.

Convex corner options

Enumerator
Unset 

summary>The option is not set.

summary>No convex corners. In general,this is the best choice.

None 

summary> A convex subd corner will appear at input mesh boundary vertices where the corner angle <= MaximumConvexCornerAngleRadians() and the number of edges the end at the vertex is <= MaximumConvexCornerEdgeCount(). /summary>

AtMeshCorner 

◆ InteriorCreaseOption

Specifies the test used to determine when an interior mesh edge generates an interior SubD creased edge.

Custom interior crease options

Enumerator
Unset 

summary>The interior crease test is not defined.

summary>No interior creases.

None 

summary>An interior mesh double edge will create an interior SubD creased edge. An interior mesh double edge occurs when the sides of two mesh faces have have distinct vertex indices and identical vertex locations. /summary>

AtMeshDoubleEdge 

◆ TextureCoordinatesOption

Specifies how texture coordinate information is transferred from the mesh to the SubD.

Texture coordinates

Enumerator
Unset 

summary>The option is not set.

summary>No texture coordianate information is transferred from the mesh.

None 

summary> If the mesh has a mapping, then TextureCoordinatesOption::CopyMapping is used. Otherwise if the mesh has texture coordinates, then TextureCoordinatesOption::CopyCoordinates is used. Otherwise TextureCoordinatesOption::Packed is used. /summary>

Automatic 

summary> No texture coordianate information is transferred from the mesh. The SubD faces are packed. /summary>

Packed 

summary>Texture coordinates mapping information is copied from the mesh. Generally this is the best choice because common mappings, like planar, will appear as most people expect on the SubD. /summary>

CopyMapping 

summary> If a mesh has custom texture coordinates, the custom texture coordinates are transferred to the SubD. This requires more memory resources, slows subdivision evaluation, often produces unattractive results on n-gons, and distorts the texture when comes from a common mapping technique, like planar. This option may be useful when the mesh contains only triangles and quads and the custom texture coordinates are of high quality. /summary>

CopyCoordinates 

Constructor & Destructor Documentation

◆ ON_SubDFromMeshParameters() [1/2]

ON_SubDFromMeshParameters::ON_SubDFromMeshParameters ( )
default

Default construction is identical to ON_SubDFromMeshParameters::Smooth.

◆ ~ON_SubDFromMeshParameters()

ON_SubDFromMeshParameters::~ON_SubDFromMeshParameters ( )
default

◆ ON_SubDFromMeshParameters() [2/2]

ON_SubDFromMeshParameters::ON_SubDFromMeshParameters ( const ON_SubDFromMeshParameters )
default

Member Function Documentation

◆ ConcaveCornerOptionFromUnsigned()

static ON_SubDFromMeshParameters::ConcaveCornerOption ON_SubDFromMeshParameters::ConcaveCornerOptionFromUnsigned ( unsigned int  concave_corner_option_as_unsigned)
static

◆ ConvexCornerOptionFromUnsigned()

static ON_SubDFromMeshParameters::ConvexCornerOption ON_SubDFromMeshParameters::ConvexCornerOptionFromUnsigned ( unsigned int  convex_corner_option_as_unsigned)
static

◆ CopyConcaveCornerTest()

ON_SubDFromMeshParameters::ConcaveCornerOption ON_SubDFromMeshParameters::CopyConcaveCornerTest ( ON_SubDFromMeshParameters  source_parameters)

Description: Copy all settings that control concave corner vertices are created. Parameters: source_options - [in] Returns: The currently selected concave corner option.

◆ CopyConvexCornerTest()

ON_SubDFromMeshParameters::ConvexCornerOption ON_SubDFromMeshParameters::CopyConvexCornerTest ( ON_SubDFromMeshParameters  source_parameters)

Description: Copy all settings that control how convex corner vertices are created. Parameters: source_options - [in] Returns: The currently selected convex corner option.

◆ CopyInteriorCreaseTest()

ON_SubDFromMeshParameters::InteriorCreaseOption ON_SubDFromMeshParameters::CopyInteriorCreaseTest ( ON_SubDFromMeshParameters  source_options)

Description: Copy all settings that control how interior crease edges are created. Parameters: source_options - [in] Returns: The currently selected interior crease option.

◆ GetConcaveCornerOption()

ON_SubDFromMeshParameters::ConcaveCornerOption ON_SubDFromMeshParameters::GetConcaveCornerOption ( ) const

Returns: The currently selected concave corner option.

◆ GetConvexCornerOption()

ON_SubDFromMeshParameters::ConvexCornerOption ON_SubDFromMeshParameters::GetConvexCornerOption ( ) const

Returns: The currently selected convex corner option.

◆ GetInteriorCreaseOption()

ON_SubDFromMeshParameters::InteriorCreaseOption ON_SubDFromMeshParameters::GetInteriorCreaseOption ( ) const

Returns: The interior crease option.

◆ GetTextureCoordinatesOption()

ON_SubDFromMeshParameters::TextureCoordinatesOption ON_SubDFromMeshParameters::GetTextureCoordinatesOption ( ) const

Returns: The texture coorindates option.

◆ InteriorCreaseOptionFromUnsigned()

static ON_SubDFromMeshParameters::InteriorCreaseOption ON_SubDFromMeshParameters::InteriorCreaseOptionFromUnsigned ( unsigned int  interior_crease_option_as_unsigned)
static

◆ InterpolateMeshVertices()

bool ON_SubDFromMeshParameters::InterpolateMeshVertices ( ) const

Returns: false - In ON_SubD::CreateFromMesh(), input mesh vertex locations will be used to set subd vertex control net locations. true - In ON_SubD::CreateFromMesh(), input mesh vertex locations will be used to set subd vertex limit surface locations. Remark: Interpolation computation is available in Rhino, Rhino compute, Rhino Inside, Grasshopper. Interpolation computation is not available in the opennurbs IO toolkit.

◆ MaximumConvexCornerAngleRadians()

double ON_SubDFromMeshParameters::MaximumConvexCornerAngleRadians ( ) const

Description: If ConvexCornerTest() ConvexCornerOption::at_mesh_corner, then an input mesh boundary vertex becomes a sub-D corner when the number of edges that end at the vertex is <= MaximumConvexCornerEdgeCount() edges and the corner angle is <= MaximumConvexCornerAngleRadians().

The default value is 2pi/3 = 120 degrees. Returns: The maximum corner angle.

◆ MaximumConvexCornerEdgeCount()

unsigned int ON_SubDFromMeshParameters::MaximumConvexCornerEdgeCount ( ) const

Description: If ConvexCornerTest() ConvexCornerOption::at_mesh_corner, then an input mesh boundary vertex becomes a sub-D corner when the number of edges that end at the vertex is <= MaximumConvexCornerEdgeCount() edges and the corner angle is <= MaximumConvexCornerAngleRadians(). Returns: The maximum number of edges at a convex corner vertex.

◆ MergeColinearBoundaryEdges()

bool ON_SubDFromMeshParameters::MergeColinearBoundaryEdges ( ) const

Returns: true - In ON_SubD::CreateFromMesh(), colinear boundary edges belonging to the same face are merged into a single edge. false - In ON_SubD::CreateFromMesh(), each mesh boundary edge becomes a SubD boundary edge.

◆ MergeColinearInteriorEdges()

bool ON_SubDFromMeshParameters::MergeColinearInteriorEdges ( ) const

Returns: true - In ON_SubD::CreateFromMesh(), colinear interior edges between two faces are merged into a single edge. false - In ON_SubD::CreateFromMesh(), each mesh interior edge becomes a SubD interior edge.

◆ MinimumConcaveCornerAngleRadians()

double ON_SubDFromMeshParameters::MinimumConcaveCornerAngleRadians ( ) const

Description: If ConcaveCornerTest() ConcaveCornerOption::AtMeshConcaveCorner, then an input mesh boundary vertex becomes a sub-D corner when the number of edges that end at the vertex is >= MinimumConcaveCornerEdgeCount() edges and the corner angle is >= MinimumConcaveCornerAngleRadians(). Returns: The minimum corner angle.

◆ MinimumConcaveCornerEdgeCount()

unsigned int ON_SubDFromMeshParameters::MinimumConcaveCornerEdgeCount ( ) const

Description: If ConcaveCornerTest() ConcaveCornerOption::AtMeshConcaveCorner, then an input mesh boundary vertex becomes a sub-D corner when the number of edges that end at the vertex is >= MinimumConcaveCornerEdgeCount() edges and the corner angle is >= MinimumConcaveCornerAngleRadians(). Returns: The minimum number of edges at a concave corner vertex.

◆ operator=()

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

◆ SetConcaveCornerOption()

void ON_SubDFromMeshParameters::SetConcaveCornerOption ( ON_SubDFromMeshParameters::ConcaveCornerOption  concave_corner_option)

Parameters: concave_corner_option - [in]

◆ SetConvexCornerOption()

void ON_SubDFromMeshParameters::SetConvexCornerOption ( ON_SubDFromMeshParameters::ConvexCornerOption  convex_corner_option)

Parameters: convex_corner_option - [in]

◆ SetInteriorCreaseOption()

void ON_SubDFromMeshParameters::SetInteriorCreaseOption ( ON_SubDFromMeshParameters::InteriorCreaseOption  interior_crease_option)

Parameters: interior_crease_option - [in]

◆ SetInterpolateMeshVertices()

void ON_SubDFromMeshParameters::SetInterpolateMeshVertices ( bool  bInterpolateMeshVertices)

Parameters: false In ON_SubD::CreateFromMesh(), input mesh vertex locations will be used to set subd vertex control net locations. This is the fastest and most robust way to create a subd from a mesh. true In ON_SubD::CreateFromMesh(), input mesh vertex locations will be used to set subd vertex limit surface locations. If there are a large number of vertices, this option can require lots of computation. Remark: Interpolation computation is available in Rhino, Rhino compute, Rhino Inside, Grasshopper. Interpolation computation is not available in the opennurbs IO toolkit.

◆ SetMaximumConvexCornerAngleRadians()

void ON_SubDFromMeshParameters::SetMaximumConvexCornerAngleRadians ( double  maximum_convex_corner_angle_radians)

Description: If ConvexCornerTest() ConvexCornerOption::at_mesh_corner, then an input mesh boundary vertex becomes a sub-D corner when the number of edges that end at the vertex is <= MaximumConvexCornerEdgeCount() edges and the corner angle is <= MaximumConvexCornerAngleRadians().

The default value is 2pi/3 = 120 degrees. Parameters: maximum_convex_corner_angle_radians - [in] > 0.0 and < ON_PI

◆ SetMaximumConvexCornerEdgeCount()

void ON_SubDFromMeshParameters::SetMaximumConvexCornerEdgeCount ( unsigned int  maximum_convex_corner_edge_count)

Description: If ConvexCornerTest() ConvexCornerOption::at_mesh_corner, then an input mesh boundary vertex becomes a sub-D corner when the number of edges that end at the vertex is <= MaximumConvexCornerEdgeCount() edges and the corner angle is <= MaximumConvexCornerAngleRadians(). Parameters: maximum_convex_corner_edge_count - [in]

◆ SetMergeColinearBoundaryEdges()

void ON_SubDFromMeshParameters::SetMergeColinearBoundaryEdges ( bool  bMergeColinearBoundaryEdges)

Parameters: bMergeColinearBoundaryEdges - [in] true In ON_SubD::CreateFromMesh(), colinear boundary edges belonging to the same face are merged into a single edge. In general, this is the best choice and leads to the highest quality of SubD object. false In ON_SubD::CreateFromMesh(), each mesh boundary edge becomes a SubD boundary edge. Use this when the boundary topology of the mesh and SubD should be identical.

◆ SetMergeColinearInteriorEdges()

void ON_SubDFromMeshParameters::SetMergeColinearInteriorEdges ( bool  bMergeColinearInteriorEdges)

Parameters: bMergeColinearInteriorEdges - [in] true In ON_SubD::CreateFromMesh(), colinear interior edges between two faces are merged into a single edge. In general, this is the best choice and leads to the highest quality of SubD object. false In ON_SubD::CreateFromMesh(), each mesh interior edge becomes a SubD interior edge. Use this when the interior topology of the mesh and SubD should be identical.

◆ SetMinimumConcaveCornerAngleRadians()

void ON_SubDFromMeshParameters::SetMinimumConcaveCornerAngleRadians ( double  minimum_concave_corner_angle_radians)

Description: If ConcaveCornerTest() ConcaveCornerOption::AtMeshConcaveCorner, then an input mesh boundary vertex becomes a sub-D corner when the number of edges that end at the vertex is >= MinimumConcaveCornerEdgeCount() edges and the corner angle is >= MinimumConcaveCornerAngleRadians(). Parameters: minimum_concave_corner_angle_radians - [in] > ON_PI and <= ON_2PI

◆ SetMinimumConcaveCornerEdgeCount()

void ON_SubDFromMeshParameters::SetMinimumConcaveCornerEdgeCount ( unsigned int  minimum_concave_corner_edge_count)

Description: If ConcaveCornerTest() = ConcaveCornerOption::AtMeshConcaveCorner, then an input mesh boundary vertex becomes a sub-D corner when the number of edges that end at the vertex is >= MinimumConcaveCornerEdgeCount() edges and the corner angle is >= MinimumConcaveCornerAngleRadians(). Parameters: minimum_concave_corner_edge_count - [in]

◆ SetTextureCoordinatesOption()

void ON_SubDFromMeshParameters::SetTextureCoordinatesOption ( ON_SubDFromMeshParameters::TextureCoordinatesOption  texture_coordinates_opton)

Description: Set the texture coordinates option. Parameters: texture_coordinates_opton - [in]

◆ TextureCoordinatesOptionFromUnsigned()

static ON_SubDFromMeshParameters::TextureCoordinatesOption ON_SubDFromMeshParameters::TextureCoordinatesOptionFromUnsigned ( unsigned int  texture_coordinates_opton_as_unsigned)
static

Member Data Documentation

◆ ConvexAndConcaveCornersAndInteriorCreases

const ON_SubDFromMeshParameters ON_SubDFromMeshParameters::ConvexAndConcaveCornersAndInteriorCreases
static

Create an interior sub-D crease along all input mesh double edges. Look for convex corners at sub-D vertices with 2 edges or fewer that have an included angle <= 120 degrees. Look for concave corners at sub-D vertices with 3 edges or more that have an included angle >= 240 degrees.

◆ ConvexCornersAndInteriorCreases

const ON_SubDFromMeshParameters ON_SubDFromMeshParameters::ConvexCornersAndInteriorCreases
static

Create an interior sub-D crease along all input mesh double edges. Look for convex corners at sub-D vertices with 2 edges or fewer that have an included angle <= 120 degrees.

◆ InteriorCreases

const ON_SubDFromMeshParameters ON_SubDFromMeshParameters::InteriorCreases
static

Create an interior sub-D crease along all input mesh double edges.

◆ Smooth

const ON_SubDFromMeshParameters ON_SubDFromMeshParameters::Smooth
static

No interior creases and no corners.

Crease options