Minor fixes to make_skirt and make_brim
This commit is contained in:
parent
4d76d05bbb
commit
08047c11eb
@ -409,16 +409,17 @@ sub export_gcode {
|
||||
my $self = shift;
|
||||
my %params = @_;
|
||||
|
||||
my $status_cb = $self->status_cb // sub {};
|
||||
# prerequisites
|
||||
$self->process;
|
||||
|
||||
# output everything to a G-code file
|
||||
my $output_file = $self->expanded_output_filepath($params{output_file});
|
||||
$status_cb->(90, "Exporting G-code" . ($output_file ? " to $output_file" : ""));
|
||||
$self->status_cb->(90, "Exporting G-code" . ($output_file ? " to $output_file" : ""));
|
||||
$self->write_gcode($params{output_fh} || $output_file);
|
||||
|
||||
# run post-processing scripts
|
||||
if (@{$self->config->post_process}) {
|
||||
$status_cb->(95, "Running post-processing scripts");
|
||||
$self->status_cb->(95, "Running post-processing scripts");
|
||||
$self->config->setenv;
|
||||
for (@{$self->config->post_process}) {
|
||||
Slic3r::debugf " '%s' '%s'\n", $_, $output_file;
|
||||
@ -528,14 +529,17 @@ sub make_skirt {
|
||||
|
||||
return if $self->step_done(STEP_SKIRT);
|
||||
$self->set_step_started(STEP_SKIRT);
|
||||
$self->status_cb->(88, "Generating skirt/brim");
|
||||
|
||||
# since this method must be idempotent, we clear skirt paths *before*
|
||||
# checking whether we need to generate them
|
||||
$self->skirt->clear;
|
||||
|
||||
return unless $self->config->skirts > 0
|
||||
|| ($self->config->ooze_prevention && @{$self->extruders} > 1);
|
||||
if ($self->config->skirts == 0
|
||||
&& (!$self->config->ooze_prevention || @{$self->extruders} == 1)) {
|
||||
$self->set_step_done(STEP_SKIRT);
|
||||
return;
|
||||
}
|
||||
$self->status_cb->(88, "Generating skirt");
|
||||
|
||||
# First off we need to decide how tall the skirt must be.
|
||||
# The skirt_height option from config is expressed in layers, but our
|
||||
@ -655,13 +659,16 @@ sub make_brim {
|
||||
|
||||
return if $self->step_done(STEP_BRIM);
|
||||
$self->set_step_started(STEP_BRIM);
|
||||
$self->status_cb->(88, "Generating skirt/brim");
|
||||
|
||||
# since this method must be idempotent, we clear brim paths *before*
|
||||
# checking whether we need to generate them
|
||||
$self->brim->clear;
|
||||
|
||||
return unless $self->config->brim_width > 0;
|
||||
if ($self->config->brim_width == 0) {
|
||||
$self->set_step_done(STEP_BRIM);
|
||||
return;
|
||||
}
|
||||
$self->status_cb->(88, "Generating brim");
|
||||
|
||||
# brim is only printed on first layer and uses support material extruder
|
||||
my $first_layer_height = $self->objects->[0]->config->get_abs_value('first_layer_height');
|
||||
|
@ -582,12 +582,14 @@ sub generate_support_material {
|
||||
|
||||
return if $self->step_done(STEP_SUPPORTMATERIAL);
|
||||
$self->set_step_started(STEP_SUPPORTMATERIAL);
|
||||
$self->print->status_cb->(85, "Generating support material");
|
||||
|
||||
$self->clear_support_layers;
|
||||
|
||||
return unless ($self->config->support_material || $self->config->raft_layers > 0)
|
||||
&& scalar(@{$self->layers}) >= 2;
|
||||
if ((!$self->config->support_material && $self->config->raft_layers == 0) || scalar(@{$self->layers}) < 2) {
|
||||
$self->set_step_done(STEP_SUPPORTMATERIAL);
|
||||
return;
|
||||
}
|
||||
$self->print->status_cb->(85, "Generating support material");
|
||||
|
||||
my $first_layer_flow = Slic3r::Flow->new_from_width(
|
||||
width => ($self->config->first_layer_extrusion_width || $self->config->support_material_extrusion_width),
|
||||
|
@ -88,10 +88,7 @@ sub export_gcode {
|
||||
my ($self) = @_;
|
||||
|
||||
$self->_before_export;
|
||||
|
||||
$self->_print->process;
|
||||
$self->_print->export_gcode(output_file => $self->output_file);
|
||||
|
||||
$self->_after_export;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user