Ported offset() and offset2()

This commit is contained in:
Alessandro Ranellucci 2013-07-17 00:48:29 +02:00
parent bf8c799685
commit c7b6818ccf
15 changed files with 152 additions and 81 deletions

View file

@ -105,17 +105,17 @@ sub make_fill {
{
my $collapsed = diff(
[ map @{$_->expolygon}, @surfaces ],
[ offset(
[ offset([ map @{$_->expolygon}, @surfaces ], -$distance_between_surfaces/2) ],
offset(
offset([ map @{$_->expolygon}, @surfaces ], -$distance_between_surfaces/2),
+$distance_between_surfaces/2
) ],
),
1,
);
push @surfaces, map Slic3r::Surface->new(
expolygon => $_,
surface_type => S_TYPE_INTERNALSOLID,
), @{intersection_ex(
[ offset($collapsed, $distance_between_surfaces) ],
offset($collapsed, $distance_between_surfaces),
[
(map @{$_->expolygon}, grep $_->surface_type == S_TYPE_INTERNALVOID, @surfaces),
(@$collapsed),
@ -125,7 +125,7 @@ sub make_fill {
}
# add spacing between surfaces
@surfaces = map $_->offset(-$distance_between_surfaces / 2 * &Slic3r::INFILL_OVERLAP_OVER_SPACING), @surfaces;
@surfaces = map @{$_->offset(-$distance_between_surfaces / 2 * &Slic3r::INFILL_OVERLAP_OVER_SPACING)}, @surfaces;
my @fills = ();
my @fills_ordering_points = ();