New option to shift Z coordinates

This commit is contained in:
Alessandro Ranellucci 2011-09-26 15:59:03 +02:00
parent 92eb3ea365
commit 8d13d4b21e
3 changed files with 5 additions and 1 deletions

View File

@ -29,6 +29,7 @@ use Slic3r::Surface::Collection;
our $nozzle_diameter = 0.45; our $nozzle_diameter = 0.45;
our $print_center = [100,100]; # object will be centered around this point our $print_center = [100,100]; # object will be centered around this point
our $use_relative_e_distances = 0; our $use_relative_e_distances = 0;
our $z_offset = 0;
# filament options # filament options
our $filament_diameter = 3; # mm our $filament_diameter = 3; # mm

View File

@ -187,7 +187,7 @@ sub export_gcode {
foreach my $layer (@{ $self->layers }) { foreach my $layer (@{ $self->layers }) {
# go to layer # go to layer
printf $fh $extruder->move_z($layer->z * $Slic3r::resolution); printf $fh $extruder->move_z($Slic3r::z_offset + $layer->z * $Slic3r::resolution);
# extrude skirts # extrude skirts
printf $fh $extruder->extrude_loop($_, 'skirt') for @{ $layer->skirts }; printf $fh $extruder->extrude_loop($_, 'skirt') for @{ $layer->skirts };

View File

@ -24,6 +24,7 @@ GetOptions(
'nozzle-diameter=f' => \$Slic3r::nozzle_diameter, 'nozzle-diameter=f' => \$Slic3r::nozzle_diameter,
'print-center=s' => \$Slic3r::print_center, 'print-center=s' => \$Slic3r::print_center,
'use-relative-e-distances' => \$Slic3r::use_relative_e_distances, 'use-relative-e-distances' => \$Slic3r::use_relative_e_distances,
'z-offset=f' => \$Slic3r::z_offset,
# filament options # filament options
'filament-diameter=f' => \$Slic3r::filament_diameter, 'filament-diameter=f' => \$Slic3r::filament_diameter,
@ -137,6 +138,8 @@ Usage: slic3r.pl [ OPTIONS ] file.stl
(default: 100,100) (default: 100,100)
--use-relative-e-distances --use-relative-e-distances
Use relative distances for extrusion in GCODE output Use relative distances for extrusion in GCODE output
--z-offset Additional height in mm to add to vertical coordinates
(+/-, default: $Slic3r::z_offset)
Filament options: Filament options:
--filament-diameter Diameter of your raw filament (default: $Slic3r::filament_diameter) --filament-diameter Diameter of your raw filament (default: $Slic3r::filament_diameter)