mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-07-28 02:02:02 +08:00
Fixed perimeters crossing when supports are printed.
This commit is contained in:
parent
2afeea5b6f
commit
7f94e9fa59
@ -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…
x
Reference in New Issue
Block a user