mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-23 22:54:08 -06:00
Show vertical projection instead of convex hull for objects with <= 2000 facets. #780
This commit is contained in:
parent
e6afebb982
commit
116ab446e3
3 changed files with 76 additions and 16 deletions
|
@ -164,6 +164,11 @@ sub simplify {
|
|||
$_->simplify(@_) for @$self;
|
||||
}
|
||||
|
||||
sub scale {
|
||||
my $self = shift;
|
||||
$_->scale(@_) for @$self;
|
||||
}
|
||||
|
||||
sub translate {
|
||||
my $self = shift;
|
||||
$_->translate(@_) for @$self;
|
||||
|
@ -300,4 +305,34 @@ sub medial_axis {
|
|||
return @result;
|
||||
}
|
||||
|
||||
package Slic3r::ExPolygon::Collection;
|
||||
use Moo;
|
||||
use Slic3r::Geometry qw(X1 Y1);
|
||||
|
||||
has 'expolygons' => (is => 'ro', default => sub { [] });
|
||||
|
||||
sub clone {
|
||||
my $self = shift;
|
||||
return (ref $self)->new(
|
||||
expolygons => [ map $_->clone, @{$self->expolygons} ],
|
||||
);
|
||||
}
|
||||
|
||||
sub align_to_origin {
|
||||
my $self = shift;
|
||||
|
||||
my @bb = Slic3r::Geometry::bounding_box([ map @$_, map @$_, @{$self->expolygons} ]);
|
||||
$_->translate(-$bb[X1], -$bb[Y1]) for @{$self->expolygons};
|
||||
}
|
||||
|
||||
sub rotate {
|
||||
my $self = shift;
|
||||
$_->rotate(@_) for @{$self->expolygons};
|
||||
}
|
||||
|
||||
sub size {
|
||||
my $self = shift;
|
||||
return [ Slic3r::Geometry::size_2D([ map @$_, map @$_, @{$self->expolygons} ]) ];
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue