mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 08:47:52 -06:00
Ported ModelObject::rotate() and ModelObject::flip() to XS, as well as axes constants
This commit is contained in:
parent
be2f46ca68
commit
5eb3bc52ef
11 changed files with 84 additions and 46 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue