More integration of Slic3r::Point::XS
This commit is contained in:
parent
159a009f96
commit
c9749ca3b3
9 changed files with 80 additions and 17 deletions
|
@ -270,7 +270,7 @@ sub extrude_path {
|
|||
# go to first point of extrusion path
|
||||
my $gcode = "";
|
||||
$gcode .= $self->travel_to($path->points->[0], $path->role, "move to first $description point")
|
||||
if !$self->last_pos || !$self->last_pos->coincides_with($path->points->[0]);
|
||||
if !defined $self->last_pos || !$self->last_pos->coincides_with($path->points->[0]);
|
||||
|
||||
# compensate retraction
|
||||
$gcode .= $self->unretract;
|
||||
|
|
|
@ -386,7 +386,10 @@ sub rotate_points {
|
|||
|
||||
sub move_points {
|
||||
my ($shift, @points) = @_;
|
||||
return map Slic3r::Point->new($shift->[X] + $_->[X], $shift->[Y] + $_->[Y]), @points;
|
||||
return map {
|
||||
my @p = @$_;
|
||||
Slic3r::Point->new($shift->[X] + $p[X], $shift->[Y] + $p[Y]);
|
||||
} @points;
|
||||
}
|
||||
|
||||
sub move_points_3D {
|
||||
|
|
|
@ -12,7 +12,6 @@ sub new {
|
|||
my $self;
|
||||
$self = [ @_ ];
|
||||
bless $self, $class;
|
||||
bless $_, 'Slic3r::Point' for @$self;
|
||||
return $self;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ sub new {
|
|||
}
|
||||
|
||||
sub clone {
|
||||
Storable::dclone($_[0])
|
||||
return Slic3r::Point::XS->new(@{$_[0]});
|
||||
}
|
||||
|
||||
sub threadsafe_clone {
|
||||
|
|
|
@ -243,7 +243,7 @@ sub chained_path {
|
|||
: [ map { $_->[0], $_->[-1] } @my_paths ];
|
||||
while (@my_paths) {
|
||||
# find nearest point
|
||||
my $start_index = $start_near
|
||||
my $start_index = defined $start_near
|
||||
? Slic3r::Geometry::nearest_point_index($start_near, $endpoints)
|
||||
: 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue