|
|
@ -1,5 +1,6 @@ |
|
|
|
#include "Eigen/Core" |
|
|
|
#include "internal_primitive_desc.hpp" |
|
|
|
#include <cassert> |
|
|
|
#include <cmath> |
|
|
|
#include <iostream> |
|
|
|
|
|
|
@ -19,9 +20,36 @@ extrude_polyline::extrude_polyline(const extrude_polyline_descriptor_t &desc, aa |
|
|
|
matrix_handle.col(2), |
|
|
|
matrix_handle.col(3), |
|
|
|
profile_aabb); |
|
|
|
const auto profile_max_extent = profile_aabb.max().cwiseMax(profile_aabb.min().cwiseAbs()).maxCoeff(); |
|
|
|
aabb.min().array() -= profile_max_extent; |
|
|
|
aabb.max().array() += profile_max_extent; |
|
|
|
const auto profile_max_extent = profile_aabb.max().cwiseMax(profile_aabb.min().cwiseAbs()).maxCoeff(); |
|
|
|
//////////////special judge////////////////
|
|
|
|
const auto eqs = [](double a, double b) { return std::abs(a - b) < EPSILON; }; |
|
|
|
int aabb_parallel_coord_axis = -1; |
|
|
|
if (eqs(aabb.min().x(), aabb.max().x()) && eqs(aabb.min().y(), aabb.max().y())) { |
|
|
|
aabb_parallel_coord_axis = 2; |
|
|
|
assert(aabb.min().z() != aabb.max().z()); |
|
|
|
aabb.min().x() -= profile_max_extent; |
|
|
|
aabb.max().x() += profile_max_extent; |
|
|
|
aabb.min().y() -= profile_max_extent; |
|
|
|
aabb.max().y() += profile_max_extent; |
|
|
|
} else if (eqs(aabb.min().x(), aabb.max().x()) && eqs(aabb.min().z(), aabb.max().z())) { |
|
|
|
aabb_parallel_coord_axis = 1; |
|
|
|
assert(aabb.min().y() != aabb.max().y()); |
|
|
|
aabb.min().x() -= profile_max_extent; |
|
|
|
aabb.max().x() += profile_max_extent; |
|
|
|
aabb.min().z() -= profile_max_extent; |
|
|
|
aabb.max().z() += profile_max_extent; |
|
|
|
} else if (eqs(aabb.min().y(), aabb.max().y()) && eqs(aabb.min().z(), aabb.max().z())) { |
|
|
|
aabb_parallel_coord_axis = 0; |
|
|
|
aabb.min().y() -= profile_max_extent; |
|
|
|
aabb.max().y() += profile_max_extent; |
|
|
|
aabb.min().z() -= profile_max_extent; |
|
|
|
aabb.max().z() += profile_max_extent; |
|
|
|
} |
|
|
|
//////////////EO special judge////////////////
|
|
|
|
else { |
|
|
|
aabb.min().array() -= profile_max_extent; |
|
|
|
aabb.max().array() += profile_max_extent; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
extrude_polyline::extrude_polyline(extrude_polyline_descriptor_t &&desc, aabb_t<> &aabb) |
|
|
|