KrisLibrary  1.0.0
Meshing.h
Go to the documentation of this file.
1 #ifndef MESHING_UTILS_H
2 #define MESHING_UTILS_H
3 
4 #include "TriMeshTopology.h"
5 #include <KrisLibrary/math3d/Triangle2D.h>
6 
7 namespace Meshing
8 {
9 using namespace Math3D;
10 using namespace std;
11 
23 {
25  void Split(const Plane3D& p);
26 
27  TriMeshWithTopology& mesh;
28  vector<bool> positive;
29  vector<int> origTri;
30  Real tol;
31  bool deleteNegative;
32 
33  //temp
34  //list of distances
35  vector<Real> d;
36  //for each triangle, list of (edge#,vert) for newly added vertex
37  vector<vector<pair<int,int> > > newVerts;
38 };
39 
47 
57 int SplitTriangle(const Triangle3D& t,const Plane3D& p,Vector3 newPts[2],IntTriple newTris[3],bool triPositive[3],Real tol);
58 int SplitTriangle(const Triangle2D& t,const Plane2D& p,Vector2 newPts[2],IntTriple newTris[3],bool triPositive[3],Real tol);
59 void GetCoplanarTris(const TriMesh& mesh,int t,Real tol,vector<int>& tris);
60 void GetConnectedCoplanarTris(const TriMeshWithTopology& mesh,int t,Real tol,vector<int>& tris);
61 //void GetConnectedCoplanarTris(const TriMeshWithTopology& mesh,int t,Real tol,PolygonWithHoles2D& poly);
62 
65 } //namespace Meshing;
66 
67 #endif
A lightweight integer 3-tuple class.
Definition: IntTriple.h:9
The namespace for all classes/functions in the Meshing package.
Definition: AnyGeometry.h:10
A 3D plane classRepresents plane with a normal and offset such that x on the plane satisfy dot(normal...
Definition: Plane3D.h:19
A 3D vector class.
Definition: math3d/primitives.h:136
A 2D triangle class.
Definition: Triangle2D.h:25
A triangle mesh that contains connectivity relations between vertices and triangles.
Definition: TriMeshTopology.h:31
Definition: rayprimitives.h:132
A class that allows incremental plane-splitting of a triangle mesh.
Definition: Meshing.h:22
Contains all the definitions in the Math3D package.
Definition: AnyGeometry.h:12
A 2D plane classRepresents plane with a normal and offset such that x on the plane satisfy dot(normal...
Definition: Plane2D.h:20
A 3D triangle class.
Definition: Triangle3D.h:26
A basic triangle mesh.
Definition: TriMesh.h:41
A 2D vector class.
Definition: math3d/primitives.h:41
int SplitTriangle(const Triangle3D &_t, const Plane3D &p, Vector3 newPts[2], IntTriple newTris[3], bool triPositive[3], Real tol)
Splits the triangle t by the plane p. Returns the number of resulting triangles (up to 3)...
Definition: Meshing.cpp:72