36 #ifndef JSK_PCL_ROS_EAR_CLIPPING_PATCHED_H_
37 #define JSK_PCL_ROS_EAR_CLIPPING_PATCHED_H_
39 #include <pcl/point_types.h>
40 #include <pcl/surface/processing.h>
42 #include <boost/shared_ptr.hpp>
53 class PCL_EXPORTS EarClippingPatched :
public MeshProcessing
59 using MeshProcessing::input_mesh_;
60 using MeshProcessing::initCompute;
62 EarClippingPatched () : MeshProcessing (), points_ ()
68 pcl::PointCloud<pcl::PointXYZ>::Ptr points_;
78 performProcessing (pcl::PolygonMesh &output);
85 triangulate (
const Vertices& vertices, PolygonMesh& output);
92 triangulateClockwiseVertices (
Vertices& vertices, PolygonMesh& output);
101 isEar (
int u,
int v,
int w,
const Vertices& vertices);
110 isInsideTriangle (
const Eigen::Vector3f& u,
111 const Eigen::Vector3f& v,
112 const Eigen::Vector3f& w,
113 const Eigen::Vector3f&
p);
120 crossProduct (
const Eigen::Vector2f& p1,
const Eigen::Vector2f& p2)
const
122 return p1[0]*p2[1] - p1[1]*p2[0];
132 intersect (
const Eigen::Vector3f& p0,
133 const Eigen::Vector3f& p1,
134 const Eigen::Vector3f& p2,
135 const Eigen::Vector3f& p3);