1 #ifndef MESHING_TRI_MESH_OPERATORS_H 2 #define MESHING_TRI_MESH_OPERATORS_H 4 #include "TriMeshTopology.h" 5 #include <KrisLibrary/utils/IntPair.h> 6 #include <KrisLibrary/errors.h> 26 Real cosa = e1.dot(e2)/(ne1*ne2);
27 return Acos(
Clamp(cosa,-One,One));
33 int vindex=mesh.tris[t].getIndex(v);
35 int eccw=(vindex+1)%3;
42 int vindex=mesh.tris[t].getIndex(v);
51 int vindex=mesh.tris[t].getIndex(v);
53 int eccw=(vindex+1)%3;
61 int vindex=mesh.tris[t].getIndex(v);
63 int eccw=(vindex+2)%3;
64 return mesh.tris[t][eccw];
70 int vindex=mesh.tris[t].getIndex(v);
73 return mesh.tris[t][ecw];
79 int vindex=mesh.tris[t].getIndex(v);
81 int eccw=(vindex+2)%3;
83 return IntPair(mesh.tris[t][eccw],mesh.tris[t][ecw]);
101 if(n.a < 0 || n.b < 0)
return true;
bool IncidentTriangleOrdering(const TriMeshWithTopology &mesh, int v, vector< list< int > > &triStrips)
Returns true if the vertex is a boundary vertex.
Definition: TriMeshOperators.cpp:13
IntPair AdjacentVertices(const TriMeshWithTopology &mesh, int t, int v)
Returns the vertices on t adjacent to v in (CCW,CW) order.
Definition: TriMeshOperators.h:77
The namespace for all classes/functions in the Meshing package.
Definition: AnyGeometry.h:11
A 3D vector class.
Definition: math3d/primitives.h:136
A triangle mesh that contains connectivity relations between vertices and triangles.
Definition: TriMeshTopology.h:31
int CCWAdjacentVertex(const TriMeshWithTopology &mesh, int t, int v)
Returns the vertex adjacent to v on the CCW side of t.
Definition: TriMeshOperators.h:59
A lightweight integer 2-tuple class.
Definition: IntPair.h:9
bool BoundaryVertex(const TriMeshWithTopology &mesh, int v)
Returns true if the vertex is a boundary vertex.
Definition: TriMeshOperators.h:94
bool FuzzyZero(double a, double eps=dEpsilon)
Returns true if a is zero within +/- eps.
Definition: math.h:224
IntPair Neighbors(const TriMeshWithTopology &mesh, int t, int v)
Returns the (CCW neighbor,CW neighbor) of t about v.
Definition: TriMeshOperators.h:49
int CWNeighbor(const TriMeshWithTopology &mesh, int t, int v)
Returns the triangle neighboring t CW about v.
Definition: TriMeshOperators.h:40
int ApproximateShrink(TriMeshWithTopology &mesh, Real amount, bool mergeFirst)
Definition: TriMeshOperators.cpp:260
Real VertexGaussianCurvature(const TriMeshWithTopology &mesh, int v)
Definition: TriMeshOperators.cpp:60
vector< TriNeighbors > triNeighbors
neighboring triangles of triangles
Definition: TriMeshTopology.h:59
void MergeVertices(TriMesh &mesh, Real tolerance, bool dropDegenerate)
Definition: TriMeshOperators.cpp:200
bool FloatingVertex(const TriMeshWithTopology &mesh, int v)
Returns true if the vertex is "floating".
Definition: TriMeshOperators.h:87
double Clamp(double x, double a, double b)
Returns a if x < a, b if x > b, otherwise x.
Definition: math.h:209
int CCWNeighbor(const TriMeshWithTopology &mesh, int t, int v)
Returns the triangle neighboring t CCW about v.
Definition: TriMeshOperators.h:31
int CWAdjacentVertex(const TriMeshWithTopology &mesh, int t, int v)
Returns the vertex adjacent to v on the CCW side of t.
Definition: TriMeshOperators.h:68
A 3D triangle class.
Definition: Triangle3D.h:26
Real Angle(const Vector3 &e1, const Vector3 &e2)
Returns the angle between two vectors.
Definition: TriMeshOperators.h:21
A basic triangle mesh.
Definition: TriMesh.h:41
Real VertexAbsMeanCurvature(const TriMeshWithTopology &mesh, int v)
Definition: TriMeshOperators.cpp:115
void GetTriangle(int tri, Triangle3D &t) const
Returns a Triangle3D structure for triangle tri.
Definition: TriMesh.cpp:35
vector< vector< int > > incidentTris
triangles incident on vertices
Definition: TriMeshTopology.h:58