KrisLibrary  1.0.0
MeshPrimitives.h
Go to the documentation of this file.
1 #ifndef MESHING_PRIMITIVES_H
2 #define MESHING_PRIMITIVES_H
3 
4 #include "TriMesh.h"
5 
6 namespace Math3D {
7  struct AABB3D;
8  struct Box3D;
9  struct Sphere3D;
10  struct Ellipsoid3D;
11  struct Cylinder3D;
12  struct Polygon3D;
13  class GeometricPrimitive3D;
14 } //namespace Math3D
15 
21 namespace Meshing {
22 
25 
27 void MakeTriPlane(int m,int n,TriMesh& mesh);
29 void MakeTriPlane(int m,int n,Real x,Real y,TriMesh& mesh);
30 
32 void MakeTriCube(int m,int n,int p,TriMesh& mesh);
34 void MakeTriBox(int m,int n,int p,Real x,Real y,Real z,TriMesh& mesh);
35 
37 void MakeTriCenteredCube(int m,int n,int p,TriMesh& mesh);
39 void MakeTriCenteredBox(int m,int n,int p,Real x,Real y,Real z,TriMesh& mesh);
40 
42 void MakeTriSphere(int numStacks,int numSlices,TriMesh& mesh);
44 void MakeTriSphere(int numStacks,int numSlices,Real r,TriMesh& mesh);
45 
47 void MakeTriCone(int numSlices,TriMesh& mesh);
49 void MakeTriCone(int numSlices,Real h,Real rbase,TriMesh& mesh);
50 
52 void MakeTriCylinder(int numSlices,TriMesh& mesh);
54 void MakeTriCylinder(int numSlices,Real h,Real rbase,TriMesh& mesh);
55 
57 void MakeTriMesh(const Sphere3D& geom,int numStacks,int numSlices,TriMesh& mesh);
59 void MakeTriMesh(const Triangle3D& geom,TriMesh& mesh);
61 void MakeTriMesh(const AABB3D& geom,TriMesh& mesh);
63 void MakeTriMesh(const Box3D& geom,TriMesh& mesh);
65 void MakeTriMesh(const Ellipsoid3D& geom,int numStacks,int numSlices,TriMesh& mesh);
67 void MakeTriMesh(const Cylinder3D& geom,int numSlices,TriMesh& mesh);
69 void MakeTriMesh(const Polygon3D& geom,TriMesh& mesh);
70 
72 void MakeTriMesh(const GeometricPrimitive3D& geom,TriMesh& mesh,int numDivs = 32);
73 
75 } //namespace Meshing
76 
77 #endif
The namespace for all classes/functions in the Meshing package.
Definition: AnyGeometry.h:10
void MakeTriBox(int m, int n, int p, Real x, Real y, Real z, TriMesh &mesh)
makes a [x,y,z] sized box with m,n,p divisions in the x,y,z directions
Definition: MeshPrimitives.cpp:53
void MakeTriCube(int m, int n, int p, TriMesh &mesh)
makes a unit cube with m,n,p divisions in the x,y,z directions
Definition: MeshPrimitives.cpp:48
void MakeTriCone(int numSlices, TriMesh &mesh)
makes a unit height cone with unit base radius (base at origin, tip pointing in z direction) ...
Definition: MeshPrimitives.cpp:196
void MakeTriCenteredCube(int m, int n, int p, TriMesh &mesh)
makes a unit cube centered at 0 with m,n,p divisions in the x,y,z directions
Definition: MeshPrimitives.cpp:121
Contains all the definitions in the Math3D package.
Definition: AnyGeometry.h:12
void MakeTriCylinder(int numSlices, TriMesh &mesh)
makes a unit height cylinder with unit base radius (centered at origin, extending in z direction) ...
Definition: MeshPrimitives.cpp:228
void MakeTriSphere(int numStacks, int numSlices, TriMesh &mesh)
makes a unit sphere with the given stacks and slices (axis in z direction)
Definition: MeshPrimitives.cpp:134
void MakeTriPlane(int m, int n, TriMesh &mesh)
makes a unit square on z=0 with m,n divisions in the x,y directions
Definition: MeshPrimitives.cpp:9
void MakeTriMesh(const Sphere3D &geom, int numStacks, int numSlices, TriMesh &mesh)
makes a triangle mesh from a sphere
Definition: MeshPrimitives.cpp:270
void MakeTriCenteredBox(int m, int n, int p, Real x, Real y, Real z, TriMesh &mesh)
makes a [x,y,z] sized cube centered at 0 with m,n,p divisions in the x,y,z directions ...
Definition: MeshPrimitives.cpp:126