diff options
author | Vojtech Bubnik <bubnikv@gmail.com> | 2021-06-10 10:26:01 +0300 |
---|---|---|
committer | Vojtech Bubnik <bubnikv@gmail.com> | 2021-06-10 10:26:30 +0300 |
commit | 95f4690e253d3d393036321144c131edbfacdbd6 (patch) | |
tree | 1f5f1bf21908671f1dab2d23b2cac7aaa0b00f93 /src/libslic3r/Format/3mf.cpp | |
parent | b59ff2c2948f33ba0afaa9ff9b731e2109f40210 (diff) |
Support / seam / MMU painting serialization / deserialization:
Changed the serialization structure
std::map<int, std::vector<bool>>
to a significantly more compact
std::pair<std::vector<std::pair<int, int>>, std::vector<bool>>
Such change shall significantly improve efficiency of Undo / Redo stack.
Diffstat (limited to 'src/libslic3r/Format/3mf.cpp')
-rw-r--r-- | src/libslic3r/Format/3mf.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libslic3r/Format/3mf.cpp b/src/libslic3r/Format/3mf.cpp index 1b59448fd..fbf27c548 100644 --- a/src/libslic3r/Format/3mf.cpp +++ b/src/libslic3r/Format/3mf.cpp @@ -1899,6 +1899,9 @@ namespace Slic3r { volume->calculate_convex_hull(); // recreate custom supports, seam and mmu segmentation from previously loaded attribute + volume->supported_facets.reserve(triangles_count); + volume->seam_facets.reserve(triangles_count); + volume->mmu_segmentation_facets.reserve(triangles_count); for (unsigned i=0; i<triangles_count; ++i) { size_t index = src_start_id/3 + i; assert(index < geometry.custom_supports.size()); @@ -1911,7 +1914,9 @@ namespace Slic3r { if (! geometry.mmu_segmentation[index].empty()) volume->mmu_segmentation_facets.set_triangle_from_string(i, geometry.mmu_segmentation[index]); } - + volume->supported_facets.shrink_to_fit(); + volume->seam_facets.shrink_to_fit(); + volume->mmu_segmentation_facets.shrink_to_fit(); // apply the remaining volume's metadata for (const Metadata& metadata : volume_data.metadata) { |