Rhino C++ API  8.6
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
ON_SubDEdge Class Reference

#include <opennurbs_subd.h>

Inheritance diagram for ON_SubDEdge:
ON_SubDComponentBase

Public Types

enum  : unsigned int { MaximumFaceCount = 0xFFF0U }
 

Public Member Functions

 ON_SubDEdge ()=default
 
 ON_SubDEdge (const ON_SubDEdge &)=default
 
 ~ON_SubDEdge ()=default
 
bool AddFaceToArray (ON_SubDFacePtr face_ptr)
 
const ON_SubDEdgeAdjacentEdge (unsigned int edge_vertex_index, unsigned int i) const
 
const ON_SubDEdgePtr AdjacentEdgePtr (unsigned int edge_vertex_index, unsigned int i) const
 
const ON_BoundingBox BoundingBox (ON_SubDComponentLocation subd_appearance, const ON_SubD &subd) const
 
const ON_Plane CenterFrame (ON_SubDComponentLocation subd_appearance) const
 
const ON_3dVector CenterNormal (ON_SubDComponentLocation subd_appearance, unsigned int edge_face_index) const
 
const ON_3dPoint CenterPoint (ON_SubDComponentLocation subd_appearance) const
 
void ClearSavedSubdivisionPoints () const
 
void ClearSavedSubdivisionPoints (bool bClearNeighborhood) const
 
bool ClearSharpnessForExperts ()
 This tool is for expert users and internal use. Use ON_SubD::ClearEdgeSharpness() to remove all sharp edges from a SubD. Sets the edge sharpness to ON_EdgeSharpness::Zero. More...
 
const ON_COMPONENT_INDEX ComponentIndex () const
 
const ON_SubDComponentPtr ComponentPtr () const
 
const ON_BoundingBox ControlNetBoundingBox () const
 
const ON_3dVector ControlNetCenterNormal (unsigned int edge_face_index) const
 
const ON_3dPoint ControlNetCenterPoint () const
 
const ON_3dVector ControlNetDirection () const
 
const ON_3dVector ControlNetDirectionFrom (const ON_SubDVertex *v) const
 
const ON_Line ControlNetLine () const
 
const ON_3dPoint ControlNetPoint (unsigned int i) const
 
unsigned int DartCount () const
 
unsigned int EdgeAttributes () const
 
unsigned int EdgeId () const
 
void EdgeModifiedNofification () const
 
ON_NurbsCurveEdgeSurfaceCurve (bool bClampEndKnots, ON_NurbsCurve *destination_curve) const
 
bool EdgeSurfaceCurveIsSet () const
 
ON_SubDEdgeType EdgeType () const
 EdgeType() is typically used to generate text descriptions and in selection filtering. Do not confuse EdgeType() and EdgeTag(). More...
 
double EndSharpness (const class ON_SubDVertex *v) const
 Get the edge's sharpness at the end with the specified vertex. See ON_SubDEdge::IsSharp() for more information about sharp edges. More...
 
double EndSharpness (unsigned evi) const
 Get the edge's sharpness at the end with the specified vertex. If the edge is a crease, ON_SubDEdgeSharpness::Smooth is returned. See ON_SubDEdge::IsSharp() for more information about sharp edges. More...
 
double EndSharpness (unsigned evi, bool bUseCreaseSharpness) const
 Get the edge's sharpness at the end with the specified vertex. See ON_SubDEdge::IsSharp() for more information about sharp edges. More...
 
bool EvaluateCatmullClarkSubdivisionPoint (double subdivision_point[3]) const
 
const class ON_SubDFaceFace (unsigned int i) const
 
unsigned int FaceArrayIndex (const class ON_SubDFace *f) const
 
unsigned int FaceCount () const
 
ON__UINT_PTR FaceDirection (unsigned int i) const
 
const ON_SubDFacePtr FacePtr (unsigned int i) const
 
const ON_SubDFacePtr FacePtrFromFace (const class ON_SubDFace *f) const
 
bool GetCenterPointAndNormal (ON_SubDComponentLocation subd_appearance, unsigned int edge_face_index, double *P, double *N) const
 
unsigned int GetEdgeSurfaceCurveControlPoints (ON_3dPoint *cvs, size_t cv_capacity) const
 
unsigned int GetSectorBoundaryEdges (unsigned int edge_vertex_index, ON_SubDEdgePtr *edge_ptr0, ON_SubDEdgePtr *edge_ptr1) const
 
double GetSharpSubdivisionPoint (ON_3dPoint &sharp_subdivision_point) const
 Gets the edge's sharp subdivision point and returns the average of the edge's sharpnesses. The final subdivision point is (sharpness >= 1.0) ? sharp_subdivision_point : (1.0-sharpness)(smooth subdivsion point)+sharpness*sharp_subdivision_point. See ON_SubDEdge::IsSharp() for more information about sharp edges. More...
 
bool GetSubdivisionPoint (double subdivision_point[3]) const
 
bool GetSurfaceCenterPointAndNormal (unsigned int edge_face_index, double *P, double *N) const
 
unsigned int GetSurfaceMeshFragmentPoints (ON_3dPoint *P, size_t P_capacity) const
 
bool HasBoundaryEdgeTopology () const
 
bool HasInteriorEdgeTopology (bool bRequireOppositeFaceDirections) const
 
bool IsCrease () const
 
bool IsCreaseOrSharp () const
 Crease edges have tag = ON_SubDEdgeTag::Crease. Sharp edges have tag = ON_SubDEdgeTag::Smooth or ON_SubDEdgeTag::SmoothX and have nonzero sharpness. More...
 
bool IsDartCrease () const
 
bool IsHardCrease () const
 
bool IsSharp () const
 Sharp edges are a blend between smooth edges and crease edges. The limit surface has a continuous normal along a sharp edge. A sharp edge has a smooth tag, has sharpness > 0 at at least one end, and has sharpness < ON_SubDEdgeSharpness::MaximumValue at at least one end. Sharpness has no meaning for edges with crease tags. Both sharpness values are zero for an ordinary smooth edge. Edge sharpness steadily decreases during subdivision and becomes zero after at most ON_SubDEdgeSharpness::MaximumValue subdivisions. More...
 
bool IsSmooth () const
 
bool IsSmoothNotSharp () const
 Determine if an edge is smooth and is not sharp. More...
 
bool IsSmoothNotX () const
 
bool IsSmoothNotXNotSharp () const
 An expert user function to determine if an edge tag in ON_SubDEdgeTag::Smooth and is not sharp. More...
 
bool IsSmoothX () const
 
unsigned int MarkedFaceCount () const
 
unsigned int MarkedVertexCount () const
 
const ON_SubDFaceNeighborFace (const ON_SubDFace *face, bool bStopAtCrease) const
 
const ON_SubDFacePtr NeighborFacePtr (const ON_SubDFace *face, bool bStopAtCrease) const
 
const ON_ComponentStatus NeighborhoodStatusLogicalOr (bool bIncludeVertices, bool bIncludeFaces) const
 
ON_SubDEdgeoperator= (const ON_SubDEdge &)=default
 
const class ON_SubDVertexOtherEndVertex (const class ON_SubDVertex *vertex) const
 
const ON_3dPoint PointAt (double normalized_edge_parameter, ON_SubDComponentLocation subd_appearance) const
 
bool RemoveFaceFromArray (const ON_SubDFace *f)
 
bool RemoveFaceFromArray (unsigned int i, ON_SubDFacePtr &removed_face)
 
unsigned int ReplaceFaceInArray (const ON_SubDFace *old_face, const ON_SubDFace *new_face)
 
void SetSharpnessForExperts (ON_SubDEdgeSharpness sharpness)
 This tool is for expert users and internal use. A collection of ON_SubD::SetEdgeSharpness() functions provide the easiest way to set and change edge sharpness. Set the edge sharpness values to (sharpness[0],sharpness[1]). The interval values must be >= 0 and <= ON_SubDEdgeSharpness::MaximumValue. See ON_SubDEdge::IsSharp() for more information about sharp edges. More...
 
const ON_SubDEdgeSharpness Sharpness (bool bUseCreaseSharpness) const
 Get the edge's sharpness. See ON_SubDEdge::IsSharp() for more information about sharp edges. More...
 
const ON_SubDEdgeSharpness SubdivideSharpness (const class ON_SubDVertex *end_vertex, bool bReverseSharpness) const
 Get the edge sharpenss values for the subdivided edge at the specified end of this edge. More...
 
const ON_SubDEdgeSharpness SubdivideSharpness (unsigned evi, bool bReverseSharpness) const
 Get the edge sharpenss values for the subdivided edge at the specified end of this edge. More...
 
const ON_3dPoint SubdivisionPoint () const
 Get the SubD edge Catmull-Clark subdivision point. More...
 
const ON_BoundingBox SurfaceBoundingBox (const ON_SubD &subd) const
 
const ON_3dVector SurfaceCenterNormal (unsigned int edge_face_index) const
 
const ON_3dPoint SurfaceCenterPoint () const
 
unsigned int TaggedEndIndex () const
 
ON__UINT32 TopologyCRC32 (bool bIncludeSubdivisionProperties) const
 Get a 32 bit CRC that is useful in detecting when an edge's connections to attached vertices or faces have been changed. More...
 
const ON_SHA1_Hash TopologyHash (bool bIncludeSubdivisionProperties) const
 Get a SHA-1 hash that is useful in detecting when an edge's connections to attached vertices or faces have been changed. See also ON_SubDEdge::TopologyCRC32() which, in practice, is just as reliable as the hash. More...
 
bool Transform (bool bTransformationSavedSubdivisionPoint, const class ON_Xform &xform)
 
void UnsetSectorCoefficientsForExperts () const
 
bool UpdateEdgeSectorCoefficientsForExperts (bool bUnsetEdgeSectorCoefficientsOnly) const
 
const class ON_SubDVertexVertex (unsigned evi) const
 
unsigned int VertexArrayIndex (const class ON_SubDVertex *v) const
 
unsigned int VertexCount () const
 
unsigned int VertexId (unsigned evi) const
 
bool Write (class ON_BinaryArchive &archive) const
 
- Public Member Functions inherited from ON_SubDComponentBase
 ON_SubDComponentBase ()=default
 
 ON_SubDComponentBase (const ON_SubDComponentBase &)=default
 
 ~ON_SubDComponentBase ()=default
 
unsigned int ArchiveId () const
 
bool ClearMark () const
 
ON__UINT8 ClearMarkBits () const
 
void ClearSavedSubdivisionPoint () const
 
void ClearSubdivisionDisplacement () const
 
bool GetSavedSubdivisionPoint (double subdivision_point[3]) const
 
bool GetSubdivisionDisplacement (double *) const
 
bool InSymmetrySet () const
 
bool IsActive () const
 
bool IsSymmetrySetPrimaryMotif () const
 
bool Mark () const
 
ON__UINT8 MarkBits () const
 
ON_SubDComponentBaseoperator= (const ON_SubDComponentBase &)=default
 
const ON_3dPoint SavedSubdivisionPoint () const
 
bool SavedSubdivisionPointIsSet () const
 
void SetArchiveId (unsigned int archive_id) const
 
bool SetMark () const
 
bool SetMark (bool bMark) const
 
ON__UINT8 SetMarkBits (ON__UINT8 mark_bits) const
 
bool SetSavedSubdivisionPoint (const double subdivision_point[3]) const
 
bool SetSubdivisionDisplacement (const double *)
 
void SetSubdivisionLevel (unsigned level)
 
const ON_ComponentStatus Status () const
 
const ON_3dVector SubdivisionDisplacement () const
 
bool SubdivisionDisplacementIsNonzero () const
 
const unsigned SubdivisionLevel () const
 

Static Public Member Functions

static const ON_SubDEdgePtr FromVertices (const ON_SubDVertex *vertex0, const ON_SubDVertex *vertex1)
 
static const ON_SubDEdgeFromVertices (const ON_SubDVertex *vertex0, const ON_SubDVertex *vertex1, bool bIgnoreOrientation)
 
static bool Read (class ON_BinaryArchive &archive, class ON_SubD &subd, class ON_SubDEdge *&edge)
 
- Static Public Member Functions inherited from ON_SubDComponentBase
static int CompareId (const ON_SubDComponentBase *lhs, const ON_SubDComponentBase *rhs)
 

Public Attributes

ON_SubDEdgeTag m_edge_tag = ON_SubDEdgeTag::Unset
 
ON_SubDFacePtr m_face2 [2] = {}
 
unsigned short m_face_count = 0
 
ON_SubDFacePtrm_facex = nullptr
 
unsigned short m_facex_capacity = 0
 
const class ON_SubDEdgem_next_edge = nullptr
 linked list of edges on this level More...
 
const class ON_SubDEdgem_prev_edge = nullptr
 m_prev_edge, m_next_edge must be the first data members of ON_SubDEdge More...
 
double m_sector_coefficient [2] = {}
 
const class ON_SubDVertexm_vertex [2] = {}
 
- Public Attributes inherited from ON_SubDComponentBase
unsigned int m_group_id = 0U
 
unsigned int m_id = 0
 
ON_ComponentStatus m_status = ON_ComponentStatus::NoneSet
 
const class ON_SubDVertexm_subd_point1 = nullptr
 

Static Public Attributes

static const ON_SubDEdge Empty
 
- Static Public Attributes inherited from ON_SubDComponentBase
static const ON_SubDComponentBase Unset
 

Friends

class ON_Internal_SubDFaceMeshFragmentAccumulator
 
class ON_SubDArchiveIdMap
 
class ON_SubDFace
 
class ON_SubDHeap
 
class ON_SubDVertex
 

Additional Inherited Members

- Protected Types inherited from ON_SubDComponentBase
enum  ModifiedFlags : unsigned char { Modified1Bit = 0x01, Modified2Bit = 0x02, ModifiedFlagsMask = 0x03 }
 
enum  SavedPointsFlags : unsigned char { SubdivisionPointBit = 0x40, SurfacePointBit = 0x80, CachedPointMask = 0xC0 }
 
- Protected Member Functions inherited from ON_SubDComponentBase
void CopyBaseFrom (const ON_SubDComponentBase *src, bool bCopySymmetrySetNext)
 
void Internal_ClearModifiedFlags () const
 
void Internal_ClearSubdivisionPointAndSurfacePointFlags () const
 
void Internal_ClearSubdivisionPointFlag () const
 
void Internal_ClearSurfacePointFlag () const
 
bool Internal_Modified1IsSet () const
 
bool Internal_Modified1or2IsSet () const
 
void Internal_SetModified1Flag () const
 
void Internal_SetModified2Flag () const
 
void Internal_SetSavedSurfacePointFlag (bool bSavedSurfacePointFlag) const
 
bool Internal_SubdivisionPointFlag () const
 
bool Internal_SurfacePointFlag () const
 
void Internal_TransformComponentBase (bool bTransformationSavedSubdivisionPoint, const class ON_Xform &xform)
 
- Protected Attributes inherited from ON_SubDComponentBase
unsigned char m_level = 0U
 
unsigned char m_saved_points_flags = 0U
 
double m_saved_subd_point1 [3]
 GetSubdivisionPoint( bUseSavedSubdivisionPoint=true ) can change the value of m_cache_subd_P. More...
 

Detailed Description

ON_SubDEdge

Member Enumeration Documentation

◆ anonymous enum

anonymous enum : unsigned int

Array of m_face_count faces.

The first two are in m_face2[0] and m_face2[1]. When m_face_count > 3, the third and additional faces are in m_facex[0], ..., m_facex[m_face_count-3];

The value of ON_SubDFacePtr.FaceDirection() is 0 if the edge's natural orientation from m_vertex[0] to m_vertex[1] agrees with the face's boundary orientation.

The value of ON_SubDFacePtr.FaceDirection() is 1 if the edge's natural orientation from m_vertex[0] to m_vertex[1] is opposited the face's boundary orientation.

Enumerator
MaximumFaceCount 

Constructor & Destructor Documentation

◆ ON_SubDEdge() [1/2]

ON_SubDEdge::ON_SubDEdge ( )
default

◆ ~ON_SubDEdge()

ON_SubDEdge::~ON_SubDEdge ( )
default

◆ ON_SubDEdge() [2/2]

ON_SubDEdge::ON_SubDEdge ( const ON_SubDEdge )
default

Member Function Documentation

◆ AddFaceToArray()

bool ON_SubDEdge::AddFaceToArray ( ON_SubDFacePtr  face_ptr)

Description: Expert user tool to add a face from the edges's face array. Remarks: Does not modify the face. If the edge is not referenced in the face's edge array, then the edge must be inserted in the correct location in the faces array. If you are creating a non-manifold SubD, you must first reserve m_facex[] capacity by calling ON_SubD::GrowEdgeFaceArray().

◆ AdjacentEdge()

const ON_SubDEdge* ON_SubDEdge::AdjacentEdge ( unsigned int  edge_vertex_index,
unsigned int  i 
) const

◆ AdjacentEdgePtr()

const ON_SubDEdgePtr ON_SubDEdge::AdjacentEdgePtr ( unsigned int  edge_vertex_index,
unsigned int  i 
) const

Parameters: edge_vertex_index - [in] 0 or 1 identifying which end of this edge to check. i - [in] Index of the face in this edge's face array. Returns: The edge adjacent to this edge in this->Face(i). The orientation is with respect to this->Face(i).

◆ BoundingBox()

const ON_BoundingBox ON_SubDEdge::BoundingBox ( ON_SubDComponentLocation  subd_appearance,
const ON_SubD subd 
) const

◆ CenterFrame()

const ON_Plane ON_SubDEdge::CenterFrame ( ON_SubDComponentLocation  subd_appearance) const

◆ CenterNormal()

const ON_3dVector ON_SubDEdge::CenterNormal ( ON_SubDComponentLocation  subd_appearance,
unsigned int  edge_face_index 
) const

◆ CenterPoint()

const ON_3dPoint ON_SubDEdge::CenterPoint ( ON_SubDComponentLocation  subd_appearance) const

◆ ClearSavedSubdivisionPoints() [1/2]

void ON_SubDEdge::ClearSavedSubdivisionPoints ( ) const

Description: Clears saved subdivision and limit surface information for this edge. Attached vertices and faces are not modified.

◆ ClearSavedSubdivisionPoints() [2/2]

void ON_SubDEdge::ClearSavedSubdivisionPoints ( bool  bClearNeighborhood) const

Description: Clears saved subdivision and limit surface information for this edge. Parameters: bClearNeighborhood - [in] If true, all vertices and faces attached to this edge are also cleared.

◆ ClearSharpnessForExperts()

bool ON_SubDEdge::ClearSharpnessForExperts ( )

This tool is for expert users and internal use. Use ON_SubD::ClearEdgeSharpness() to remove all sharp edges from a SubD. Sets the edge sharpness to ON_EdgeSharpness::Zero.

Returns
True if there were changes to the edge.

◆ ComponentIndex()

const ON_COMPONENT_INDEX ON_SubDEdge::ComponentIndex ( ) const

◆ ComponentPtr()

const ON_SubDComponentPtr ON_SubDEdge::ComponentPtr ( ) const

◆ ControlNetBoundingBox()

const ON_BoundingBox ON_SubDEdge::ControlNetBoundingBox ( ) const

◆ ControlNetCenterNormal()

const ON_3dVector ON_SubDEdge::ControlNetCenterNormal ( unsigned int  edge_face_index) const

◆ ControlNetCenterPoint()

const ON_3dPoint ON_SubDEdge::ControlNetCenterPoint ( ) const

◆ ControlNetDirection()

const ON_3dVector ON_SubDEdge::ControlNetDirection ( ) const

Returns: If vertices are set, then the vector from m_vertex[0]->ControlNetPoint() to m_vertex[1]->ControlNetPoint() is returned. Otherwise ON_3dVector::NanVector is returned.

◆ ControlNetDirectionFrom()

const ON_3dVector ON_SubDEdge::ControlNetDirectionFrom ( const ON_SubDVertex v) const

Returns: If vertices are set and v is an end of the edge, then the vector from v to OtherEndVertex(v) is returned. Otherwise ON_3dVector::NanVector is returned.

◆ ControlNetLine()

const ON_Line ON_SubDEdge::ControlNetLine ( ) const

◆ ControlNetPoint()

const ON_3dPoint ON_SubDEdge::ControlNetPoint ( unsigned int  i) const

Parameters: i - [in] 0 or 1. Returns: If i is 0 or 1 and vertex[i] is set, then vertex[i]->ControlNetPoint() is returned. Otherwise ON_3dPoint::NanPoint is returned.

◆ DartCount()

unsigned int ON_SubDEdge::DartCount ( ) const

Returns: 0: end vertices are not tagged as darts 1: one end vertex is tagged as a dart. 2: both end vertices are tagged as a darts.

◆ EdgeAttributes()

unsigned int ON_SubDEdge::EdgeAttributes ( ) const

Returns: bitwise or of applicable ON_ComponentAttributes::EdgeAttributes values. Remarks: ON_ComponentAttributes::EdgeAttributes has subsets of mutually exclusive edge attributes. If the edge is valid, then exactly one bit from each mutually exclusive set of properties will be set. If an edge is not valie, then all bits for a set may be clear. For example, if the edge has nullptr values in m_vertex[] or the vertex control point locations are unset or nan, then neither the ON_ComponentAttributes::EdgeAttributes::Open bit nor ON_ComponentAttributes::EdgeAttributes::Closed bit will be set.

◆ EdgeId()

unsigned int ON_SubDEdge::EdgeId ( ) const

◆ EdgeModifiedNofification()

void ON_SubDEdge::EdgeModifiedNofification ( ) const

Description: Call this function if the edge is modified and it will clear any cached subdivision information that needs to be recalculated.

◆ EdgeSurfaceCurve()

ON_NurbsCurve* ON_SubDEdge::EdgeSurfaceCurve ( bool  bClampEndKnots,
ON_NurbsCurve destination_curve 
) const

◆ EdgeSurfaceCurveIsSet()

bool ON_SubDEdge::EdgeSurfaceCurveIsSet ( ) const

◆ EdgeType()

ON_SubDEdgeType ON_SubDEdge::EdgeType ( ) const

EdgeType() is typically used to generate text descriptions and in selection filtering. Do not confuse EdgeType() and EdgeTag().

Returns
If the edge has a valid combination of face count, tag, and sharpness properties, then the corresponding type is returned. Otherwise, ON_SubDEdgeType::Invalid is returned.

◆ EndSharpness() [1/3]

double ON_SubDEdge::EndSharpness ( const class ON_SubDVertex v) const

Get the edge's sharpness at the end with the specified vertex. See ON_SubDEdge::IsSharp() for more information about sharp edges.

Parameters
vVertex at an end of the edge
Returns

If the edge is sharp, the sharpness at the end with the specified vertex is returned. If the edge is smooth or a crease, 0 is returned. Otherwise, 0.0 is returned.

The sharpness at the end of the edge with the specified vertex.

◆ EndSharpness() [2/3]

double ON_SubDEdge::EndSharpness ( unsigned  evi) const

Get the edge's sharpness at the end with the specified vertex. If the edge is a crease, ON_SubDEdgeSharpness::Smooth is returned. See ON_SubDEdge::IsSharp() for more information about sharp edges.

Parameters
eviEnd index (0=start or 1=end).
Returns

If the edge is sharp, the sharpness at the end with the specified by evi is returned. If the edge is smooth or a crease, 0 is returned. Otherwise, 0.0 is returned.

The sharpness at the end of the edge specified by evi.

◆ EndSharpness() [3/3]

double ON_SubDEdge::EndSharpness ( unsigned  evi,
bool  bUseCreaseSharpness 
) const

Get the edge's sharpness at the end with the specified vertex. See ON_SubDEdge::IsSharp() for more information about sharp edges.

Parameters
eviEnd index (0=start or 1=end).
bUseCreaseSharpnessIf the edge is a crease and bUseCreaseSharpness is false, then ON_SubDEdgeSharpness::Smooth is returned. If the edge is a crease and bUseCreaseSharpness is true, then ON_SubDEdgeSharpness::Crease is returned.
Returns

If the edge is sharp, the sharpness at the end with the specified by evi is returned. If the edge is smooth or a crease, 0 is returned. Otherwise, 0.0 is returned.

The sharpness at the end of the edge specified by evi.

◆ EvaluateCatmullClarkSubdivisionPoint()

bool ON_SubDEdge::EvaluateCatmullClarkSubdivisionPoint ( double  subdivision_point[3]) const

Description: Evaluates the Catmull-Clark subdivision point ignoring all cached information. This function is typically used in testing and debugging code and in ordinary cases, it is faster and better to call SubdivisionPoint() or GetSubdivisionPoint(). Parameters: subdivision_point - [out] The edge Catmull-Clark subdivision point is returned here.

◆ Face()

const class ON_SubDFace* ON_SubDEdge::Face ( unsigned int  i) const

◆ FaceArrayIndex()

unsigned int ON_SubDEdge::FaceArrayIndex ( const class ON_SubDFace f) const

◆ FaceCount()

unsigned int ON_SubDEdge::FaceCount ( ) const

◆ FaceDirection()

ON__UINT_PTR ON_SubDEdge::FaceDirection ( unsigned int  i) const

◆ FacePtr()

const ON_SubDFacePtr ON_SubDEdge::FacePtr ( unsigned int  i) const

◆ FacePtrFromFace()

const ON_SubDFacePtr ON_SubDEdge::FacePtrFromFace ( const class ON_SubDFace f) const

◆ FromVertices() [1/2]

static const ON_SubDEdgePtr ON_SubDEdge::FromVertices ( const ON_SubDVertex vertex0,
const ON_SubDVertex vertex1 
)
static

◆ FromVertices() [2/2]

static const ON_SubDEdge* ON_SubDEdge::FromVertices ( const ON_SubDVertex vertex0,
const ON_SubDVertex vertex1,
bool  bIgnoreOrientation 
)
static

Parameters: vertex0 - [in] vertex1 - [in] bIgnoreOrientation - [in] If false, then the returned edge must have vertices (vertex0, vertex1). If true, then the returned edge may have vertices (vertex0, vertex1) or (vertex1, vertex0). Returns: If an edge connects the input vertices, it is returned. Otherwise nullptr is returned.

◆ GetCenterPointAndNormal()

bool ON_SubDEdge::GetCenterPointAndNormal ( ON_SubDComponentLocation  subd_appearance,
unsigned int  edge_face_index,
double *  P,
double *  N 
) const

◆ GetEdgeSurfaceCurveControlPoints()

unsigned int ON_SubDEdge::GetEdgeSurfaceCurveControlPoints ( ON_3dPoint cvs,
size_t  cv_capacity 
) const

Parameters: cvs - [out] cv_capacity - [in] Capacity of cvs[] array. Pass 0 if you want this function to return the minimum required capacity for this edge without setting cvs. Returns: 0 - failed. >= 4: Number of cvs for a cubic uniform nonrational NURBS curve with (cv_count+2) knots = (-2,-1,0,1,2,3,4,5,6,7,8,9,10).

◆ GetSectorBoundaryEdges()

unsigned int ON_SubDEdge::GetSectorBoundaryEdges ( unsigned int  edge_vertex_index,
ON_SubDEdgePtr edge_ptr0,
ON_SubDEdgePtr edge_ptr1 
) const

Parameters: edge_vertex_index - [in] 0 or 1 edge_ptr0 - [out] edge_ptr1 - [out] Crease edges that bound the sector containing this edge. The direction value of the edge pointer identifies the end of the sector boundary edge this->at m_vertex[edge_vertex_index]. Returns: Number of faces in the sector.

◆ GetSharpSubdivisionPoint()

double ON_SubDEdge::GetSharpSubdivisionPoint ( ON_3dPoint sharp_subdivision_point) const

Gets the edge's sharp subdivision point and returns the average of the edge's sharpnesses. The final subdivision point is (sharpness >= 1.0) ? sharp_subdivision_point : (1.0-sharpness)(smooth subdivsion point)+sharpness*sharp_subdivision_point. See ON_SubDEdge::IsSharp() for more information about sharp edges.

Parameters
sharp_subdivision_pointIf the returned sharpness is > 0, then the sharp subdivision point (=edge->ControlNetCenterPoint()) is returned. Otherwise ON_3dPoint::NanPoint is returned.

The relationship between
3d point C = ordinary Catmull-Clark edge subdivision point, 3d point P = sharp_subdivision_point, s = this->GetSharpSubdivisionPoint(P), and 3d point E = this->SubdivisionPoint() is E = (s >= 1.0) ? P : ((s > 0.0) ? (s*P + (1-s)*C) : C);

NOTE WELL: when the returned value is zero, S is ON_3dPoint::NanPoint and any calculation using S will results in nans.

Returns
If the edge is sharp, a value > 0 and < ON_SubDEdgeSharpness::MaximumValue is returned. Otherwise 0.0 is returned and sharp_subdivision_point = ON_3dPoint::NanPoint.

◆ GetSubdivisionPoint()

bool ON_SubDEdge::GetSubdivisionPoint ( double  subdivision_point[3]) const

Parameters: subdivision_point - [out] Returns: true if successful

◆ GetSurfaceCenterPointAndNormal()

bool ON_SubDEdge::GetSurfaceCenterPointAndNormal ( unsigned int  edge_face_index,
double *  P,
double *  N 
) const

Description: Get the limit surface point location and normal for the edge's midpoint from the limit mesh grid. Parameters: edge - [in] An edge in this SubD. edge_face_index - [in] Index of the face to use for the normal. If the edge is a crease, then each attached face may have a different normal. Pass 0 when in doubt. P - [out] P = limit surface location or ON_3dPoint::NanPoint if not available. N - [out] N = limit surface unit normal or ON_3dVector::NanVector if not available. Returns: True if the point and normal were set from the limit mesh fragment. False if the limit mesh fragment was not found and nan values were returned. Remarks: Requires information created by ON_SubD::UpdateSurfaceMeshCache()

◆ GetSurfaceMeshFragmentPoints()

unsigned int ON_SubDEdge::GetSurfaceMeshFragmentPoints ( ON_3dPoint P,
size_t  P_capacity 
) const

Description: Gets the limit esh fragment points for the edge. Parameters: P_capacity - [in] If input 0 = P_capacity, the required capacity is returned, otherwise P_capacity is the capacity of the P[] array P - [out] When P_capacity > 0, the points are returned here. Returns: Number of returned points (0,2,5,5,9,17,33,65)

◆ HasBoundaryEdgeTopology()

bool ON_SubDEdge::HasBoundaryEdgeTopology ( ) const

Parameters: bRequireSameFaceOrientation - [in] If true, the attached faces must use the edge with opposite directions (oriented manifold). Returns: True if the edge has two distinct faces.

◆ HasInteriorEdgeTopology()

bool ON_SubDEdge::HasInteriorEdgeTopology ( bool  bRequireOppositeFaceDirections) const

Parameters: bRequireSameFaceOrientation - [in] If true, the attached faces must use the edge with opposite directions (oriented manifold). Returns: True if the edge has two distinct faces.

◆ IsCrease()

bool ON_SubDEdge::IsCrease ( ) const

Returns: True if m_edge_tag is ON_SubDEdgeTag::Crease.

◆ IsCreaseOrSharp()

bool ON_SubDEdge::IsCreaseOrSharp ( ) const

Crease edges have tag = ON_SubDEdgeTag::Crease. Sharp edges have tag = ON_SubDEdgeTag::Smooth or ON_SubDEdgeTag::SmoothX and have nonzero sharpness.

Returns
(this->IsCrease() || this->IsSharp()).

◆ IsDartCrease()

bool ON_SubDEdge::IsDartCrease ( ) const

Returns: True if m_edge_tag is ON_SubDEdgeTag::Crease and at least one of its end vertices are tagged as ON_SubDVertexTag::Dart.

◆ IsHardCrease()

bool ON_SubDEdge::IsHardCrease ( ) const

Returns: True if m_edge_tag is ON_SubDEdgeTag::Crease and both of its end vertices are tagged as ON_SubDVertexTag::Crease, or ON_SubDVertexTag::Corner.

◆ IsSharp()

bool ON_SubDEdge::IsSharp ( ) const

Sharp edges are a blend between smooth edges and crease edges. The limit surface has a continuous normal along a sharp edge. A sharp edge has a smooth tag, has sharpness > 0 at at least one end, and has sharpness < ON_SubDEdgeSharpness::MaximumValue at at least one end. Sharpness has no meaning for edges with crease tags. Both sharpness values are zero for an ordinary smooth edge. Edge sharpness steadily decreases during subdivision and becomes zero after at most ON_SubDEdgeSharpness::MaximumValue subdivisions.

Returns
True if the edge is tagged as smooth, and has at least one end with sharpness > 0 and < ON_SubDEdgeSharpness::MaximumValue.

◆ IsSmooth()

bool ON_SubDEdge::IsSmooth ( ) const

Returns: True if m_edge_tag is ON_SubDEdgeTag::Smooth or ON_SubDEdgeTag::SmoothX. False in all other cases.

◆ IsSmoothNotSharp()

bool ON_SubDEdge::IsSmoothNotSharp ( ) const

Determine if an edge is smooth and is not sharp.

Returns
(true == IsSmooth() and false == IsSharp())

◆ IsSmoothNotX()

bool ON_SubDEdge::IsSmoothNotX ( ) const

Returns: True if m_edge_tag is ON_SubDEdgeTag::Smooth. Remarks: Expert user function. This is used in rare cases when level 0 edges tagged as ON_SubDEdgeTag::SmoothX need special handling in low level evaluation code. Typical SDK level functions and anything related to runtime user interface should call IsSmooth().

◆ IsSmoothNotXNotSharp()

bool ON_SubDEdge::IsSmoothNotXNotSharp ( ) const

An expert user function to determine if an edge tag in ON_SubDEdgeTag::Smooth and is not sharp.

Returns
(true == IsSmoothNotX() and false == IsSharp())

◆ IsSmoothX()

bool ON_SubDEdge::IsSmoothX ( ) const

Returns: True if m_edge_tag is ON_SubDEdgeTag::SmoothX. Remarks: Expert user function. This is used in rare cases when level 0 edges tagged as ON_SubDEdgeTag::SmoothX need special handling in low level evaluation code. Typical SDK level functions and anything related to runtime user interface should call IsSmooth(). An edge tagged as "X" can occur at level 0. It is subdivided as a smooth vertex and both of its end vertices are tagged as ON_SubDVertexTag::Crease, ON_SubDVertexTag::Corner, or ON_SubDVertexTag::Dart. This tag cannot appear at level N with N >= 1.

◆ MarkedFaceCount()

unsigned int ON_SubDEdge::MarkedFaceCount ( ) const

Returns: Number of faces attached to this edge with Face().m_status.RuntimeMark() = true;

◆ MarkedVertexCount()

unsigned int ON_SubDEdge::MarkedVertexCount ( ) const

Returns: Number of end vertices with Vertex().m_status.RuntimeMark() = true;

◆ NeighborFace()

const ON_SubDFace* ON_SubDEdge::NeighborFace ( const ON_SubDFace face,
bool  bStopAtCrease 
) const

Description: Return the neighboring face. Parameters: face - [in] A face referenced in the edge's m_face2[] array. bStopAtCrease - [in] If true and if m_edge_tag = ON_SubDEdgeTag::Crease, then nullptr is returned. Returns: If the m_face_count = 2, m_edge_tag is smooth or x or passes the crease tag test, one of m_face2[0,1] points a face, then the neighboring face is returned. In any other case, nullptr is returned.

◆ NeighborFacePtr()

const ON_SubDFacePtr ON_SubDEdge::NeighborFacePtr ( const ON_SubDFace face,
bool  bStopAtCrease 
) const

Description: Return the neighboring face. Parameters: face - [in] A face referenced in the edge's m_face2[] array. bStopAtCrease - [in] If true and if m_edge_tag = ON_SubDEdgeTag::Crease, then nullptr is returned. Returns: If the m_face_count = 2, m_edge_tag is smooth or x or passes the crease tag test, one of m_face2[0,1] points a face, then the neighboring face is returned. In any other case, ON_SubDFacePtr::Null is returned.

◆ NeighborhoodStatusLogicalOr()

const ON_ComponentStatus ON_SubDEdge::NeighborhoodStatusLogicalOr ( bool  bIncludeVertices,
bool  bIncludeFaces 
) const

Parameters: bIncludeVertices - [in] If true, then attached vertices are included. bIncludeFaces - [in] If true, then attached faces are included. Returns: A ON_ComponentStatusLogicalOr() of this vertex's status and the specified attached components. See Also: ON_SubDComponentBase::Status()

◆ operator=()

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

◆ OtherEndVertex()

const class ON_SubDVertex* ON_SubDEdge::OtherEndVertex ( const class ON_SubDVertex vertex) const

Description: Return the vertex at the other end of the edge. Parameters: vertex - [in] A vertex referenced in the edge's m_vertex[] array. Returns: If vertex is not nullptr and exactly one of m_vertex[] is equal to vertex, then the other m_vertex[] pointer is returned. In any other case, nullptr is returned. See Also: ON_SubDEdge.NeighborFace()

◆ PointAt()

const ON_3dPoint ON_SubDEdge::PointAt ( double  normalized_edge_parameter,
ON_SubDComponentLocation  subd_appearance 
) const

◆ Read()

static bool ON_SubDEdge::Read ( class ON_BinaryArchive archive,
class ON_SubD subd,
class ON_SubDEdge *&  edge 
)
static

◆ RemoveFaceFromArray() [1/2]

bool ON_SubDEdge::RemoveFaceFromArray ( const ON_SubDFace f)

Description: Expert user tool to remove a face from the edges's face array. Remarks: Does not modify the face. If the edge is referenced in the face's edge array, then the edge must be removed from the face's edge array.

◆ RemoveFaceFromArray() [2/2]

bool ON_SubDEdge::RemoveFaceFromArray ( unsigned int  i,
ON_SubDFacePtr removed_face 
)

Description: Expert user tool to remove a face from the edges's face array. Remarks: Does not modify the face. If the edge is referenced in the face's edge array, then the edge must be removed from the face's edge array.

◆ ReplaceFaceInArray()

unsigned int ON_SubDEdge::ReplaceFaceInArray ( const ON_SubDFace old_face,
const ON_SubDFace new_face 
)

Description: Expert user tool to replace reference to old_face with a reference to new_face. Existing orientation is copied. No changes are made to old_face and new_face and their edge references must be updated accordingly. Parameters: old_face = [in] Cannot be nullptr. new_face = [in] If new_face is nullptr, old_face is simply removed. Returns: If the replacement was successful, then the m_faces[] array index where old_face/new_face replacement occurred is returned. Otherwise ON_UNSET_UINT_INDEX is returned. Remarks: No modifications are made to old_face or new_face.

◆ SetSharpnessForExperts()

void ON_SubDEdge::SetSharpnessForExperts ( ON_SubDEdgeSharpness  sharpness)

This tool is for expert users and internal use. A collection of ON_SubD::SetEdgeSharpness() functions provide the easiest way to set and change edge sharpness. Set the edge sharpness values to (sharpness[0],sharpness[1]). The interval values must be >= 0 and <= ON_SubDEdgeSharpness::MaximumValue. See ON_SubDEdge::IsSharp() for more information about sharp edges.

Parameters
sharpnessEnd sharpenss values.

◆ Sharpness()

const ON_SubDEdgeSharpness ON_SubDEdge::Sharpness ( bool  bUseCreaseSharpness) const

Get the edge's sharpness. See ON_SubDEdge::IsSharp() for more information about sharp edges.

Parameters
bUseCreaseSharpnessIf the edge is a crease and bUseCreaseSharpness is false, then ON_SubDEdgeSharpness::Smooth is returned. If the edge is a crease and bUseCreaseSharpness is true, then ON_SubDEdgeSharpness::Crease is returned.
Returns
If the edge is smooth, then the sharpness property is returned. If the edge is a crease and bUseCreaseSharpness is true, then ON_SubDEdgeSharpness::Crease is returned. In all other cases, ON_SubDEdgeSharpness::Smooth is returned.

◆ SubdivideSharpness() [1/2]

const ON_SubDEdgeSharpness ON_SubDEdge::SubdivideSharpness ( const class ON_SubDVertex end_vertex,
bool  bReverseSharpness 
) const

Get the edge sharpenss values for the subdivided edge at the specified end of this edge.

Parameters
end_vertexOne of this edge's vertices used to select the subdivided edge.
bReverseSharpnessPass true if this edge and the subdividied edge will have opposite orientations.
Returns
Edge sharpness for the subdivided edge.

◆ SubdivideSharpness() [2/2]

const ON_SubDEdgeSharpness ON_SubDEdge::SubdivideSharpness ( unsigned  evi,
bool  bReverseSharpness 
) const

Get the edge sharpenss values for the subdivided edge at the specified end of this edge.

Parameters
eviSelects the subdivided edge (0 for the left subdivided edge, 1 for the right subdivided edge)
bReverseSharpnessPass true if this edge and the subdividied edge will have opposite orientations.
Returns
Edge sharpness for the subdivided edge.

◆ SubdivisionPoint()

const ON_3dPoint ON_SubDEdge::SubdivisionPoint ( ) const

Get the SubD edge Catmull-Clark subdivision point.

Returns
Catmull-Clark edge subdivision point.

◆ SurfaceBoundingBox()

const ON_BoundingBox ON_SubDEdge::SurfaceBoundingBox ( const ON_SubD subd) const

◆ SurfaceCenterNormal()

const ON_3dVector ON_SubDEdge::SurfaceCenterNormal ( unsigned int  edge_face_index) const

Description: Get the limit surface point location and normal for the edge's midpoint from the limit mesh grid. Parameters: edge - [in] An edge in this SubD. edge_face_index - [in] Index of the face to use for the normal. If the edge is a crease, then each attached face may have a different normal. Pass 0 when in doubt. Returns: A unit normal or ON_3dVector::NanVector if information is not available. Remarks: Requires information created by ON_SubD::UpdateSurfaceMeshCache()

◆ SurfaceCenterPoint()

const ON_3dPoint ON_SubDEdge::SurfaceCenterPoint ( ) const

◆ TaggedEndIndex()

unsigned int ON_SubDEdge::TaggedEndIndex ( ) const

Returns: Set bTagged[i] = m_vertex[0]->IsDartOrCreaseOrCorner(). 0: bTagged[0] is true and bTagged[1] is false. 1: bTagged[0] is false and bTagged[1] is true. 2: bTagged[0] and Tagged[1] are both true. 3: bTagged[0] and Tagged[1] are both false.

◆ TopologyCRC32()

ON__UINT32 ON_SubDEdge::TopologyCRC32 ( bool  bIncludeSubdivisionProperties) const

Get a 32 bit CRC that is useful in detecting when an edge's connections to attached vertices or faces have been changed.

Parameters
bIncludeSubdivisionPropertiesPass true if you want to include nontopological subdivision properties (tags, sharpnesses, control net points) that help determine the edge's subdivision point in the CRC.
Returns
A 32 bit CRC = this->TopologyHash(bIncludeSubdivisionProperties).CRC32(0).

◆ TopologyHash()

const ON_SHA1_Hash ON_SubDEdge::TopologyHash ( bool  bIncludeSubdivisionProperties) const

Get a SHA-1 hash that is useful in detecting when an edge's connections to attached vertices or faces have been changed. See also ON_SubDEdge::TopologyCRC32() which, in practice, is just as reliable as the hash.

Parameters
bIncludeSubdivisionPropertiesPass true if you want to include nontopological subdivision properties (tags, sharpnesses, control net points) that help determine the edge's subdivision point in the hash.
Returns
A SHA-1 hash of the edge's id and the ids of the vertices and faces attached to this edge.

◆ Transform()

bool ON_SubDEdge::Transform ( bool  bTransformationSavedSubdivisionPoint,
const class ON_Xform xform 
)

Description: Apply a tranxfomration matrix to vertex geometry information.

Parameters: bTransformationSavedSubdivisionPoint - [in] If the transformation is being applied to every vertex, edge and face in every level of a subdivision object, and the transformation is an orientation preserving isometry (rotation, translation, ...), then set bTransformationSavedSubdivisionPoint = true to apply the transformation to saved subdivision and saved limit point information. In all other cases, set bTransformationSavedSubdivisionPoint = false and any saved subdivision points or saved limit points will be deleted. When in doubt, pass false.

xform - [in]

◆ UnsetSectorCoefficientsForExperts()

void ON_SubDEdge::UnsetSectorCoefficientsForExperts ( ) const

Description: Expert user tool to unset sector coefficients.

◆ UpdateEdgeSectorCoefficientsForExperts()

bool ON_SubDEdge::UpdateEdgeSectorCoefficientsForExperts ( bool  bUnsetEdgeSectorCoefficientsOnly) const

Description: Expert user tool to set mutable sector coefficients. Returns: True if values were modified.

◆ Vertex()

const class ON_SubDVertex* ON_SubDEdge::Vertex ( unsigned  evi) const

Parameters: evi - [in] 0 or 1 Returns: If evi is 0 or 1, then m_vertex[evi] is returned. Otherwise nullptr is returned.

◆ VertexArrayIndex()

unsigned int ON_SubDEdge::VertexArrayIndex ( const class ON_SubDVertex v) const

◆ VertexCount()

unsigned int ON_SubDEdge::VertexCount ( ) const

Returns: Number of distinct non-nullptr vertices. If the edge is valid, this will be 2.

◆ VertexId()

unsigned int ON_SubDEdge::VertexId ( unsigned  evi) const

Parameters: evi - [in] 0 or 1 Returns: If evi is 0 or 1 and m_vertex[evi] is not nullptr, then m_vertex[evi]->m_id is returned. Otherwise 0 i returned.

◆ Write()

bool ON_SubDEdge::Write ( class ON_BinaryArchive archive) const

Friends And Related Function Documentation

◆ ON_Internal_SubDFaceMeshFragmentAccumulator

friend class ON_Internal_SubDFaceMeshFragmentAccumulator
friend

◆ ON_SubDArchiveIdMap

friend class ON_SubDArchiveIdMap
friend

◆ ON_SubDFace

friend class ON_SubDFace
friend

◆ ON_SubDHeap

friend class ON_SubDHeap
friend

◆ ON_SubDVertex

friend class ON_SubDVertex
friend

Member Data Documentation

◆ Empty

const ON_SubDEdge ON_SubDEdge::Empty
static

◆ m_edge_tag

ON_SubDEdgeTag ON_SubDEdge::m_edge_tag = ON_SubDEdgeTag::Unset

When checking the edge tag, it is important to consider what should happen in the ON_SubDEdgeTag::SmoothX case. It is strongly suggested that you use the member functions ON_SubDEdge::IsSmooth() and ON_SubDEdge::IsCrease() instead of comparing m_edge_tag to ON_SubDEdgeTag values.

◆ m_face2

ON_SubDFacePtr ON_SubDEdge::m_face2[2] = {}

◆ m_face_count

unsigned short ON_SubDEdge::m_face_count = 0

◆ m_facex

ON_SubDFacePtr* ON_SubDEdge::m_facex = nullptr

◆ m_facex_capacity

unsigned short ON_SubDEdge::m_facex_capacity = 0

◆ m_next_edge

const class ON_SubDEdge* ON_SubDEdge::m_next_edge = nullptr

linked list of edges on this level

◆ m_prev_edge

const class ON_SubDEdge* ON_SubDEdge::m_prev_edge = nullptr

m_prev_edge, m_next_edge must be the first data members of ON_SubDEdge

linked list of edges on this level

◆ m_sector_coefficient

double ON_SubDEdge::m_sector_coefficient[2] = {}
mutable

NOTE: The sector coefficient is a property of a smooth edge end that is constant throughout subdivision. It exists at ends of smooth edges that are attached to dart, crease, or corner vertices. In all other cases the sector coefficient is ignored. In particular crease edges and the ends of smooth edges attached to smooth vertices do not have a sector coefficient.

The ON_SubDSectorType class provides three static functions that calculate sector coefficients: ON_SubDSectorType::DartSectorCoefficient() ON_SubDSectorType::CreaseSectorCoefficient() ON_SubDSectorType::CornerSectorCoefficient()

If the value of vertex->m_vertex_tag is not ON_SubDVertexTag::Smooth, then that vertex is "tagged".

If the value of m_edge_tag is ON_SubDEdgeTag::Crease, then m_sector_coefficient[] should be {0,0}.
In any case m_sector_coefficient[] values are ignored and the midpoint of the edge is the location of the edge.s subdivision point. The edge's subdivision vertex will be tagged as ON_SubDVertexTag::Crease and both subdivision edges will be tagged as ON_SubDEdgeTag::Crease.

If the value of m_edge_tag is ON_SubDEdgeTag::Smooth and neither end vertex is tagged, then m_sector_coefficient[] should be {0,0}.
In any case m_sector_coefficient[] values are ignored on smooth edges with smooth vertices at both ends. The edge's subdivision vertex will be tagged as ON_SubDVertexTag::Smooth and both subdivision edges will be tagged as ON_SubDEdgeTag::Smooth.

If the value of m_edge_tag is ON_SubDEdgeTag::Smooth and exactly one end vertex is tagged, then the m_sector_coefficient[] value for the tagged end is calculated by ON_SubDSectorType::SectorCoefficient(). tagged_coefficient*tagged_vertex + (1.0 - tagged_coefficient)*untagged_vertex is used when combining the edge ends. The edge's subdivision vertex will be tagged as ON_SubDVertexTag::Smooth and both subdivision edges will be tagged as ON_SubDEdgeTag::Smooth.

If the value of m_edge_tag is ON_SubDEdgeTag::SmoothX, then the edge must have exactly two neighboring faces, both vertices must be tagged and the m_sector_coefficient[] values are calculated by ON_SubDSectorType::SectorCoefficient(). When the edge is subdivided, the midpoint of the edge is the location of the edge.s subdivision point. The edge's subdivision vertex will be tagged as ON_SubDVertexTag::Smooth and both subdivision edges will be tagged as ON_SubDEdgeTag::Smooth.

If the value of m_edge_tag is ON_SubDEdgeTag::Smooth and both end vertices are tagged, that is a severe error condition and the edge is subdivided at its midpoint.

If the value of m_edge_tag is ON_SubDEdgeTag::SmoothX and both end vertices are not tagged, that is a severe error condition and the edge is subdivided at its midpoint.

m_sector_coefficient[tagged_end] = 1/2 + 1/3*cos(theta_k) where "theta_k" is the tagged end's "theta_k", which depends on the vertex tag (dart/crease/corner), the number of faces k in the sector, and the control net crease angle alpha when the tagged end is a corner. Dart: theta_k = 2 * Pi / k Crease: theta_k = Pi / k Corner: theta_k = alpha / k

The name "sector coefficient" is used because the value is a property of the vertex's sector (every smooth edge inside a vertex sector has the same value at the tagged vertex). The sector coefficient does not change which a subdivision is applied.


2022-02-09, Pierre C, RH-67377

Wrong values in 3dm files created by OpenNURBS 7.16 and before, fixed in 7.17.

Since 2015-02-20, ON_SubDSectorType::CornerSectorThetaFromCornerAngle(unsigned int sector_face_count, double corner_sector_angle_radians) had been incorrectly computing theta as: corner_sector_theta = corner_sector_angle_radians / (2 * sector_face_count) instead of: corner_sector_theta = corner_sector_angle_radians / sector_face_count.

This is fixed as of Rhino 7.17, but 3dm files created before this version saved the incorrect value.

This changes the coefficients saved in the SubD edge, and in the 3dm files. Rhino recomputes all m_sector_coefficients cached in the SubD edges when adding a SubD to a document, so all values are now correct. This changes SubD subdivision, meshing, limit surface, and limit point editing results, for SubDs that have a smooth edge connected to a corner vertex.

If you are using this value from a SubD in a 3dm file created by Rhino 7.16 or earlier, without adding the SubD to a Rhino document using CRhinoSubDObject::SetSubD(ON_SubDRef subd_ref), you need to recompute all sector coefficients using subd->UpdateAllTagsAndSectorCoefficients(true);

◆ m_vertex

const class ON_SubDVertex* ON_SubDEdge::m_vertex[2] = {}

m_vertex[0] = vertex at the start of the edge. m_vertex[1] = vertex at the end of the edge.