41 #include <pcl/surface/processing.h>
55 using Ptr = shared_ptr<EarClipping>;
56 using ConstPtr = shared_ptr<const EarClipping>;
93 template <typename T = pcl::index_t, std::enable_if_t<!std::is_same<T, std::uint32_t>::value,
pcl::index_t> = 0>
94 PCL_DEPRECATED(1, 14,
"This method creates a useless copy of the vertices vector. Use area method which accepts Indices instead")
96 area (const std::vector<std::uint32_t>& vertices)
98 return area(
Indices (vertices.cbegin(), vertices.cend()));
116 template <typename T = pcl::index_t, std::enable_if_t<!std::is_same<T, std::uint32_t>::value,
pcl::index_t> = 0>
117 PCL_DEPRECATED(1, 14,
"This method creates a useless copy of the vertices vector. Use isEar method which accepts Indices instead")
119 isEar (
int u,
int v,
int w, const std::vector<std::uint32_t>& vertices)
121 return isEar(u, v, w,
Indices (vertices.cbegin(), vertices.cend()));
132 const Eigen::Vector3f& v,
133 const Eigen::Vector3f& w,
134 const Eigen::Vector3f& p);
141 crossProduct (
const Eigen::Vector2f& p1,
const Eigen::Vector2f& p2)
const
143 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.
detail::int_type_t< detail::index_type_size, detail::index_type_signed > index_t
Type used for an index in PCL.
IndicesAllocator<> Indices
Type used for indices in PCL.
#define PCL_DEPRECATED(Major, Minor, Message)
macro for compatibility across compilers and help remove old deprecated items for the Major....
Describes a set of vertices in a polygon mesh, by basically storing an array of indices.