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; * retraction;
* skirt (with rounded corners); * skirt (with rounded corners);
* use relative or absolute extrusion commands; * use relative or absolute extrusion commands;
* high-res perimeters (like the "Skin" plugin for Skeinforge);
* center print around bed center point; * center print around bed center point;
* multiple solid layers near horizontal external surfaces; * multiple solid layers near horizontal external surfaces;
* ability to scale, rotate and multiply input object; * ability to scale, rotate and multiply input object;

View File

@ -45,9 +45,10 @@ our $perimeter_feed_rate = 30; # mm/sec
our $bottom_layer_speed_ratio = 0.3; our $bottom_layer_speed_ratio = 0.3;
# accuracy options # accuracy options
our $resolution = 0.00000001; our $resolution = 0.00000001;
our $layer_height = 0.4; our $layer_height = 0.4;
our $thickness_ratio = 1; our $high_res_perimeters = 0;
our $thickness_ratio = 1;
our $flow_width; our $flow_width;
# print options # print options

View File

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

View File

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

View File

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

View File

@ -211,6 +211,18 @@ sub export_gcode {
# write gcode commands layer by layer # write gcode commands layer by layer
foreach my $layer (@{ $self->layers }) { 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 # go to layer
printf $fh $extruder->move_z($Slic3r::z_offset + $layer->z * $Slic3r::resolution); printf $fh $extruder->move_z($Slic3r::z_offset + $layer->z * $Slic3r::resolution);

View File

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