1516{
1517 assert(current_cube);
1518 assert(depth > 0);
1519
1520 --depth;
1521
1522
1523
1524
1525 for (size_t i = 0; i < 8; ++ i) {
1527
1528
1529 BoundingBoxf3 bbox;
1530 for (int k = 0; k < 3; ++ k) {
1531 if (child_center_dir[k] == -1.) {
1532 bbox.min[k] = current_bbox.min[k];
1533 bbox.max[k] = current_cube->center[k] +
EPSILON;
1534 } else {
1535 bbox.min[k] = current_cube->center[k] -
EPSILON;
1536 bbox.max[k] = current_bbox.max[k];
1537 }
1538 }
1539 Vec3d child_center = current_cube->center + (child_center_dir * (this->
cubes_properties[depth].edge_length / 2.));
1540
1541
1543 if (! current_cube->children[i])
1544 current_cube->children[i] = this->
pool.construct(child_center);
1545 if (depth > 0)
1546 this->
insert_triangle(a, b, c, current_cube->children[i], bbox, depth);
1547 }
1548 }
1549}
static constexpr double EPSILON
Definition libslic3r.h:51
static const std::array< Vec3d, 8 > child_centers
Definition FillAdaptive.cpp:225
bool triangle_AABB_intersects(const Vector &a, const Vector &b, const Vector &c, const BoundingBoxBase< Vector > &aabb)
Definition FillAdaptive.cpp:42
Eigen::Matrix< double, 3, 1, Eigen::DontAlign > Vec3d
Definition Point.hpp:52
void insert_triangle(const Vec3d &a, const Vec3d &b, const Vec3d &c, Cube *current_cube, const BoundingBoxf3 ¤t_bbox, int depth)
Definition FillAdaptive.cpp:1515