mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-15 10:45:55 +08:00
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 qw(X Y Z A B unscale same_point);
|
||||||
use Slic3r::Geometry::Clipper qw(union_ex);
|
use Slic3r::Geometry::Clipper qw(union_ex);
|
||||||
|
use Storable;
|
||||||
|
|
||||||
# public
|
# public
|
||||||
has 'vertices' => (is => 'ro', required => 1); # id => [$x,$y,$z]
|
has 'vertices' => (is => 'ro', required => 1); # id => [$x,$y,$z]
|
||||||
@ -92,11 +93,7 @@ sub merge {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub clone {
|
sub clone {
|
||||||
my $self = shift;
|
Storable::dclone($_[0])
|
||||||
return (ref $self)->new(
|
|
||||||
vertices => [ map [ @$_ ], @{$self->vertices} ],
|
|
||||||
facets => [ map [ @$_ ], @{$self->facets} ],
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub _facet_edges {
|
sub _facet_edges {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user