From 41388bdb01e7418717a265d66c42f900814b50aa Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Mon, 10 Feb 2020 16:33:59 +0100 Subject: [PATCH 1/2] Remove the hollowed interior slices from the model slices in 2D --- src/libslic3r/SLAPrintSteps.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/SLAPrintSteps.cpp b/src/libslic3r/SLAPrintSteps.cpp index ff170d917..e740b7260 100644 --- a/src/libslic3r/SLAPrintSteps.cpp +++ b/src/libslic3r/SLAPrintSteps.cpp @@ -222,8 +222,14 @@ void SLAPrint::Steps::slice_model(SLAPrintObject &po) auto &slice_grid = po.m_model_height_levels; slicer.slice(slice_grid, SlicingMode::Regular, closing_r, &po.m_model_slices, thr); -// sla::DrainHoles drainholes = po.transformed_drainhole_points(); -// cut_drainholes(po.m_model_slices, slice_grid, closing_r, drainholes, thr); + if (po.m_hollowing_data) { + po.m_hollowing_data->interior.repair(); + TriangleMeshSlicer interior_slicer(&po.m_hollowing_data->interior); + std::vector interior_slices; + interior_slicer.slice(slice_grid, SlicingMode::Regular, closing_r, &interior_slices, thr); + for (size_t i = 0; i < slice_grid.size(); ++i) + po.m_model_slices[i] = diff_ex(po.m_model_slices[i], interior_slices[i]); + } auto mit = slindex_it; double doffs = m_print->m_printer_config.absolute_correction.getFloat(); From 384d1ae1bb00221a84d67b1842ec8217641477dc Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Mon, 10 Feb 2020 16:56:46 +0100 Subject: [PATCH 2/2] Use parallel execution for cutting the hollowed interior partial solution for #3622 --- src/libslic3r/SLAPrintSteps.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/SLAPrintSteps.cpp b/src/libslic3r/SLAPrintSteps.cpp index e740b7260..108ac3e17 100644 --- a/src/libslic3r/SLAPrintSteps.cpp +++ b/src/libslic3r/SLAPrintSteps.cpp @@ -227,8 +227,12 @@ void SLAPrint::Steps::slice_model(SLAPrintObject &po) TriangleMeshSlicer interior_slicer(&po.m_hollowing_data->interior); std::vector interior_slices; interior_slicer.slice(slice_grid, SlicingMode::Regular, closing_r, &interior_slices, thr); - for (size_t i = 0; i < slice_grid.size(); ++i) - po.m_model_slices[i] = diff_ex(po.m_model_slices[i], interior_slices[i]); + + sla::ccr::enumerate(interior_slices.begin(), interior_slices.end(), + [&po](const ExPolygons &slice, size_t i) { + po.m_model_slices[i] = + diff_ex(po.m_model_slices[i], slice); + }); } auto mit = slindex_it;