Always fix self-intersecting polygons that Douglas-Peucker might return

This commit is contained in:
Alessandro Ranellucci 2013-03-16 18:42:56 +01:00
parent dc0f706789
commit 33b40eda18
14 changed files with 85 additions and 55 deletions

View file

@ -263,14 +263,14 @@ sub make_perimeters {
# we offset by half the perimeter spacing (to get to the actual infill boundary)
# and then we offset back and forth by the infill spacing to only consider the
# non-collapsing regions
my @fill_boundaries = @{union_ex([
Slic3r::Geometry::Clipper::offset(
[Slic3r::Geometry::Clipper::offset([ map @$_, @last_offsets ], -($perimeter_spacing/2 + $infill_spacing))],
+$infill_spacing,
),
])};
$_->simplify(&Slic3r::SCALED_RESOLUTION) for @fill_boundaries;
push @{ $self->fill_surfaces }, @fill_boundaries;
push @{ $self->fill_surfaces },
map $_->simplify(&Slic3r::SCALED_RESOLUTION),
@{union_ex([
Slic3r::Geometry::Clipper::offset(
[Slic3r::Geometry::Clipper::offset([ map @$_, @last_offsets ], -($perimeter_spacing/2 + $infill_spacing))],
+$infill_spacing,
),
])};
}
# fill gaps