RobWorkProject  23.9.11-
Classes | Static Public Member Functions | List of all members
TriangleUtil Class Reference

utility for triangle manipulation More...

#include <TriangleUtil.hpp>

Static Public Member Functions

template<class TRILIST >
static rw::core::Ptr< TRILIST > toIndexedTriMesh (const TriMesh &triMesh, double epsilon=0.00001)
 Takes a general triangle mesh and creates an indexed triangle mesh. All data is copied. More...
 
template<class T >
static void recalcNormals (rw::geometry::PlainTriMesh< rw::geometry::TriangleN1< T >> &trimesh)
 Recalculate the normals of trimesh.
 
template<class TRI >
static std::pair< TriMesh::Ptr, TriMesh::Ptrdivide (TriMesh::Ptr trimesh, Plane::Ptr plane)
 Divided trimesh using the specified plane. More...
 

Detailed Description

utility for triangle manipulation

Member Function Documentation

◆ divide()

static std::pair<TriMesh::Ptr, TriMesh::Ptr> divide ( TriMesh::Ptr  trimesh,
Plane::Ptr  plane 
)
inlinestatic

Divided trimesh using the specified plane.

Triangles is cut by the plane and replaced with new triangles. Triangles lying in the plane is placed with the triangles behind.

Returns
First item in the pair is the triangles in front of the plane and second item is the triangles behind or in the plane.

◆ toIndexedTriMesh()

static rw::core::Ptr<TRILIST> toIndexedTriMesh ( const TriMesh triMesh,
double  epsilon = 0.00001 
)
inlinestatic

Takes a general triangle mesh and creates an indexed triangle mesh. All data is copied.

The order of the triangles in the new mesh will be the same as that of the old mesh. This is not true for the vertices.

Parameters
triMesh[in] the tri mesh that is to be converted
epsilon[in] if two vertices are closer than epsilon they are considered the equal.

The documentation for this class was generated from the following file: