libgenua
Basic Geometry, Numerical Algorithms and Interfaces
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TriFace Class Reference

Detailed Description

Triangular face of a TriMesh.

TriFace objects represent the linear triangular faces used by class TriMesh.

See Also
TriMesh, TriEdge

#include <triface.h>

Collaboration diagram for TriFace:
[legend]

Public Member Functions

 TriFace ()
 construct unconnected face
 
 TriFace (const TriMesh *m, uint a, uint b, uint c)
 construct connected face
 
void assign (const TriMesh *m, uint a, uint b, uint c)
 set mesh and vertices
 
bool isValid () const
 check if all three vertices are distinct
 
bool inRange () const
 check if vertex indices are in range
 
void invalidate ()
 make triangle invalid, to force elimination by TriMesh::fixate()
 
const TriMeshmesh () const
 access mesh
 
const uint * vertices () const
 access vertices
 
uint * vertices ()
 access vertices
 
void getVertices (uint *vi) const
 copy vertex indices
 
uint opposed (const TriEdge &e) const
 find vertex opposed to edge ei
 
void bind (const TriMesh *m, uint off=0)
 rebind to different mesh and offset vertex indices
 
void reverse ()
 flip normal direction
 
void itranslate (const Indices &repl)
 translate vertex indices
 
uint replace (uint iold, uint inew)
 replace a single vertex index, fix ordering
 
Vct3 eval (Real up, Real vp) const
 compute point on triangle
 
Vct3 center () const
 compute triangle center
 
Vct3 normal () const
 compute normal vector (not normalized)
 
Real area () const
 compute area
 
Real normal (Vct3 &nrm) const
 compute normalized normal, return area
 
Real corner (uint i) const
 compute the internal angle at vertex i
 
Real solidAngle (uint idx) const
 compute solid angle with respect to vertex idx
 
void edgeLengths (Vct3 &elen) const
 compute the length of all three edges
 
Vct3 project (const Vct3 &pt) const
 project, return parameters and signed distance to projection
 
Vct3 pierce (const Vct3 &a, const Vct3 &b) const
 
Find the point where a line (a-b) would pierce this face, return the

projection parameter (u,v,t). More...

 
Real minDistance (const Vct3 &pt, Vct2 &foot) const
 return minimum signed distance of pt to this triangle, set foot point parameter
 
bool intersect (const Plane &pln, Vct3 &src, Vct3 &trg) const
 Determine intersection segment with plane pln.
 
void gradient (Mtx33 &gm) const
 Gradient. More...
 
Vct3 gradient (const Vector &x) const
 Computes the surface gradient of the scalar property in x.
 
CpxVct3 gradient (const CpxVector &x) const
 Computes the surface gradient of the scalar property in x.
 
void xIntegrate (const Vector &p, const Vct3 &ref, Vct3 &pn, Vct3 &rxpn) const
 surface integration, add int(p*n dA) and int(r x pn dA) to sums
 
Real dotIntegrate (const Vector &p, const PointList< 3 > &z) const
 surface integration, return int( dot(pn,z) dA )
 
bool operator< (const TriFace &a) const
 sorting criterion
 
bool operator== (const TriFace &a) const
 equivalence
 
bool equivalent (const TriFace &a) const
 equivalent, but possibly flipped
 
bool operator!= (const TriFace &a) const
 difference
 
int tag () const
 access tag value
 
void tag (int t)
 change tag value
 
uint64_t hash () const
 compute a hash value
 

Protected Member Functions

void order (uint a, uint b, uint c)
 set vertices in correct order
 

Protected Attributes

uint v [3]
 vertex indices
 
int ftag
 marker tag
 
const TriMeshmsh
 connected mesh
 

Member Function Documentation

void TriFace::gradient ( Mtx33 gm) const

Gradient.

Computes the matrix relating a scalar property associated to the vertices to its gradient in global 3D coordinates.

Vct3 TriFace::pierce ( const Vct3 a,
const Vct3 b 
) const

Find the point where a line (a-b) would pierce this face, return the

projection parameter (u,v,t).

The point is inside the face if u,v,w are within (0,1) where w = 1-u-v. (t) is the line parameter.


The documentation for this class was generated from the following files: