2068{
2069 assert(current_cube);
2070 assert(depth > 0);
2071
2072 --depth;
2073
2074
2075
2076
2077 for (size_t i = 0; i < 8; ++ i) {
2079
2080
2081 BoundingBoxf3 bbox;
2082 for (int k = 0; k < 3; ++ k) {
2083 if (child_center_dir[k] == -1.) {
2084 bbox.min[k] = current_bbox.min[k];
2085 bbox.max[k] = current_cube->center[k] +
EPSILON;
2086 } else {
2087 bbox.min[k] = current_cube->center[k] -
EPSILON;
2088 bbox.max[k] = current_bbox.max[k];
2089 }
2090 }
2091 Vec3d child_center = current_cube->center + (child_center_dir * (this->
cubes_properties[depth].edge_length / 2.));
2092
2093
2095 if (! current_cube->children[i])
2096 current_cube->children[i] = this->
pool.construct(child_center);
2097 if (depth > 0)
2098 this->
insert_triangle(a, b, c, current_cube->children[i], bbox, depth);
2099 }
2100 }
2101}
#define EPSILON
Definition ColorUtils.cpp:64
static const std::array< Vec3d, 8 > child_centers
Definition FillAdaptive.cpp:253
bool triangle_AABB_intersects(const Vector &a, const Vector &b, const Vector &c, const BoundingBoxBase< Vector > &aabb)
Definition FillAdaptive.cpp:70
Eigen::Matrix< double, 3, 1, Eigen::DontAlign > Vec3d
Definition Point.hpp:68
void insert_triangle(const Vec3d &a, const Vec3d &b, const Vec3d &c, Cube *current_cube, const BoundingBoxf3 ¤t_bbox, int depth)
Definition FillAdaptive.cpp:2067