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

#include <opennurbs_mesh.h>

Public Member Functions

bool ComputeFaceNormal (const class ON_3dPointListRef &vertex_list, ON_3dVector &FN) const
 
bool ComputeFaceNormal (const ON_3dPoint *dV, ON_3dVector &FN) const
 
bool ComputeFaceNormal (const ON_3fPoint *fV, ON_3dVector &FN) const
 
void Flip ()
 
unsigned int GetCornerNormals (const class ON_3dPointListRef &vertex_list, ON_3dVector corner_normals[4]) const
 
bool GetPlaneEquation (const class ON_3dPointListRef &vertex_list, ON_PlaneEquation &face_plane_equation) const
 
bool IsPlanar (double planar_tolerance, double angle_tolerance_radians, const class ON_3dPointListRef &vertex_list, ON_PlaneEquation *face_plane_equation) const
 
bool IsQuad () const
 
bool IsTriangle () const
 
bool IsValid (int mesh_vertex_count) const
 
bool IsValid (int mesh_vertex_count, const ON_3dPoint *V) const
 
bool IsValid (int mesh_vertex_count, const ON_3fPoint *V) const
 
bool IsValid (unsigned int mesh_vertex_count) const
 
bool Repair (int mesh_vertex_count)
 
bool Repair (int mesh_vertex_count, const ON_3dPoint *V)
 
bool Repair (int mesh_vertex_count, const ON_3fPoint *V)
 

Public Attributes

int vi [4]
 vertex index - vi[2]==vi[3] for triangles More...
 

Static Public Attributes

static const ON_MeshFace UnsetMeshFace
 all vi[] values are -1. More...
 

Member Function Documentation

◆ ComputeFaceNormal() [1/3]

bool ON_MeshFace::ComputeFaceNormal ( const class ON_3dPointListRef vertex_list,
ON_3dVector FN 
) const

◆ ComputeFaceNormal() [2/3]

bool ON_MeshFace::ComputeFaceNormal ( const ON_3dPoint dV,
ON_3dVector FN 
) const

Description: Compute the face normal Parameters: dV - [in] double precision vertex array for the mesh fV - [in] float precision vertex array for the mesh FN - [out] face normal Returns: true if FN is valid.

◆ ComputeFaceNormal() [3/3]

bool ON_MeshFace::ComputeFaceNormal ( const ON_3fPoint fV,
ON_3dVector FN 
) const

◆ Flip()

void ON_MeshFace::Flip ( )

Description: Reverses the order of the vertices in v[]. vi[0] is not changed.

◆ GetCornerNormals()

unsigned int ON_MeshFace::GetCornerNormals ( const class ON_3dPointListRef vertex_list,
ON_3dVector  corner_normals[4] 
) const

Description: Get corner normals. Parameters: vertex_list - [in] corner_normals[4] - [out] For a triangle, all values are identical. If a corner normal cannot be calculated, ON_3dVector::UnsetVector is returned. Returns: Number of corner normals that are valid.

◆ GetPlaneEquation()

bool ON_MeshFace::GetPlaneEquation ( const class ON_3dPointListRef vertex_list,
ON_PlaneEquation face_plane_equation 
) const

◆ IsPlanar()

bool ON_MeshFace::IsPlanar ( double  planar_tolerance,
double  angle_tolerance_radians,
const class ON_3dPointListRef vertex_list,
ON_PlaneEquation face_plane_equation 
) const

Parameters: planar_tolerance - [in] If planar_tolerance >= 0 and (maximum plane equation value - minimum plane equation value) > planar_tolerance, then false is returned. angle_tolerance_radians - [in] If angle_tolerance_radians >= 0.0 and the angle between opposite corner normals is > angle_tolerance_radians, then false is returned. A corner normal is the normal to the triangle formed by two adjacent edges and the diagonal connecting their endpoints. A quad has four corner normals. Passing in ON_PI/2 is a good way will result in false being returned for non-convex quads face_plane_equation - [out] If not null, the equation used to test planarity is returned here. Returns: True if the face is planar

◆ IsQuad()

bool ON_MeshFace::IsQuad ( ) const

Returns: True if vi[2] != vi[3]; Remarks: Assumes the face is valid.

◆ IsTriangle()

bool ON_MeshFace::IsTriangle ( ) const

Returns: True if vi[2] == vi[3]; Remarks: Assumes the face is valid.

◆ IsValid() [1/4]

bool ON_MeshFace::IsValid ( int  mesh_vertex_count) const

Description: Determine if a face is valid by checking that the vertices are distinct. Parameters: mesh_vertex_count - [in] number of vertices in the mesh V - [in] optional array of mesh_vertex_count vertex locations. Returns: true The face is valid. false The face is not valid. It may be possible to repair the face by calling ON_MeshFace::Repair().

◆ IsValid() [2/4]

bool ON_MeshFace::IsValid ( int  mesh_vertex_count,
const ON_3dPoint V 
) const

◆ IsValid() [3/4]

bool ON_MeshFace::IsValid ( int  mesh_vertex_count,
const ON_3fPoint V 
) const

◆ IsValid() [4/4]

bool ON_MeshFace::IsValid ( unsigned int  mesh_vertex_count) const

◆ Repair() [1/3]

bool ON_MeshFace::Repair ( int  mesh_vertex_count)

Description: If IsValid() returns false, then you can use Repair() to attempt to create a valid triangle. Parameters: mesh_vertex_count - [in] number of vertices in the mesh V - [in] optional array of mesh_vertex_count vertex locations. Returns: true repair was successful and v[0], v[1], vi[2] have distinct valid values and v[2] == v[3]. false this face's vi[] values cannot be repaired

◆ Repair() [2/3]

bool ON_MeshFace::Repair ( int  mesh_vertex_count,
const ON_3dPoint V 
)

◆ Repair() [3/3]

bool ON_MeshFace::Repair ( int  mesh_vertex_count,
const ON_3fPoint V 
)

Member Data Documentation

◆ UnsetMeshFace

const ON_MeshFace ON_MeshFace::UnsetMeshFace
static

all vi[] values are -1.

◆ vi

int ON_MeshFace::vi[4]

vertex index - vi[2]==vi[3] for triangles