Generate GCODE

This commit is contained in:
Alessandro Ranellucci 2011-09-03 20:47:38 +02:00
parent 74b4d8d612
commit a5ba0af7ef
6 changed files with 139 additions and 4 deletions

View file

@ -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;