mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-14 02:07:54 -06:00
Fixed perimeters crossing when supports are printed.
This commit is contained in:
parent
2afeea5b6f
commit
7f94e9fa59
1 changed files with 7 additions and 0 deletions
|
@ -264,12 +264,19 @@ ExPolygons AvoidCrossingPerimeters2::get_boundary(const Layer &layer)
|
||||||
ExPolygons missing_perimeter_boundary = offset_ex(diff_ex(boundary, offset_ex(perimeter_boundary, offset + SCALED_EPSILON / 2)),
|
ExPolygons missing_perimeter_boundary = offset_ex(diff_ex(boundary, offset_ex(perimeter_boundary, offset + SCALED_EPSILON / 2)),
|
||||||
offset + SCALED_EPSILON);
|
offset + SCALED_EPSILON);
|
||||||
perimeter_boundary = offset_ex(perimeter_boundary, offset);
|
perimeter_boundary = offset_ex(perimeter_boundary, offset);
|
||||||
|
perimeter_boundary.reserve(perimeter_boundary.size() + missing_perimeter_boundary.size());
|
||||||
perimeter_boundary.insert(perimeter_boundary.begin(), missing_perimeter_boundary.begin(), missing_perimeter_boundary.end());
|
perimeter_boundary.insert(perimeter_boundary.begin(), missing_perimeter_boundary.begin(), missing_perimeter_boundary.end());
|
||||||
final_boundary = union_ex(intersection_ex(offset_ex(perimeter_boundary, -offset), boundary));
|
final_boundary = union_ex(intersection_ex(offset_ex(perimeter_boundary, -offset), boundary));
|
||||||
} else {
|
} else {
|
||||||
final_boundary = std::move(perimeter_boundary);
|
final_boundary = std::move(perimeter_boundary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add an outer boundary to avoid crossing perimeters from supports
|
||||||
|
ExPolygons outer_boundary = diff_ex(offset_ex(boundary, 2 * perimeter_spacing), offset_ex(boundary, 2 * perimeter_spacing - offset));
|
||||||
|
final_boundary.reserve(final_boundary.size() + outer_boundary.size());
|
||||||
|
final_boundary.insert(final_boundary.begin(), outer_boundary.begin(), outer_boundary.end());
|
||||||
|
final_boundary = union_ex(final_boundary);
|
||||||
|
|
||||||
// Collect all top layers that will not be crossed.
|
// Collect all top layers that will not be crossed.
|
||||||
polygons_count = 0;
|
polygons_count = 0;
|
||||||
for (const LayerRegion *layer_region : layer.regions())
|
for (const LayerRegion *layer_region : layer.regions())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue