New --spiral-vase option to continously raise Z when printing single-walled vases. #997

This commit is contained in:
Alessandro Ranellucci 2013-05-13 20:15:45 +02:00
parent baa1a8c736
commit ccdb29ddc9
8 changed files with 81 additions and 1 deletions

View file

@ -63,6 +63,14 @@ sub _trigger_config {
# G-code flavors
$self->config->set('extrusion_axis', 'A') if $self->config->gcode_flavor eq 'mach3';
$self->config->set('extrusion_axis', '') if $self->config->gcode_flavor eq 'no-extrusion';
# enforce some settings when spiral_vase is set
if ($self->config->spiral_vase) {
$self->config->set('perimeters', 1);
$self->config->set('fill_density', 0);
$self->config->set('top_solid_layers', 0);
$self->config->set('support_material', 0);
}
}
sub _build_has_support_material {
@ -184,6 +192,12 @@ sub validate {
}
}
}
if ($Slic3r::Config->spiral_vase) {
if ((map @{$_->copies}, @{$self->objects}) > 1) {
die "The Spiral Vase option can only be used when printing a single object.\n";
}
}
}
sub init_extruders {
@ -794,6 +808,11 @@ sub write_gcode {
));
}
# prepare the SpiralVase processor if it's possible
my $spiralvase = $Slic3r::Config->spiral_vase
? Slic3r::GCode::SpiralVase->new
: undef;
# prepare the logic to print one layer
my $skirt_done = 0; # count of skirt layers done
my $brim_done = 0;
@ -956,6 +975,14 @@ sub write_gcode {
}
}
}
# apply spiral vase post-processing if this layer contains suitable geometry
$gcode = $spiralvase->process_layer($gcode, $layer)
if defined $spiralvase
&& ($layer->id > 0 || $Slic3r::Config->brim_width == 0)
&& ($layer->id >= $Slic3r::Config->skirt_height)
&& ($layer->id >= $Slic3r::Config->bottom_solid_layers);
return $gcode;
};