TriangleMeshSlicer: Got rid of admesh!

This commit is contained in:
Vojtech Bubnik 2021-05-18 15:05:23 +02:00
parent 1256aebd88
commit 70b4915f9c
18 changed files with 443 additions and 452 deletions

View file

@ -296,9 +296,8 @@ void cut_drainholes(std::vector<ExPolygons> & obj_slices,
if (mesh.empty()) return;
mesh.require_shared_vertices();
std::vector<ExPolygons> hole_slices;
slice_mesh(mesh, slicegrid, closing_radius, hole_slices, thr);
std::vector<ExPolygons> hole_slices = slice_mesh_ex(mesh.its, slicegrid, closing_radius, thr);
if (obj_slices.size() != hole_slices.size())
BOOST_LOG_TRIVIAL(warning)

View file

@ -478,8 +478,8 @@ void pad_blueprint(const TriangleMesh & mesh,
{
if (mesh.empty()) return;
auto out = reserve_vector<ExPolygons>(heights.size());
slice_mesh(mesh, heights, out, thrfn);
assert(mesh.has_shared_vertices());
std::vector<ExPolygons> out = slice_mesh_ex(mesh.its, heights, thrfn);
size_t count = 0;
for(auto& o : out) count += o.size();

View file

@ -45,7 +45,8 @@ std::vector<ExPolygons> SupportTree::slice(
if (!sup_mesh.empty()) {
slices.emplace_back();
slice_mesh(sup_mesh, grid, cr, slices.back(), ctl().cancelfn);
assert(sup_mesh.has_shared_vertices());
slices.back() = slice_mesh_ex(sup_mesh.its, grid, cr, ctl().cancelfn);
}
if (!pad_mesh.empty()) {
@ -58,7 +59,8 @@ std::vector<ExPolygons> SupportTree::slice(
auto padgrid = reserve_vector<float>(size_t(cap > 0 ? cap : 0));
std::copy(grid.begin(), maxzit, std::back_inserter(padgrid));
slice_mesh(pad_mesh, padgrid, cr, slices.back(), ctl().cancelfn);
assert(pad_mesh.has_shared_vertices());
slices.back() = slice_mesh_ex(pad_mesh.its, padgrid, cr, ctl().cancelfn);
}
size_t len = grid.size();