Skip to content

Commit cae1d6e

Browse files
committed
Fix broken combing
CURA-12250 The previous refactoring left only the boundary of the last processed part, now we use the boundaries of all the parts again.
1 parent c6faf2a commit cae1d6e

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/LayerPlan.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,27 +210,31 @@ Shape LayerPlan::computeCombBoundary(const CombBoundary boundary_type)
210210
const CombingMode combing_mode = mesh.settings.get<CombingMode>("retraction_combing");
211211
for (const SliceLayerPart& part : layer.parts)
212212
{
213+
Shape part_combing_boundary;
214+
213215
if (combing_mode == CombingMode::INFILL)
214216
{
215-
comb_boundary = part.infill_area;
217+
part_combing_boundary = part.infill_area;
216218
}
217219
else
218220
{
219-
comb_boundary = part.outline.offset(offset);
221+
part_combing_boundary = part.outline.offset(offset);
220222

221223
if (combing_mode == CombingMode::NO_SKIN) // Add the increased outline offset, subtract skin (infill and part of the inner walls)
222224
{
223-
comb_boundary = comb_boundary.difference(part.inner_area.difference(part.infill_area));
225+
part_combing_boundary = part_combing_boundary.difference(part.inner_area.difference(part.infill_area));
224226
}
225227
else if (combing_mode == CombingMode::NO_OUTER_SURFACES)
226228
{
227229
for (const SliceLayerPart& outer_surface_part : layer.parts)
228230
{
229-
comb_boundary = comb_boundary.difference(outer_surface_part.top_most_surface);
230-
comb_boundary = comb_boundary.difference(outer_surface_part.bottom_most_surface);
231+
part_combing_boundary = part_combing_boundary.difference(outer_surface_part.top_most_surface);
232+
part_combing_boundary = part_combing_boundary.difference(outer_surface_part.bottom_most_surface);
231233
}
232234
}
233235
}
236+
237+
comb_boundary.push_back(part_combing_boundary);
234238
}
235239
}
236240
break;
@@ -1291,7 +1295,7 @@ std::vector<LayerPlan::PathCoasting>
12911295

12921296
for (const auto& reversed_chunk : paths | ranges::views::enumerate | ranges::views::reverse
12931297
| ranges::views::chunk_by(
1294-
[](const auto&path_a, const auto&path_b)
1298+
[](const auto& path_a, const auto& path_b)
12951299
{
12961300
return (! std::get<1>(path_a).isTravelPath()) || std::get<1>(path_b).isTravelPath();
12971301
}))

0 commit comments

Comments
 (0)