mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 01:07:57 -06:00
Rotation around X and Y axes from plater
This commit is contained in:
parent
51cf78534c
commit
ec7bb40da9
4 changed files with 51 additions and 21 deletions
|
@ -463,13 +463,19 @@ sub translate {
|
|||
$self->_bounding_box->translate(@shift) if defined $self->_bounding_box;
|
||||
}
|
||||
|
||||
sub rotate_x {
|
||||
my ($self, $angle) = @_;
|
||||
sub rotate {
|
||||
my ($self, $angle, $axis) = @_;
|
||||
|
||||
# we accept angle in radians but mesh currently uses degrees
|
||||
$angle = rad2deg($angle);
|
||||
|
||||
$_->mesh->rotate_x($angle) for @{$self->volumes};
|
||||
if ($axis == X) {
|
||||
$_->mesh->rotate_x($angle) for @{$self->volumes};
|
||||
} elsif ($axis == Y) {
|
||||
$_->mesh->rotate_y($angle) for @{$self->volumes};
|
||||
} elsif ($axis == Z) {
|
||||
$_->mesh->rotate_z($angle) for @{$self->volumes};
|
||||
}
|
||||
$self->invalidate_bounding_box;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue