mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 20:03:47 +00:00
Isolate narrow regions in internal solid surfaces for non-line infill patterns (#12107)
This commit is contained in:
@@ -599,16 +599,34 @@ void split_solid_surface(size_t layer_id, const SurfaceFill &fill, ExPolygons &n
|
|||||||
{
|
{
|
||||||
assert(fill.surface.surface_type == stInternalSolid);
|
assert(fill.surface.surface_type == stInternalSolid);
|
||||||
|
|
||||||
switch (fill.params.pattern) {
|
const bool line_based_pattern =
|
||||||
case ipRectilinear:
|
fill.params.pattern == ipRectilinear || fill.params.pattern == ipMonotonic ||
|
||||||
case ipMonotonic:
|
fill.params.pattern == ipMonotonicLine || fill.params.pattern == ipAlignedRectilinear;
|
||||||
case ipMonotonicLine:
|
|
||||||
case ipAlignedRectilinear:
|
// ORCA: For non-line patterns, split by a geometric "core" so only thin areas get rerouted.
|
||||||
// Only support straight line based infill
|
if (!line_based_pattern) {
|
||||||
break;
|
const coord_t scaled_spacing = scaled<coord_t>(fill.params.spacing);
|
||||||
|
|
||||||
|
for (const ExPolygon &expolygon : fill.expolygons) {
|
||||||
|
Polygons filled_area = to_polygons(expolygon);
|
||||||
|
|
||||||
|
// "Core" area: open (erode+dilate) to drop thin features, then clamp back to the original polygon.
|
||||||
|
Polygons inner_area = intersection(filled_area, opening(filled_area, scaled_spacing, scaled_spacing));
|
||||||
|
|
||||||
|
if (inner_area.empty()) {
|
||||||
|
narrow_infill.emplace_back(expolygon);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
ExPolygons inner_ex = union_ex(inner_area);
|
||||||
|
ExPolygons expolys{expolygon};
|
||||||
|
ExPolygons narrow_ex = diff_ex(expolys, inner_ex);
|
||||||
|
ExPolygons normal_ex = intersection_ex(expolys, inner_ex);
|
||||||
|
|
||||||
|
append(normal_infill, normal_ex); // normal infill area
|
||||||
|
append(narrow_infill, narrow_ex); // narrow infill area
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
|
||||||
// For all other types, don't split
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user