Merge branch 'high-res-perimeters'

Conflicts:
	lib/Slic3r/Extruder.pm
This commit is contained in:
Alessandro Ranellucci 2011-10-06 20:09:50 +02:00
commit 1cb515a8e5
7 changed files with 28 additions and 4 deletions

View File

@ -40,6 +40,7 @@ Slic3r current features are:
* retraction;
* skirt (with rounded corners);
* use relative or absolute extrusion commands;
* high-res perimeters (like the "Skin" plugin for Skeinforge);
* center print around bed center point;
* multiple solid layers near horizontal external surfaces;
* ability to scale, rotate and multiply input object;

View File

@ -47,6 +47,7 @@ our $bottom_layer_speed_ratio = 0.3;
# accuracy options
our $resolution = 0.00000001;
our $layer_height = 0.4;
our $high_res_perimeters = 0;
our $thickness_ratio = 1;
our $flow_width;

View File

@ -59,6 +59,10 @@ our $Options = {
label => 'Layer height (mm)',
type => 'f',
},
'high_res_perimeters' => {
label => 'High-res perimeters',
type => 'bool',
},
# print options
'perimeter_offsets' => {

View File

@ -4,6 +4,7 @@ use Moo;
has 'shift_x' => (is => 'ro', default => sub {0} );
has 'shift_y' => (is => 'ro', default => sub {0} );
has 'z' => (is => 'rw', default => sub {0} );
has 'flow_ratio' => (is => 'rw', default => sub {1});
has 'extrusion_distance' => (is => 'rw', default => sub {0} );
has 'retracted' => (is => 'rw', default => sub {1} ); # this spits out some plastic at start
@ -90,6 +91,7 @@ sub extrude {
my $e = $line->a->distance_to($line->b) * $Slic3r::resolution
* (($Slic3r::nozzle_diameter**2) / ($Slic3r::filament_diameter ** 2))
* $Slic3r::thickness_ratio
* $self->flow_ratio
* $Slic3r::filament_packing_density;
$gcode .= $self->G1($line->b, undef, $e, $description);

View File

@ -29,7 +29,7 @@ sub new {
),
accuracy => Slic3r::GUI::OptionsGroup->new($self,
title => 'Accuracy',
options => [qw(layer_height)],
options => [qw(layer_height high_res_perimeters)],
),
print => Slic3r::GUI::OptionsGroup->new($self,
title => 'Print settings',

View File

@ -211,6 +211,18 @@ sub export_gcode {
# write gcode commands layer by layer
foreach my $layer (@{ $self->layers }) {
# with the --high-res-perimeters options enabled we extrude perimeters for
# each layer twice at half height
if ($Slic3r::high_res_perimeters && $layer->id > 0) {
# go to half-layer
printf $fh $extruder->move_z($Slic3r::z_offset + $layer->z * $Slic3r::resolution - $Slic3r::layer_height/2);
# extrude perimeters
$extruder->flow_ratio(0.5);
printf $fh $extruder->extrude_loop($_, 'perimeter') for @{ $layer->perimeters };
$extruder->flow_ratio(1);
}
# go to layer
printf $fh $extruder->move_z($Slic3r::z_offset + $layer->z * $Slic3r::resolution);

View File

@ -40,6 +40,7 @@ GetOptions(
# accuracy options
'layer-height=f' => \$Slic3r::layer_height,
'high-res-perimeters' => \$Slic3r::high_res_perimeters,
# print options
'perimeters=i' => \$Slic3r::perimeter_offsets,
@ -139,6 +140,9 @@ Usage: slic3r.pl [ OPTIONS ] file.stl
Accuracy options:
--layer-height Layer height in mm (default: $Slic3r::layer_height)
--high-res-perimeters
Print perimeters at half layer height to get surface accuracy
(default: disabled)
Print options:
--perimeters Number of perimeters/horizontal skins (range: 1+,