Skip to content

Commit

Permalink
Merge pull request #124 from friendship1/develop
Browse files Browse the repository at this point in the history
fix bug when cropping with oriented bbox
  • Loading branch information
neka-nat authored Nov 29, 2023
2 parents 2490b55 + 03c4c2c commit f8eff78
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/cupoch/geometry/boundingvolume.cu
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct check_within_oriented_bounding_box_functor {
__device__ bool operator()(
const thrust::tuple<int, Eigen::Vector3f> &x) const {
const Eigen::Vector3f &point = thrust::get<1>(x);
return (test_plane(box_points_[0], box_points_[1], box_points_[3],
return ((test_plane(box_points_[0], box_points_[1], box_points_[3],
point) <= 0 &&
test_plane(box_points_[0], box_points_[5], box_points_[3],
point) >= 0 &&
Expand All @@ -62,7 +62,19 @@ struct check_within_oriented_bounding_box_functor {
test_plane(box_points_[3], box_points_[4], box_points_[5],
point) <= 0 &&
test_plane(box_points_[0], box_points_[1], box_points_[7],
point) >= 0);
point) >= 0) ||
(test_plane(box_points_[0], box_points_[1], box_points_[3],
point) >= 0 &&
test_plane(box_points_[0], box_points_[5], box_points_[3],
point) <= 0 &&
test_plane(box_points_[2], box_points_[5], box_points_[7],
point) >= 0 &&
test_plane(box_points_[1], box_points_[4], box_points_[7],
point) <= 0 &&
test_plane(box_points_[3], box_points_[4], box_points_[5],
point) >= 0 &&
test_plane(box_points_[0], box_points_[1], box_points_[7],
point) <= 0));
}
};

Expand Down

0 comments on commit f8eff78

Please sign in to comment.