mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 02:22:17 +00:00
Ported ModelObject::rotate() and ModelObject::flip() to XS, as well as axes constants
This commit is contained in:
@@ -262,37 +262,6 @@ sub add_instance {
|
||||
}
|
||||
}
|
||||
|
||||
sub rotate {
|
||||
my ($self, $angle, $axis) = @_;
|
||||
|
||||
# we accept angle in radians but mesh currently uses degrees
|
||||
$angle = rad2deg($angle);
|
||||
|
||||
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->set_origin_translation(Slic3r::Pointf3->new(0,0,0));
|
||||
$self->invalidate_bounding_box;
|
||||
}
|
||||
|
||||
sub flip {
|
||||
my ($self, $axis) = @_;
|
||||
|
||||
if ($axis == X) {
|
||||
$_->mesh->flip_x for @{$self->volumes};
|
||||
} elsif ($axis == Y) {
|
||||
$_->mesh->flip_y for @{$self->volumes};
|
||||
} elsif ($axis == Z) {
|
||||
$_->mesh->flip_z for @{$self->volumes};
|
||||
}
|
||||
$self->set_origin_translation(Slic3r::Pointf3->new(0,0,0));
|
||||
$self->invalidate_bounding_box;
|
||||
}
|
||||
|
||||
sub mesh_stats {
|
||||
my $self = shift;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user