Skip to content

Commit

Permalink
test adapted to pcl 1.7
Browse files Browse the repository at this point in the history
some commented (old) code removed from ear_clipping (within method isInsideTriangle)
  • Loading branch information
magro11 committed Oct 10, 2013
1 parent 2c8520c commit 09882a8
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 20 deletions.
12 changes: 0 additions & 12 deletions surface/include/pcl/surface/ear_clipping.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,6 @@ namespace pcl
const Eigen::Vector3f& w,
const Eigen::Vector3f& p);

/*bool
sameSide (const Eigen::Vector3f &p1, const Eigen::Vector3f &p2, const Eigen::Vector3f &a, const Eigen::Vector3f &b) const
{
Eigen::Vector3f cp1 = (b-a).cross(p1-a);
Eigen::Vector3f cp2 = (b-a).cross(p2-a);
if (cp1.dot(cp2) >= 0)
return true;
else
return false;
}*/


/** \brief Compute the cross product between 2D vectors.
* \param[in] p1 the first 2D vector
* \param[in] p2 the first 2D vector
Expand Down
7 changes: 0 additions & 7 deletions surface/src/ear_clipping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ pcl::EarClipping::isInsideTriangle (const Eigen::Vector3f& u,
const Eigen::Vector3f& w,
const Eigen::Vector3f& p)
{
// Method 1 (faster):
// see http://www.blackpawn.com/texts/pointinpoly/default.html
// Barycentric Coordinates
Eigen::Vector3f v0 = w - u;
Expand All @@ -207,11 +206,5 @@ pcl::EarClipping::isInsideTriangle (const Eigen::Vector3f& u,

// Check if point is in triangle
return (a >= 0) && (b >= 0) && (a + b < 1);

// Method 2:
/*if (sameSide(p,u,v,w) && sameSide(p,v,u,w) && sameSide(p,w,u,v))
return (true);
else
return (false); */
}

2 changes: 1 addition & 1 deletion test/surface/test_ear_clipping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ TEST (PCL, EarClippingCubeTest)
{2, 3, 1} };

PolygonMesh::Ptr mesh (new PolygonMesh);
toROSMsg (*cloud, mesh->cloud);
toPCLPointCloud2 (*cloud, mesh->cloud);

for (int i = 0; i < 6; ++i)
{
Expand Down

0 comments on commit 09882a8

Please sign in to comment.