Avoid expensive TriangleMesh BUILD method during clone.
Gives 6% speedup and uses less memory when slicing yoda.stl and should give significantly bigger speedup on more complex models and plates.
This commit is contained in:
parent
a86c48d85c
commit
7979dd9e9c
@ -3,6 +3,7 @@ use Moo;
|
||||
|
||||
use Slic3r::Geometry qw(X Y Z A B unscale same_point);
|
||||
use Slic3r::Geometry::Clipper qw(union_ex);
|
||||
use Storable;
|
||||
|
||||
# public
|
||||
has 'vertices' => (is => 'ro', required => 1); # id => [$x,$y,$z]
|
||||
@ -92,11 +93,7 @@ sub merge {
|
||||
}
|
||||
|
||||
sub clone {
|
||||
my $self = shift;
|
||||
return (ref $self)->new(
|
||||
vertices => [ map [ @$_ ], @{$self->vertices} ],
|
||||
facets => [ map [ @$_ ], @{$self->facets} ],
|
||||
);
|
||||
Storable::dclone($_[0])
|
||||
}
|
||||
|
||||
sub _facet_edges {
|
||||
|
Loading…
Reference in New Issue
Block a user