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

#include <opennurbs_intersect.h>

Public Types

enum  HitType : int { NoHit = 0, Point = 1, Overlap = 2 }
 
enum  IncidenceType : int { Face = 0, Edge = 1, Vertex = 2 }
 

Static Public Member Functions

static int CompareByT (const ON_CurveMeshHit *a, const ON_CurveMeshHit *b)
 Sort comparator: orders hits by the start of the parameter interval (m_t[0]). More...
 

Public Attributes

ON_3dVector m_barycentric [2] = { ON_3dVector::ZeroVector, ON_3dVector::ZeroVector }
 
double m_barycentric_tolerance = 0
 
int m_face_index = -1
 
int m_face_indices_count = 0
 
int m_face_indices_offset = -1
 
int m_face_triangle_index = 0
 Sub-triangle of m_face_index: 0 for triangle faces, 0 or 1 for the two halves of a quad face. More...
 
IncidenceType m_incidence = Face
 
bool m_on_boundary = false
 True iff this hit lies on a mesh-level boundary (m_incidence is Edge or Vertex). More...
 
ON_3dPoint m_point [2] = { ON_3dPoint::Origin, ON_3dPoint::Origin }
 
double m_point_tolerance = 0
 
double m_t [2] = { 0, 0 }
 
double m_t_tolerance = 0
 
HitType m_type = NoHit
 

Detailed Description

===================================================================================== Tolerance-bounded curve-mesh intersection events.

Each hit is either a single point crossing (Point) or a parameter range over which the curve lies in a face's plane (Overlap). For Point, m_t[0] and m_t[1] are equal and the point slots are equal. For Overlap, m_t[0] < m_t[1] and m_point[0..1] are the curve points at the endpoints of the overlap on the curve.

Emission contract: every overlap is reported as TWO Point events (one at each endpoint of the overlap span) plus ONE Overlap event for the span itself. The two endpoint Points are emitted whether or not overlaps are requested; the includeOverlaps flag controls only whether the Overlap span event is also emitted. Disabling overlaps therefore keeps the endpoint Points (the curve's plane entry/exit crossings) and drops only the span body.

Each *_tolerance field bounds its value: the true value lies inside

[value - tolerance, value + tolerance].

Member Enumeration Documentation

◆ HitType

Enumerator
NoHit 
Point 
Overlap 

◆ IncidenceType

The kind of mesh feature this hit lies on, determined by mesh topology after dedup. Face means strictly inside a face (including the internal diagonal of a quad split, which is not a real mesh edge). Edge means on a mesh edge shared by 2+ faces (or a 1-valence mesh boundary edge). Vertex means at a mesh topology vertex.

Enumerator
Face 
Edge 
Vertex 

Member Function Documentation

◆ CompareByT()

static int ON_CurveMeshHit::CompareByT ( const ON_CurveMeshHit a,
const ON_CurveMeshHit b 
)
static

Sort comparator: orders hits by the start of the parameter interval (m_t[0]).

Member Data Documentation

◆ m_barycentric

ON_3dVector ON_CurveMeshHit::m_barycentric[2] = { ON_3dVector::ZeroVector, ON_3dVector::ZeroVector }

◆ m_barycentric_tolerance

double ON_CurveMeshHit::m_barycentric_tolerance = 0

◆ m_face_index

int ON_CurveMeshHit::m_face_index = -1

Canonical mesh face for this hit (lowest face index when multiple faces share the incidence; index into ON_Mesh::m_F).

◆ m_face_indices_count

int ON_CurveMeshHit::m_face_indices_count = 0

◆ m_face_indices_offset

int ON_CurveMeshHit::m_face_indices_offset = -1

When an incidence is shared by multiple faces (curve crossing a mesh edge or vertex), the full list of participating face indices is written to the optional side-band pool returned from TL_CurveMeshIntersect. m_face_indices_offset is the position in the pool where this hit's face list starts; m_face_indices_count is its length. The canonical m_face_index is included in the list.

For face-interior hits, hits on a mesh boundary edge (1-valence), or when the caller omitted the pool, only m_face_index applies: m_face_indices_offset = -1, m_face_indices_count = 0.

◆ m_face_triangle_index

int ON_CurveMeshHit::m_face_triangle_index = 0

Sub-triangle of m_face_index: 0 for triangle faces, 0 or 1 for the two halves of a quad face.

◆ m_incidence

IncidenceType ON_CurveMeshHit::m_incidence = Face

◆ m_on_boundary

bool ON_CurveMeshHit::m_on_boundary = false

True iff this hit lies on a mesh-level boundary (m_incidence is Edge or Vertex).

◆ m_point

ON_3dPoint ON_CurveMeshHit::m_point[2] = { ON_3dPoint::Origin, ON_3dPoint::Origin }

◆ m_point_tolerance

double ON_CurveMeshHit::m_point_tolerance = 0

◆ m_t

double ON_CurveMeshHit::m_t[2] = { 0, 0 }

◆ m_t_tolerance

double ON_CurveMeshHit::m_t_tolerance = 0

◆ m_type

HitType ON_CurveMeshHit::m_type = NoHit