Merge branch 'master' of github.com:alexrj/Slic3r

This commit is contained in:
Alessandro Ranellucci 2013-04-04 01:15:46 +02:00
commit a563801304
3 changed files with 11 additions and 7 deletions

View File

@ -248,7 +248,7 @@ sub extrude_path {
$gcode .= $self->G1($line->[B], undef, $e * $line_length, $description); $gcode .= $self->G1($line->[B], undef, $e * $line_length, $description);
} }
$self->wipe_path(Slic3r::Polyline->new([ reverse @{$path->points} ])) $self->wipe_path(Slic3r::Polyline->new([ reverse @{$path->points} ]))
if $Slic3r::Config->wipe; if $self->extruder->wipe;
} }
if ($Slic3r::Config->cooling) { if ($Slic3r::Config->cooling) {
@ -358,7 +358,7 @@ sub retract {
# wipe # wipe
my $wipe_path; my $wipe_path;
if ($Slic3r::Config->wipe && $self->wipe_path) { if ($self->extruder->wipe && $self->wipe_path) {
$wipe_path = Slic3r::Polyline->new([ $self->last_pos, @{$self->wipe_path}[1..$#{$self->wipe_path}] ]) $wipe_path = Slic3r::Polyline->new([ $self->last_pos, @{$self->wipe_path}[1..$#{$self->wipe_path}] ])
->clip_start($self->extruder->scaled_wipe_distance); ->clip_start($self->extruder->scaled_wipe_distance);
} }
@ -385,11 +385,11 @@ sub retract {
my $travel = [undef, $params{move_z}, $retract->[2], "change layer and $comment"]; my $travel = [undef, $params{move_z}, $retract->[2], "change layer and $comment"];
$gcode .= $self->G0(@$travel); $gcode .= $self->G0(@$travel);
} else { } else {
if ($wipe_path) { # check that we have a positive wipe length
if ($wipe_path && (my $total_wipe_length = $wipe_path->length)) {
$self->speed('travel'); $self->speed('travel');
# subdivide the retraction
my $total_wipe_length = $wipe_path->length;
# subdivide the retraction
for (1 .. $#$wipe_path) { for (1 .. $#$wipe_path) {
my $segment_length = $wipe_path->[$_-1]->distance_to($wipe_path->[$_]); my $segment_length = $wipe_path->[$_-1]->distance_to($wipe_path->[$_]);
$gcode .= $self->G1($wipe_path->[$_], undef, $retract->[2] * ($segment_length / $total_wipe_length), $retract->[3] . ";_WIPE"); $gcode .= $self->G1($wipe_path->[$_], undef, $retract->[2] * ($segment_length / $total_wipe_length), $retract->[3] . ";_WIPE");

View File

@ -243,7 +243,9 @@ sub config_wizard {
return unless $self->check_unsaved_changes; return unless $self->check_unsaved_changes;
if (my $config = Slic3r::GUI::ConfigWizard->new($self)->run) { if (my $config = Slic3r::GUI::ConfigWizard->new($self)->run) {
$_->select_default_preset for values %{$self->{options_tabs}}; if ($self->{mode} eq 'expert') {
$_->select_default_preset for values %{$self->{options_tabs}};
}
$self->load_config($config); $self->load_config($config);
} }
} }

View File

@ -151,7 +151,9 @@ sub validate {
{ {
my @points = map [ @$_[X,Y] ], map @{$_->vertices}, @{$self->objects->[$obj_idx]->meshes}; my @points = map [ @$_[X,Y] ], map @{$_->vertices}, @{$self->objects->[$obj_idx]->meshes};
my $convex_hull = Slic3r::Polygon->new(convex_hull(\@points)); my $convex_hull = Slic3r::Polygon->new(convex_hull(\@points));
($clearance) = offset([$convex_hull], scale $Slic3r::Config->extruder_clearance_radius / 2, 1, JT_ROUND); ($clearance) = map Slic3r::Polygon->new($_),
Slic3r::Geometry::Clipper::offset(
[$convex_hull], scale $Slic3r::Config->extruder_clearance_radius / 2, 1, JT_ROUND);
} }
for my $copy (@{$self->objects->[$obj_idx]->copies}) { for my $copy (@{$self->objects->[$obj_idx]->copies}) {
my $copy_clearance = $clearance->clone; my $copy_clearance = $clearance->clone;