diff --git a/lib/Slic3r.pm b/lib/Slic3r.pm index 4e6d8fd48..321f863e4 100644 --- a/lib/Slic3r.pm +++ b/lib/Slic3r.pm @@ -3,7 +3,7 @@ package Slic3r; use strict; use warnings; -our $VERSION = "0.5.5b"; +our $VERSION = "0.5.6-beta"; our $debug = 0; sub debugf { diff --git a/lib/Slic3r/Layer.pm b/lib/Slic3r/Layer.pm index 04baf705c..56ede956c 100644 --- a/lib/Slic3r/Layer.pm +++ b/lib/Slic3r/Layer.pm @@ -122,6 +122,18 @@ sub make_surfaces { @$expolygons; } + # the contours must be offsetted by half extrusion width inwards + { + my $distance = scale $Slic3r::flow_width / 2; + my @surfaces = @{$self->slices}; + @{$self->slices} = (); + foreach my $surface (@surfaces) { + push @{$self->slices}, map Slic3r::Surface->cast_from_expolygon + ($_, surface_type => 'internal'), + $surface->expolygon->offset_ex(-$distance); + } + } + #use Slic3r::SVG; #Slic3r::SVG::output(undef, "surfaces.svg", # polygons => [ map $_->contour->p, @{$self->surfaces} ], diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm index 916a99ea9..90b382fb7 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -10,13 +10,11 @@ use XXX; has 'x_length' => ( is => 'ro', required => 1, - coerce => sub { sprintf '%.0f', $_[0] }, ); has 'y_length' => ( is => 'ro', required => 1, - coerce => sub { sprintf '%.0f', $_[0] }, ); has 'layers' => ( @@ -181,20 +179,6 @@ sub detect_surfaces_type { @$expolygons; }; - # the contours must be offsetted by half extrusion width inwards - { - my $distance = scale $Slic3r::flow_width / 2; - foreach my $layer (@{$self->layers}) { - my @surfaces = @{$layer->slices}; - @{$layer->slices} = (); - foreach my $surface (@surfaces) { - push @{$layer->slices}, map Slic3r::Surface->cast_from_expolygon - ($_, surface_type => 'internal'), - $surface->expolygon->offset_ex(-$distance); - } - } - } - for (my $i = 0; $i < $self->layer_count; $i++) { my $layer = $self->layers->[$i]; Slic3r::debugf "Detecting solid surfaces for layer %d\n", $layer->id;