mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-23 14:44:19 -06:00
Generate GCODE
This commit is contained in:
parent
74b4d8d612
commit
a5ba0af7ef
6 changed files with 139 additions and 4 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue