plb::TriangleSet< T > Class Template Reference
#include <triangleSet.h>
List of all members.
Public Types |
| typedef Array< Array< T, 3 >, 3 > | Triangle |
Public Member Functions |
| | TriangleSet (Precision precision_=FLT) |
| | TriangleSet (std::vector< Triangle > const &triangles_, Precision precision_=FLT) |
| | TriangleSet (std::string fname, Precision precision_=FLT, SurfaceGeometryFileFormat fformat=STL) |
| std::vector< Triangle > const & | getTriangles () const |
| Precision | getPrecision () const |
| void | setPrecision (Precision precision_) |
| void | translate (Array< T, 3 > const &vector) |
| | Translate the triangle set surface mesh.
|
| void | scale (T alpha) |
| | Scale the triangle set surface mesh.
|
| void | rotate (T phi, T theta, T psi) |
| void | rotateAtOrigin (Array< T, 3 > const &normedAxis, T theta) |
| void | merge (std::vector< TriangleSet< T > > meshes) |
| void | reverseOrientation () |
| | A very simple orientation reversing function.
|
| void | writeAsciiSTL (std::string fname) const |
| | Export the mesh as an ASCII STL file.
|
| void | writeBinarySTL (std::string fname) const |
| | Export the mesh as an binary STL file.
|
| int | cutWithPlane (Plane< T > const &plane, TriangleSet< T > &newTriangleSet) const |
| int | cutWithPlane (Plane< T > const &plane, Cuboid< T > const &cuboid, TriangleSet< T > &newTriangleSet) const |
| T | getMinEdgeLength () const |
| T | getMaxEdgeLength () const |
| Cuboid< T > | getBoundingCuboid () const |
template<typename T>
class plb::TriangleSet< T >
Member Typedef Documentation
Constructor & Destructor Documentation
Member Function Documentation
Cut the current triangle set mesh by a plane "plane" which is defined by a point and a normal and a cuboid "cuboid" which is defined by a lower left corner and a right upper corner. This cutting operation will cut off all triangles, or parts of triangles that are fully contained in the cuboid and are positioned in the half-space that the normal of the cutting plane points into. Caution is needed, because this function does not use the cuboid to cut, but only to select parts of the original triangle set, to be then cut by the plane. Obviously, at least a part of the cutting plane must be contained in the cuboid, for the cutting to make any sense. If not used wisely, this function can lead to broken STL files. The function returns 1 if the cut was successful, 0 if there was no intersection between the original triangle set the plane and the cuboid provided, and -1 if an error occured.
Cut the current triangle set mesh by a plane "plane" which is defined by a point and a normal. This cutting operation will produce a new triangle set "newTriangleSet" which is the one that belongs to the half-space that the normal of the cutting plane points outside of. The function returns 1 if the cut was successful, 0 if there was no intersection between the original triangle set and the plane provided, and -1 if an error occured.
Erase the current triangle set surface mesh, and merge into it the new meshes. This function currently does not check for duplicate triangles in the new meshes, and does not handle cases when the resulting merged surface mesh is non-manifold. It is in the user's jurisdiction to make sure that the resulting mesh is well defined. Practically, this can be achieved if the new triangle set meshes given as arguments are mutually disjoint.
A very simple orientation reversing function.
Rotate the triangle set surface mesh. The arguments of this function are the Euler angles in radians. The so-called "x-convention" is used, in which the rotation is given by the three angles (phi, theta, psi), where: 1.] The first rotation is by an angle phi about the z-axis, 2.] The second rotation is by an angle theta in [0, pi] about the new x-axis, 3.] The third rotation is by an angle psi about the new z-axis.
Export the mesh as an ASCII STL file.
Export the mesh as an binary STL file.
The documentation for this class was generated from the following files: