From 4bee1a12b8fc06d6fe8c07c547258ffbc2b0d4fe Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Wed, 14 Dec 2011 11:21:43 +0100 Subject: [PATCH] Take overlap into account for external dimensions --- lib/Slic3r/Layer.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/Slic3r/Layer.pm b/lib/Slic3r/Layer.pm index 322f1025c..85725eee2 100644 --- a/lib/Slic3r/Layer.pm +++ b/lib/Slic3r/Layer.pm @@ -124,7 +124,14 @@ sub make_surfaces { # the contours must be offsetted by half extrusion width inwards { - my $distance = scale $Slic3r::flow_width / 2; + my $distance = $Slic3r::flow_width / 2; + if ($Slic3r::overlap_factor) { + # our overlap is done by increasing the flow; however external perimeters will grow + # outwards, so we offset by the correct amount + $distance = ($Slic3r::flow_width + $Slic3r::overlap_factor * $Slic3r::layer_height * (1 - PI/4)) / 2; + } + $distance = scale $distance; + my @surfaces = @{$self->slices}; @{$self->slices} = (); foreach my $surface (@surfaces) {