Rhino C++ API  8.6
Public Member Functions | Public Attributes | List of all members
ON_MESH_POINT Class Reference

#include <opennurbs_plus_x.h>

Public Member Functions

 ON_MESH_POINT ()
 
bool GetTriangle (int &idxA, int &idxB, int &idxC) const
 
bool GetTriangle (ON_3dPoint &ptA, ON_3dPoint &ptB, ON_3dPoint &ptC) const
 
bool IsValid (ON_TextLog *text_log) const
 
bool SetEdgePoint (const ON_Mesh *mesh, int fi, int ei, double et)
 
bool SetFacePoint (const class ON_Mesh *mesh, int fi, const double t[4])
 
ON_COMPONENT_INDEX SetTopologyComponentIndex (double *edge_parameter)
 

Public Attributes

ON_COMPONENT_INDEX m_ci
 
int m_edge_index
 
double m_et
 m_et = edge parameter when m_ci refers to an edge. More...
 
int m_face_index
 
const ON_Meshm_mesh
 
const class ON_MeshTreeNodem_mnode
 can be null More...
 
ON_3dPoint m_P
 3d location More...
 
unsigned int m_sn
 ON_MESH_POINT serial number. More...
 
double m_t [4]
 
char m_Triangle
 

Constructor & Destructor Documentation

◆ ON_MESH_POINT()

ON_MESH_POINT::ON_MESH_POINT ( )

Member Function Documentation

◆ GetTriangle() [1/2]

bool ON_MESH_POINT::GetTriangle ( int &  idxA,
int &  idxB,
int &  idxC 
) const

Gets the mesh face indices of the triangle where the intersection is on the face takes into consideration the way the quad was split during the intersection

◆ GetTriangle() [2/2]

bool ON_MESH_POINT::GetTriangle ( ON_3dPoint ptA,
ON_3dPoint ptB,
ON_3dPoint ptC 
) const

◆ IsValid()

bool ON_MESH_POINT::IsValid ( ON_TextLog text_log) const

◆ SetEdgePoint()

bool ON_MESH_POINT::SetEdgePoint ( const ON_Mesh mesh,
int  fi,
int  ei,
double  et 
)

Description: Sets the m_mesh, m_et, m_ci, m_edge_index, m_face_index, m_t, and m_P fields. Parameters: m_mesh - [in] fi - [in] index of the face the topology's m_topf[] array (which is parallel to the mesh's m_F[] array) ei - [in] index of edge in the topology's m_tope[] array et - [in] edge parameter 0.0 <= et <= 1.0 Returns: True if the input is valid and the fields are set. Calling SetEdgePoint with ei == 0 or ei == 1.0 will set ON_MESH_POINT::m_ci.m_type to ON_COMPONENT_INDEX::meshtop_vertex and ON_MESH_POINT::m_ci.m_index to the mesh topology vertex index of the vertex at the start or end of the edge.

◆ SetFacePoint()

bool ON_MESH_POINT::SetFacePoint ( const class ON_Mesh mesh,
int  fi,
const double  t[4] 
)

Description: Sets the m_mesh, m_et, m_ci, m_edge_index, m_face_index, m_t, and m_P fields. Parameters: m_mesh - [in] fi - [in] index of the face t - [in] barycentric coordinates of the point. All t[i] must be >= 0.0, <= 1.0, and t[0]+t[1]+t[2]+t[3] must be within ON_ZERO_TOLERANCE of 1.0. Returns: True if the input is valid and the fields are set. Remarks: Calling SetFacePoint with 1 non-zero barycentric coordinate will set ON_MESH_POINT::m_ci.m_type to ON_COMPONENT_INDEX::meshtop_vertex and ON_MESH_POINT::m_ci.m_index to the mesh topology vertex index of the vertex at the referenced corner of the face. And will set m_edge_index to the mesh topology index of the edge preceding that vertex and will set m_et to 0.0 or 1.0

◆ SetTopologyComponentIndex()

ON_COMPONENT_INDEX ON_MESH_POINT::SetTopologyComponentIndex ( double *  edge_parameter)

Description: Set the topological component of the this mesh point. Parameters: edge_parameter - [out] optional - can be nullptr If the component is an edge, then *edge_parameter is set (0 < *edge_parameter < 1). If the component is not an edge, then *edge_parameter is set to ON_UNSET_VALUE. Returns: Component index of the topological component.

Member Data Documentation

◆ m_ci

ON_COMPONENT_INDEX ON_MESH_POINT::m_ci

◆ m_edge_index

int ON_MESH_POINT::m_edge_index

The constructor sets m_edge_index and m_face_index to -1, however when ON_MESH_POINT is used in an ON_SimpleArray<>, unused points will have a "default" values of 0.

When set, m_edge_index is an index of an edge in m_mesh->Topology().m_tope[] and m_face_index is an index of a face in m_mesh->Topology().m_topf[]. The the m_mesh->Topology().m_topf[] and m_mesh->m_F[] arrays are parallel, m_face_index is also the index of the face in m_mesh->m_F[].

The m_face_index field must always be set. When m_ci refers to a vertex, any face that uses the vertex may appear as m_face_index. When m_ci refers to an edge or m_edge_index is set, then any face that uses that edge may appear as m_face_index.

◆ m_et

double ON_MESH_POINT::m_et

m_et = edge parameter when m_ci refers to an edge.

◆ m_face_index

int ON_MESH_POINT::m_face_index

◆ m_mesh

const ON_Mesh* ON_MESH_POINT::m_mesh

◆ m_mnode

const class ON_MeshTreeNode* ON_MESH_POINT::m_mnode

can be null

◆ m_P

ON_3dPoint ON_MESH_POINT::m_P

3d location

◆ m_sn

unsigned int ON_MESH_POINT::m_sn

ON_MESH_POINT serial number.

◆ m_t

double ON_MESH_POINT::m_t[4]

Barycentric quad coordinates for the point m_P on the mesh face m_mesh->m_F[m_face_index] If the face is a triangle disregard m_t3.

If the face is a quad and is split between vertices 0 and 2, then m_t[3] will be 0.0 when m_P is on the triangle defined by vi[0], vi[1], vi[2], and m_t[1] will be 0.0 when m_P is on the triangle defined by vi[0], vi[2], vi[3].

If the face is a quad and is split between vertices 1 and 3, then m_t[2] will be 0.0 when m_P is on the triangle defined by vi[0], vi[1], vi[3], and m_t[0] will be 0.0 when m_P is on the triangle defined by vi[1], vi[2], vi[3].

◆ m_Triangle

char ON_MESH_POINT::m_Triangle

Face triangle where the intersection takes place; 0 is unset A is 0,1,2 B is 0,2,3 C is 0,1,3 D is 1,2,3