Skip to content

Commit

Permalink
PointCloudLibrary#1657: Fix cropHull
Browse files Browse the repository at this point in the history
  • Loading branch information
ks committed Jul 23, 2018
1 parent 310b93f commit b8a8a2b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions filters/include/pcl/filters/impl/crop_hull.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,9 @@ pcl::CropHull<PointT>::applyFilter3D (PointCloud &output)
crossings[ray] += rayTriangleIntersect
(input_->points[(*indices_)[index]], rays[ray], hull_polygons_[poly], *hull_cloud_);

if (crop_outside_ && (crossings[0]&1) + (crossings[1]&1) + (crossings[2]&1) > 1)
output.push_back (input_->points[(*indices_)[index]]);
else if (!crop_outside_)
output.push_back (input_->points[(*indices_)[index]]);
bool isPointInsideHull = (crossings[0]&1) + (crossings[1]&1) + (crossings[2]&1) > 1;
if ((crop_outside_ && isPointInsideHull) || (!crop_outside_ && !isPointInsideHull))
output.push_back (input_->points[(*indices_)[index]]);
}
}

Expand Down

0 comments on commit b8a8a2b

Please sign in to comment.