Moved TriangleSelectorWrapper methods to cpp file, added comment describing problems with FacetsAnnotations/TriangleSelector

structure
This commit is contained in:
PavelMikus 2022-04-07 13:52:59 +02:00
parent 706cd63e61
commit e516ba0dd0
4 changed files with 39 additions and 22 deletions

View file

@ -1 +1,30 @@
#include "Model.hpp"
#include "TriangleSelectorWrapper.hpp"
#include <memory>
namespace Slic3r {
TriangleSelectorWrapper::TriangleSelectorWrapper(const TriangleMesh &mesh) :
mesh(mesh), selector(mesh), triangles_tree(
AABBTreeIndirect::build_aabb_tree_over_indexed_triangle_set(mesh.its.vertices, mesh.its.indices)) {
}
void TriangleSelectorWrapper::enforce_spot(const Vec3f &point, float radius) {
size_t hit_face_index;
Vec3f hit_point;
auto dist = AABBTreeIndirect::squared_distance_to_indexed_triangle_set(mesh.its.vertices, mesh.its.indices,
triangles_tree,
point, hit_face_index, hit_point);
if (dist < 0 || dist > radius)
return;
std::unique_ptr<TriangleSelector::Cursor> cursor = std::make_unique<TriangleSelector::Sphere>(point, point,
radius, Transform3d::Identity(), TriangleSelector::ClippingPlane { });
selector.select_patch(hit_face_index, std::move(cursor), EnforcerBlockerType::ENFORCER, Transform3d::Identity(),
true,
0.0f);
}
}