Go to the documentation of this file. 1 #ifndef SimTK_SimTKCOMMON_POLYGONAL_MESH_H_
2 #define SimTK_SimTKCOMMON_POLYGONAL_MESH_H_
33 class PolygonalMeshImpl;
38 #ifndef SimTK_SIMTKCOMMON_DEFINING_POLYGONALMESH
39 extern template class PIMPLHandle<PolygonalMesh, PolygonalMeshImpl, true>;
260 void initializeHandleIfEmpty();
265 #endif // SimTK_SimTKCOMMON_POLYGONAL_MESH_H_
PolygonalMesh & scaleMesh(Real scale)
Scale a mesh by multiplying every vertex by a fixed value.
PolygonalMesh()
Create an empty PolygonalMesh, with no vertices or faces.
Definition: PolygonalMesh.h:74
int addVertex(const Vec3 &position)
Add a vertex to the mesh.
This is a System that represents the dynamics of a particle moving along a smooth surface.
Definition: Assembler.h:37
int getNumFaces() const
Get the number of faces in the mesh.
int addFace(const Array_< int > &vertices)
Add a face to the mesh.
void clear()
Restore this PolygonalMesh to its default-constructed state, meaning that it will contain no vertices...
void loadFile(const String &pathname)
Attempt to interpret the given file as a mesh file, with the format determined from the file name ext...
#define SimTK_SimTKCOMMON_EXPORT
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:224
int getNumVerticesForFace(int face) const
Get the number of vertices that make up a particular face.
void loadStlFile(const String &pathname)
Load an STL file, adding the vertices and faces it contains to this mesh and ignoring anything else i...
void loadVtpFile(const String &pathname)
Load a VTK PolyData (.vtp) file, adding the vertices and faces it contains to this mesh and ignoring ...
void loadObjFile(const String &pathname)
Load a Wavefront OBJ (.obj) file, adding the vertices and faces it contains to this mesh,...
This class provides a description of a mesh made of polygonal faces (not limited to triangles).
Definition: PolygonalMesh.h:71
int getNumVertices() const
Get the number of vertices in the mesh.
PolygonalMesh & transformMesh(const Transform &X_AM)
Transform a mesh by applying the given Transform to every vertex, leaving the mesh permanently change...
int getFaceVertex(int face, int vertex) const
Get the index of one of the vertices of a face.
static PolygonalMesh createCylinderMesh(const UnitVec3 &axis, Real radius, Real halfLength, int resolution=1)
Create a cylinder-shaped mesh, with the long axis in a given direction.
const Vec3 & getVertexPosition(int vertex) const
Get the position of a vertex in the mesh.
SimTK_Real Real
This is the default compiled-in floating point type for SimTK, either float or double.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:606
static PolygonalMesh createBrickMesh(const Vec3 &halfDims, int resolution=1)
Create a brick-shaped mesh.
void loadObjFile(std::istream &file)
Alternate signature for Wavefront OBJ format that takes an already-open istream rather than a pathnam...
SimTK::String is a plug-compatible std::string replacement (plus some additional functionality) inten...
Definition: String.h:62
static PolygonalMesh createSphereMesh(Real radius, int resolution=1)
Create a sphere-shaped mesh, with roughly uniform mesh elements.