mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 09:17:52 -06:00
Fix external motionplanner too
This commit is contained in:
parent
f1230312e3
commit
ad48fdc7f9
1 changed files with 11 additions and 7 deletions
|
@ -63,8 +63,8 @@ sub set_shift {
|
||||||
my @shift = @_;
|
my @shift = @_;
|
||||||
|
|
||||||
$self->last_pos->translate(
|
$self->last_pos->translate(
|
||||||
scale ($shift[X] - $self->shift_x),
|
scale ($self->shift_x - $shift[X]),
|
||||||
scale ($shift[Y] - $self->shift_y),
|
scale ($self->shift_y - $shift[Y]),
|
||||||
);
|
);
|
||||||
|
|
||||||
$self->shift_x($shift[X]);
|
$self->shift_x($shift[X]);
|
||||||
|
@ -265,7 +265,6 @@ sub travel_to {
|
||||||
$self->speed('travel');
|
$self->speed('travel');
|
||||||
my $gcode = "";
|
my $gcode = "";
|
||||||
if ($Slic3r::Config->avoid_crossing_perimeters && $self->last_pos->distance_to($point) > scale 5 && !$self->straight_once) {
|
if ($Slic3r::Config->avoid_crossing_perimeters && $self->last_pos->distance_to($point) > scale 5 && !$self->straight_once) {
|
||||||
$point = $point->clone;
|
|
||||||
my $plan = sub {
|
my $plan = sub {
|
||||||
my $mp = shift;
|
my $mp = shift;
|
||||||
return join '',
|
return join '',
|
||||||
|
@ -274,11 +273,16 @@ sub travel_to {
|
||||||
};
|
};
|
||||||
|
|
||||||
if ($self->new_object) {
|
if ($self->new_object) {
|
||||||
my @shift = ($self->shift_x, $self->shift_y);
|
|
||||||
$self->set_shift(0,0);
|
|
||||||
$point->translate(map scale $_, @shift);
|
|
||||||
$gcode .= $plan->($self->external_mp);
|
|
||||||
$self->new_object(0);
|
$self->new_object(0);
|
||||||
|
|
||||||
|
# represent $point in G-code coordinates
|
||||||
|
$point = $point->clone;
|
||||||
|
my @shift = ($self->shift_x, $self->shift_y);
|
||||||
|
$point->translate(map scale $_, @shift);
|
||||||
|
|
||||||
|
# calculate path (external_mp uses G-code coordinates so we temporary need a null shift)
|
||||||
|
$self->set_shift(0,0);
|
||||||
|
$gcode .= $plan->($self->external_mp);
|
||||||
$self->set_shift(@shift);
|
$self->set_shift(@shift);
|
||||||
} else {
|
} else {
|
||||||
$gcode .= $plan->($self->layer_mp);
|
$gcode .= $plan->($self->layer_mp);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue