FIX: crash when top_shell_layer = 0 and is sinking
github: 4673 Change-Id: I260b48e833f47383c582f813d979a4fdc2926dd2
This commit is contained in:
parent
f2fc996652
commit
a1c3a99011
|
@ -1365,14 +1365,17 @@ static inline std::vector<std::vector<ExPolygons>> mmu_segmentation_top_and_bott
|
||||||
Slic3r::append(zs_sinking, zs);
|
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);
|
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;
|
if (top.size() > 0)
|
||||||
slicing_params.trafo = volume_trafo;
|
top.erase(top.begin());
|
||||||
Polygons bottom_slice = slice_mesh(painted, zs[0], slicing_params);
|
|
||||||
|
|
||||||
top.erase(top.begin());
|
if (bottom.size() > 1) {
|
||||||
bottom.erase(bottom.begin());
|
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
|
} else
|
||||||
slice_mesh_slabs(painted, zs, volume_trafo, max_top_layers > 0 ? &top : nullptr, max_bottom_layers > 0 ? &bottom : nullptr, throw_on_cancel_callback);
|
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) {
|
auto merge = [](std::vector<Polygons> &&src, std::vector<Polygons> &dst) {
|
||||||
|
|
Loading…
Reference in New Issue