diff options
author | Alessandro Ranellucci <aar@cpan.org> | 2011-11-12 14:05:32 +0400 |
---|---|---|
committer | Alessandro Ranellucci <aar@cpan.org> | 2011-11-12 14:05:32 +0400 |
commit | a13e4c6fb56794ba49fbbb27dcd67ba32d009501 (patch) | |
tree | 8a9fb4f9e6aadf6a9627db3fbb5340a30690153a /lib/Slic3r/Geometry | |
parent | c5d5e4d244f049ef9068f3b13370577774916cc2 (diff) |
Detect membranes (solid parts generating both a bottom and a top surface on the same layers) and don't infill twice. #28
Diffstat (limited to 'lib/Slic3r/Geometry')
-rw-r--r-- | lib/Slic3r/Geometry/Clipper.pm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Slic3r/Geometry/Clipper.pm b/lib/Slic3r/Geometry/Clipper.pm index 4899d1960..aeacab661 100644 --- a/lib/Slic3r/Geometry/Clipper.pm +++ b/lib/Slic3r/Geometry/Clipper.pm @@ -50,12 +50,15 @@ sub union_ex { } sub intersection_ex { - my ($subject, $clip) = @_; - + my ($subject, $clip, $jointype) = @_; + $jointype = PFT_NONZERO unless defined $jointype; $clipper->clear; $clipper->add_subject_polygons($subject); $clipper->add_clip_polygons($clip); - return $clipper->ex_execute(CT_INTERSECTION, PFT_NONZERO, PFT_NONZERO); + return [ + map Slic3r::ExPolygon->new($_), + @{ $clipper->ex_execute(CT_INTERSECTION, $jointype, $jointype) }, + ]; } 1; |