FIX: crash when top_shell_layer = 0 and is sinking

github: 4673
Change-Id: I260b48e833f47383c582f813d979a4fdc2926dd2
This commit is contained in:
zhimin.zeng 2024-08-27 11:28:36 +08:00 committed by Lane.Wei
parent f2fc996652
commit a1c3a99011
1 changed files with 9 additions and 6 deletions

View File

@ -1365,14 +1365,17 @@ static inline std::vector<std::vector<ExPolygons>> mmu_segmentation_top_and_bott
Slic3r::append(zs_sinking, zs);
slice_mesh_slabs(painted, zs_sinking, volume_trafo, max_top_layers > 0 ? &top : nullptr, max_bottom_layers > 0 ? &bottom : nullptr, throw_on_cancel_callback);
MeshSlicingParams slicing_params;
slicing_params.trafo = volume_trafo;
Polygons bottom_slice = slice_mesh(painted, zs[0], slicing_params);
if (top.size() > 0)
top.erase(top.begin());
top.erase(top.begin());
bottom.erase(bottom.begin());
if (bottom.size() > 1) {
MeshSlicingParams slicing_params;
slicing_params.trafo = volume_trafo;
Polygons bottom_slice = slice_mesh(painted, zs[0], slicing_params);
bottom[0] = union_(bottom[0], bottom_slice);
bottom.erase(bottom.begin());
bottom[0] = union_(bottom[0], bottom_slice);
}
} else
slice_mesh_slabs(painted, zs, volume_trafo, max_top_layers > 0 ? &top : nullptr, max_bottom_layers > 0 ? &bottom : nullptr, throw_on_cancel_callback);
auto merge = [](std::vector<Polygons> &&src, std::vector<Polygons> &dst) {