28 [[nodiscard]]
const point3d& max()
const;
30 [[nodiscard]]
const point3d& min()
const;
36 [[nodiscard]]
bbox3d union_hull(
const bbox3d& other)
const;
41 template<
class InputIterator>
42 static bbox3d from_points(InputIterator points_begin, InputIterator points_end) {
44 if(points_begin == points_end)
return result;
45 auto it = points_begin;
46 auto first_point = *it;
47 result.min_(0) = result.max_(0) = first_point(0);
48 result.min_(1) = result.max_(1) = first_point(1);
49 result.min_(2) = result.max_(2) = first_point(2);
51 for( ; it != points_end; it ++) {
53 result.min_(0) = std::min(result.min_(0), point(0));
54 result.min_(1) = std::min(result.min_(1), point(1));
55 result.min_(2) = std::min(result.min_(2), point(2));
56 result.max_(0) = std::max(result.max_(0), point(0));
57 result.max_(1) = std::max(result.max_(1), point(1));
58 result.max_(2) = std::max(result.max_(2), point(2));
64 template <
class Derived>
65 static bbox3d from_points(
const Eigen::MatrixBase<Derived>& points) {
66 if (points.rows() == 0) {
70 return {points.colwise().minCoeff(), points.colwise().maxCoeff()};