diff options
author | Alessandro Ranellucci <aar@cpan.org> | 2011-09-03 22:47:38 +0400 |
---|---|---|
committer | Alessandro Ranellucci <aar@cpan.org> | 2011-09-03 22:47:38 +0400 |
commit | a5ba0af7efbc9123dc859885d2ebbf4cd2b5b87b (patch) | |
tree | 4af94b2146e05fe4740b0c437cf93f0c96bf919a /lib/Slic3r/STL.pm | |
parent | 74b4d8d612c48c896d8866cd400ad64ff059d919 (diff) |
Generate GCODE
Diffstat (limited to 'lib/Slic3r/STL.pm')
-rw-r--r-- | lib/Slic3r/STL.pm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Slic3r/STL.pm b/lib/Slic3r/STL.pm index dac245245..226b3832c 100644 --- a/lib/Slic3r/STL.pm +++ b/lib/Slic3r/STL.pm @@ -14,8 +14,7 @@ sub parse_file { my $self = shift; my ($file) = @_; - my $print = Slic3r::Print->new; - + # open STL file my $stl = CAD::Format::STL->new->load($file); # we only want to work with positive coordinates, so let's @@ -31,6 +30,12 @@ sub parse_file { } } + # initialize print job + my $print = Slic3r::Print->new( + x_length => ($extents[X][MAX] - $extents[X][MIN]) / $Slic3r::resolution, + y_length => ($extents[Y][MAX] - $extents[Y][MIN]) / $Slic3r::resolution, + ); + # calculate the displacements needed to # have lowest value for each axis at coordinate 0 my @shift = map 0 - $extents[$_][MIN], X,Y,Z; |