41 #include <pcl/surface/processing.h>
55 using Ptr = shared_ptr<EarClipping>;
56 using ConstPtr = shared_ptr<const EarClipping>;
107 const Eigen::Vector3f& v,
108 const Eigen::Vector3f& w,
109 const Eigen::Vector3f& p);
116 crossProduct (
const Eigen::Vector2f& p1,
const Eigen::Vector2f& p2)
const
118 return p1[0]*p2[1] - p1[1]*p2[0];
The ear clipping triangulation algorithm.
float area(const Indices &vertices)
Compute the signed area of a polygon.
void triangulate(const Vertices &vertices, PolygonMesh &output)
Triangulate one polygon.
void performProcessing(pcl::PolygonMesh &output) override
The actual surface reconstruction method.
bool initCompute() override
This method should get called before starting the actual computation.
shared_ptr< EarClipping > Ptr
bool isInsideTriangle(const Eigen::Vector3f &u, const Eigen::Vector3f &v, const Eigen::Vector3f &w, const Eigen::Vector3f &p)
Check if p is inside the triangle (u,v,w).
pcl::PointCloud< pcl::PointXYZ >::Ptr points_
a Pointer to the point cloud data.
bool isEar(int u, int v, int w, const Indices &vertices)
Check if the triangle (u,v,w) is an ear.
shared_ptr< const EarClipping > ConstPtr
float crossProduct(const Eigen::Vector2f &p1, const Eigen::Vector2f &p2) const
Compute the cross product between 2D vectors.
EarClipping()=default
Empty constructor.
MeshProcessing represents the base class for mesh processing algorithms.
virtual bool initCompute()
Initialize computation.
pcl::PolygonMeshConstPtr input_mesh_
Input polygonal mesh.
shared_ptr< PointCloud< PointT > > Ptr
Defines all the PCL implemented PointT point type structures.
IndicesAllocator<> Indices
Type used for indices in PCL.
Describes a set of vertices in a polygon mesh, by basically storing an array of indices.