Rhino C++ API  7.21
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
ON_SubDMatrix Class Reference

#include <opennurbs_subd.h>

Public Member Functions

 ON_SubDMatrix ()=default
 
bool EvaluateSubdivisionPoint (unsigned int component_index, const double *point_ring, size_t point_ring_count, size_t point_ring_stride, double subd_point[3]) const
 
bool EvaluateSurfacePoint (const double *point_ring, size_t point_ring_count, size_t point_ring_stride, bool bUndefinedNormalIsPossible, class ON_SubDSectorSurfacePoint &limit_point) const
 
bool EvaluateSurfacePoint (const double *point_ring, size_t point_ring_count, size_t point_ring_stride, bool bUndefinedNormalIsPossible, double limit_point[3], double limit_tangent1[3], double limit_tangent2[3], double limit_normal[3]) const
 
bool IsValid () const
 
bool IsValidPointRing (const double *point_ring, size_t point_ring_count, size_t point_ring_stride) const
 
unsigned int SetFromSectorType (ON_SubDSectorType sector_type)
 
double TestComponentRing (const ON_SubDComponentPtr *component_ring, size_t component_ring_count) const
 
double TestEvaluation () const
 
double TestMatrix () const
 

Static Public Member Functions

static bool EvaluateCosAndSin (unsigned int j, unsigned int n, double *cos_theta, double *sin_theta)
 
static const ON_SubDMatrixFromCache (ON_SubDSectorType sector_type)
 
static double TestEvaluation (const unsigned int subd_recursion_count, ON_SubDSectorIterator sit, ON_SimpleArray< ON_SubDComponentPtr > &component_ring, ON_SimpleArray< ON_3dPoint > &subd_points, class ON_SubDSectorSurfacePoint &limit_point)
 
static double TestEvaluation (ON_SubDSectorType sector_type, unsigned int minimum_sector_face_count, unsigned int maximum_sector_face_count, ON_TextLog *text_log)
 

Public Attributes

const double * m_L1 = nullptr
 
const double * m_L2 = nullptr
 
const double * m_LP = nullptr
 
unsigned int m_R = 0
 the matrix m_S is m_R x m_R (m_R = m_sector_type.PointRingCount()) More...
 
const double *const * m_S = nullptr
 
ON_SubDSectorType m_sector_type
 

Static Public Attributes

static const ON_SubDMatrix Empty
 

Detailed Description

ON_SubDMatrix

Constructor & Destructor Documentation

◆ ON_SubDMatrix()

ON_SubDMatrix::ON_SubDMatrix ( )
default

Member Function Documentation

◆ EvaluateCosAndSin()

static bool ON_SubDMatrix::EvaluateCosAndSin ( unsigned int  j,
unsigned int  n,
double *  cos_theta,
double *  sin_theta 
)
static

Description: Precise evaluation of cos(a) and cos(a) where a = i/n pi. These values are required for high qualitiy limit surface evaluation. Parameters: j - [in] n - [in] cos_theta - [out] cos(j/n pi) sin_theta - [out] sin(j/n pi)

◆ EvaluateSubdivisionPoint()

bool ON_SubDMatrix::EvaluateSubdivisionPoint ( unsigned int  component_index,
const double *  point_ring,
size_t  point_ring_count,
size_t  point_ring_stride,
double  subd_point[3] 
) const

◆ EvaluateSurfacePoint() [1/2]

bool ON_SubDMatrix::EvaluateSurfacePoint ( const double *  point_ring,
size_t  point_ring_count,
size_t  point_ring_stride,
bool  bUndefinedNormalIsPossible,
class ON_SubDSectorSurfacePoint limit_point 
) const

◆ EvaluateSurfacePoint() [2/2]

bool ON_SubDMatrix::EvaluateSurfacePoint ( const double *  point_ring,
size_t  point_ring_count,
size_t  point_ring_stride,
bool  bUndefinedNormalIsPossible,
double  limit_point[3],
double  limit_tangent1[3],
double  limit_tangent2[3],
double  limit_normal[3] 
) const

◆ FromCache()

static const ON_SubDMatrix& ON_SubDMatrix::FromCache ( ON_SubDSectorType  sector_type)
static

Description: Get the subdivision matrix information for the case specified by the input parameters. This information is retrieved from a cache. In some cases, it will be calculated the first time it is needed.
Parameters: facet_type - [in] vertex_tag - [in] valence - [in] The input parameters identify the subdivision case. Remarks: Every member function of ON_SubDMatrix, including this one is thread safe.

◆ IsValid()

bool ON_SubDMatrix::IsValid ( ) const

◆ IsValidPointRing()

bool ON_SubDMatrix::IsValidPointRing ( const double *  point_ring,
size_t  point_ring_count,
size_t  point_ring_stride 
) const

◆ SetFromSectorType()

unsigned int ON_SubDMatrix::SetFromSectorType ( ON_SubDSectorType  sector_type)

Description: Set the values in this ON_SubDMatrix so the information can be used to evaluate the case identified by the input parameters. Parameters: facet_type - [in] vertex_tag - [in] sector_edge_count - [in] The input parameters identify the subdivision case. Returns: R > 0: Success. The matrix is R x R. 0: Failure.

◆ TestComponentRing()

double ON_SubDMatrix::TestComponentRing ( const ON_SubDComponentPtr component_ring,
size_t  component_ring_count 
) const

◆ TestEvaluation() [1/3]

double ON_SubDMatrix::TestEvaluation ( ) const

Description: Run evaluation tests on this subdivision case. Returns: >= 0.0: Test passed. Maximum deviation found in any test is returned. ON_UNSET_VALUE: Test failed.

◆ TestEvaluation() [2/3]

static double ON_SubDMatrix::TestEvaluation ( const unsigned int  subd_recursion_count,
ON_SubDSectorIterator  sit,
ON_SimpleArray< ON_SubDComponentPtr > &  component_ring,
ON_SimpleArray< ON_3dPoint > &  subd_points,
class ON_SubDSectorSurfacePoint limit_point 
)
static

Description: Test cached subdivision matrix on sector identified by sit. Parameters: subd_type - [in] subd_recursion_count - [in] number of times to subdivide sit - [in] vertex to subdivide component_ring - [out] subd_points - [out] limit_point - [out] limit_tangent0 - [out] limit_tangent1 - [out] limit_normal - [out]

◆ TestEvaluation() [3/3]

static double ON_SubDMatrix::TestEvaluation ( ON_SubDSectorType  sector_type,
unsigned int  minimum_sector_face_count,
unsigned int  maximum_sector_face_count,
ON_TextLog text_log 
)
static

Description: Run evaluation tests on a range of subdivision cases. Parameters: sector_type - [in] If ON_SubDSectorType::Empty, then all supported sector types types are tested. minimum_sector_face_count - [in] If 0, then testing begins at ON_SubDSectorType::MinimumSectorFaceCount(vertex_tag) when testing vertex_tag types maximum_sector_face_count - [in] If 0, then testing stops at ON_SubD::maximum_evaluation_valence. text_log - [out] If not nullptr, then a brief written report is printed for each test case. Returns: >= 0.0: Test passed. Maximum deviation found in any test is returned. ON_UNSET_VALUE: Test failed.

◆ TestMatrix()

double ON_SubDMatrix::TestMatrix ( ) const

Returns: ON_UNSET_VALUE - serious error >= 0: Maximum value of numbers that should be zero in and ideal world.
When the matrices, eigenvalues and eigenvectors are correctly calculated, this returned value is in the range from 1e-16 to 5e-13 as valence goes from 3 to 100. For valences < 100, if a value larger than 1.0e-12 occurs, there is a bug in the code.

Member Data Documentation

◆ Empty

const ON_SubDMatrix ON_SubDMatrix::Empty
static

◆ m_L1

const double* ON_SubDMatrix::m_L1 = nullptr

m_L1 and m_L2 = tangent space evaluation vectors. The arrays m_L1[] and m_L2[] have m_R elements. If (vertexR[0], ..., vertexR[R-1]) is a list of standard vertex ring points, then the two vectors V1 = m_L1[0]*vertexR[0] + ... + m_L1[R-1]*vertexR[R-1]. V2 = m_L2[0]*vertexR[0] + ... + m_L2[R-1]*vertexR[R-1]. span the tangent plane and N = V1 x V2 is perpindicular to the limit tangent plane. In general and almost always in practice, V1 and V2 are not unit vectors and it is best to noramalize V1 and V2 before taking the cross product. m_L1 and m_L2 are subdominant eigenvectors of Transpose(m_S). When the subdominant eigenvalue has geometric multiplicity 2, m_L1 and m_L2 span the same space as m_E1 and m_E2. The values stored in m_L1 and m_L2 are chosen to provide accurate evaluation. In come common cases m_L1 and m_L2 are equal to m_E1 and m_E2, but not in all cases.

◆ m_L2

const double* ON_SubDMatrix::m_L2 = nullptr

◆ m_LP

const double* ON_SubDMatrix::m_LP = nullptr

m_LP[] = limit point evaluation vector. The array m_LP[] has m_R elements. If (vertexR[0], ..., vertexR[R-1]) is a list of standard vertex ring points, then Limit point = m_LP[0]*vertexR[0] + ... + m_LP[R-1]*vertexR[R-1]. m_LP is the eigenvector of Transpose(m_S) with eigenvalue = 1. Length(m_LP) = 1.

◆ m_R

unsigned int ON_SubDMatrix::m_R = 0

the matrix m_S is m_R x m_R (m_R = m_sector_type.PointRingCount())

◆ m_S

const double* const* ON_SubDMatrix::m_S = nullptr

The term "standard vertex ring points" is used below.

If "C" is an interior vertex (m_vertex_tag is smooth or dart), (E[0], ...., E[N-1]) is a radially sorted list of its edges, (F[0], ..., F[N-1]) is a radially sorted list of its faces, and (P[0], ..., P[N-1]) is a list of the edge vertices opposite C, E0type = smooth for a smooth vertex and crease for a dart vertex, then C is "standard" if E[0] has type E0type, every other edge E[i] is smooth, every outer vertex/ P[i] is smooth, and every face F[i] has the stadard facet type (tri or quad) for the subdivision algorithm.

If If "C" is a boundary vertex (m_vertex_tag is crease or corner), the conditions listed above are satisified except E[0] and E[N-1] are tagged as crease edges, P[0] and P[N-1] are tagged as crease vertices (NOT corners), and there are N-2 faces, then "C" is a standard boundary vertex.

If the facet type is triangle and C is a standard interior or boundary vertex, then the "standard vertex ring" is the list of N+1 points (C, P[0], ...., P[N-1]).

If the facet type is quad, and C is a standard interior vertex, then the "standard vertex ring" is the list of 2*N+1 points (C, P[0], Q[0], ...., P[N-1], Q[N-1]), where Q[I] is the vertex of quad F[i] diagonally across from C.

If the facet type is quad, and C is a standard boundary vertex, then the "standard vertex ring" is the list of 2*N points (C, P[0], Q[0], ...., P[N-1]). m_S = R x R subdivision matrix If (vertexR[0], ..., vertexR[R-1]) is a list of standard vertex ring points, then then the location of the subdivided ring points (vertexR1[0], ..., vertexR1[R-1]) can be calculated from m_S. vertexR1[i] = m_S[i][0]*vertexR[0] + ... + m_S[i][R-1]*vertexR[R-1]

◆ m_sector_type

ON_SubDSectorType ON_SubDMatrix::m_sector_type