mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-06 21:44:08 -06:00
Enforce seam alignment and blend in spiral vase. #2023
This commit is contained in:
parent
254ab29a97
commit
f2c5e799b1
17 changed files with 174 additions and 33 deletions
|
@ -185,7 +185,11 @@ sub extrude_loop {
|
|||
}
|
||||
|
||||
# split the loop at the starting point
|
||||
$loop->split_at($last_pos->nearest_point(\@candidates));
|
||||
if ($self->config->spiral_vase) {
|
||||
$loop->split_at($last_pos);
|
||||
} else {
|
||||
$loop->split_at_vertex($last_pos->nearest_point(\@candidates));
|
||||
}
|
||||
|
||||
# clip the path to avoid the extruder to get exactly on the first point of the loop;
|
||||
# if polyline was shorter than the clipping distance we'd get a null polyline, so
|
||||
|
|
|
@ -43,7 +43,7 @@ sub process_layer {
|
|||
}
|
||||
});
|
||||
|
||||
#use XXX; YYY [ $gcode, $layer_height, $z, $total_layer_length ];
|
||||
#use XXX; XXX [ $gcode, $layer_height, $z, $total_layer_length ];
|
||||
# remove layer height from initial Z
|
||||
$z -= $layer_height;
|
||||
|
||||
|
@ -57,16 +57,19 @@ sub process_layer {
|
|||
my $line = $info->{raw};
|
||||
$line =~ s/ Z[.0-9]+/ Z$z/;
|
||||
$new_gcode .= "$line\n";
|
||||
} elsif ($cmd eq 'G1' && !exists $args->{Z} && $info->{dist_XY}) {
|
||||
} elsif ($cmd eq 'G1' && !exists($args->{Z}) && $info->{dist_XY}) {
|
||||
# horizontal move
|
||||
my $line = $info->{raw};
|
||||
if ($info->{extruding}) {
|
||||
$z += $info->{dist_XY} * $layer_height / $total_layer_length;
|
||||
$line =~ s/^G1 /sprintf 'G1 Z%.3f ', $z/e;
|
||||
$new_gcode .= "$line\n";
|
||||
} else {
|
||||
$new_gcode .= "$line\n";
|
||||
}
|
||||
# skip travel moves: the move to first perimeter point will
|
||||
# cause a visible seam when loops are not aligned in XY; by skipping
|
||||
# it we blend the first loop move in the XY plane (although the smoothness
|
||||
# of such blend depend on how long the first segment is; maybe we should
|
||||
# enforce some minimum length?)
|
||||
} else {
|
||||
$new_gcode .= "$info->{raw}\n";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue