Options to set extruder clearance for sequential printing and graphical preview of collisions

This commit is contained in:
Alessandro Ranellucci 2012-05-23 11:47:52 +02:00
parent 2c28d2f874
commit 5a78111efa
8 changed files with 113 additions and 18 deletions

View file

@ -43,6 +43,7 @@ sub new {
$self->{transparent_brush} = Wx::Brush->new(Wx::Colour->new(0,0,0), &Wx::wxTRANSPARENT);
$self->{grid_pen} = Wx::Pen->new(Wx::Colour->new(230,230,230), 1, &Wx::wxSOLID);
$self->{print_center_pen} = Wx::Pen->new(Wx::Colour->new(200,200,200), 1, &Wx::wxSOLID);
$self->{clearance_pen} = Wx::Pen->new(Wx::Colour->new(0,0,200), 1, &Wx::wxSOLID);
$self->{skirt_pen} = Wx::Pen->new(Wx::Colour->new(150,150,150), 1, &Wx::wxSOLID);
$self->{list} = Wx::ListView->new($self, -1, [-1, -1], [-1, 180], &Wx::wxLC_SINGLE_SEL | &Wx::wxLC_REPORT | &Wx::wxBORDER_DEFAULT);
@ -470,7 +471,7 @@ sub export_gcode {
},
message_dialog => sub { Wx::MessageDialog->new($self, @_)->ShowModal },
on_completed => sub { $self->on_export_completed(@_) },
catch_error => sub { Slic3r::GUI::catch_error($self, @_) },
catch_error => sub { Slic3r::GUI::catch_error($self, @_) && $self->on_export_failed },
);
}
}
@ -489,6 +490,7 @@ sub export_gcode2 {
Slic3r::Config->validate;
my $print = $self->{print};
$print->validate;
{
my @warnings = ();
@ -704,6 +706,14 @@ sub repaint {
$dc->SetBrush($parent->{objects_brush});
}
$dc->DrawPolygon($parent->_y($parent->{object_previews}->[-1][2]), 0, 0);
# if sequential printing is enabled and we have more than one object
if ($Slic3r::complete_objects && (map @$_, @{$print->copies}) > 1) {
my $clearance = +($parent->{object_previews}->[-1][2]->offset($Slic3r::extruder_clearance_radius / 2 * $parent->{scaling_factor}, 1, JT_ROUND))[0];
$dc->SetPen($parent->{clearance_pen});
$dc->SetBrush($parent->{transparent_brush});
$dc->DrawPolygon($parent->_y($clearance), 0, 0);
}
}
}

View file

@ -61,9 +61,13 @@ sub new {
},
gcode => {
title => 'G-code',
options => [qw(start_gcode end_gcode layer_gcode complete_objects gcode_comments post_process)],
options => [qw(start_gcode end_gcode layer_gcode gcode_comments post_process)],
label_width => 260,
},
sequential_printing => {
title => 'Sequential printing',
options => [qw(complete_objects extruder_clearance_radius extruder_clearance_height)],
},
extrusion => {
title => 'Extrusion',
options => [qw(extrusion_width_ratio bridge_flow_ratio)],
@ -116,7 +120,7 @@ sub new {
$make_tab->([qw(cooling)]),
$make_tab->([qw(printer filament)], [qw(print_speed speed)]),
$make_tab->([qw(gcode)]),
$make_tab->([qw(extrusion other)], [qw(output)]),
$make_tab->([qw(extrusion other sequential_printing)], [qw(output)]),
);
$tabpanel->AddPage(Slic3r::GUI::Plater->new($tabpanel), "Plater");
@ -215,6 +219,7 @@ sub do_slice {
my $print = Slic3r::Print->new;
$print->add_object_from_file($input_file);
$print->validate;
# select output file
my $output_file = $main::opt{output};