diff --git a/src/libslic3r/SLAPrint.hpp b/src/libslic3r/SLAPrint.hpp index 182c2f911..0cf796d07 100644 --- a/src/libslic3r/SLAPrint.hpp +++ b/src/libslic3r/SLAPrint.hpp @@ -88,6 +88,7 @@ class SLAPrintObject : public _SLAPrintObjectBase { private: // Prevents erroneous use by other classes. using Inherited = _SLAPrintObjectBase; + using CSGContainer = std::multiset; public: @@ -122,6 +123,17 @@ public: // like hollowing and drilled holes. const TriangleMesh & get_mesh_to_print() const; + const Range get_parts_to_slice() const + { + return range(m_mesh_to_slice); + } + + const Range get_parts_to_slice(SLAPrintObjectStep step) const + { + auto r = m_mesh_to_slice.equal_range(step); + return {r.first, r.second}; + } + sla::SupportPoints transformed_support_points() const; sla::DrainHoles transformed_drainhole_points() const; @@ -331,9 +343,6 @@ private: std::vector m_model_height_levels; - // Caching the transformed (m_trafo) raw mesh of the object -// TriangleMesh m_transformed_rmesh; - struct SupportData { sla::SupportableMesh input; // the input @@ -362,7 +371,7 @@ private: std::unique_ptr m_supportdata; // Holds CSG operations for the printed object, prioritized by print steps. - std::multiset m_mesh_to_slice; + CSGContainer m_mesh_to_slice; // Holds the preview of the object to be printed (as it will look like with // all its holes and cavities, negatives and positive volumes unified. diff --git a/src/libslic3r/SLAPrintSteps.cpp b/src/libslic3r/SLAPrintSteps.cpp index 88b7926d1..f0e2e5db0 100644 --- a/src/libslic3r/SLAPrintSteps.cpp +++ b/src/libslic3r/SLAPrintSteps.cpp @@ -186,13 +186,6 @@ indexed_triangle_set SLAPrint::Steps::generate_preview_vdb( return m; } -inline auto parts_to_slice(const std::multiset &parts, - SLAPrintObjectStep step) -{ - auto r = parts.equal_range(step); - return Range{r.first, r.second}; -} - void SLAPrint::Steps::generate_preview(SLAPrintObject &po, SLAPrintObjectStep step) { Benchmark bench; @@ -219,7 +212,7 @@ void SLAPrint::Steps::generate_preview(SLAPrintObject &po, SLAPrintObjectStep st // If that fails for any of the drillholes, the voxelization fallback is // used. - bool is_pure_model = is_all_positive(parts_to_slice(po.m_mesh_to_slice, slaposAssembly)); + bool is_pure_model = is_all_positive(po.get_parts_to_slice(slaposAssembly)); bool can_hollow = po.m_hollowing_data && po.m_hollowing_data->interior && !sla::get_mesh(*po.m_hollowing_data->interior).empty();