More incomplete work to make the plater work with XS data
This commit is contained in:
parent
8d171a297e
commit
1506907212
@ -329,7 +329,10 @@ sub scale {
|
|||||||
|
|
||||||
sub rotate {
|
sub rotate {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
$_->rotate(@_) for @{$self->expolygons};
|
my ($angle, $center) = @_;
|
||||||
|
|
||||||
|
$center = Slic3r::Point::XS->new(@$center) if ref($center) ne 'Slic3r::Point::XS';
|
||||||
|
$_->rotate($angle, $center) for @{$self->expolygons};
|
||||||
$self;
|
$self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -374,7 +374,7 @@ sub rad2deg_dir {
|
|||||||
|
|
||||||
sub rotate_points {
|
sub rotate_points {
|
||||||
my ($radians, $center, @points) = @_;
|
my ($radians, $center, @points) = @_;
|
||||||
$center ||= [0,0];
|
$center //= [0,0];
|
||||||
return map {
|
return map {
|
||||||
[
|
[
|
||||||
$center->[X] + cos($radians) * ($_->[X] - $center->[X]) - sin($radians) * ($_->[Y] - $center->[Y]),
|
$center->[X] + cos($radians) * ($_->[X] - $center->[X]) - sin($radians) * ($_->[Y] - $center->[Y]),
|
||||||
|
Loading…
Reference in New Issue
Block a user