mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-11-02 20:51:23 -07:00 
			
		
		
		
	Use dclone() in Polyline and ExPolygon too
This commit is contained in:
		
							parent
							
								
									8061cc6e30
								
							
						
					
					
						commit
						72f77a3420
					
				
					 2 changed files with 4 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -9,6 +9,7 @@ use List::Util qw(first);
 | 
			
		|||
use Math::Geometry::Voronoi;
 | 
			
		||||
use Slic3r::Geometry qw(X Y A B point_in_polygon same_line epsilon);
 | 
			
		||||
use Slic3r::Geometry::Clipper qw(union_ex JT_MITER);
 | 
			
		||||
use Storable qw();
 | 
			
		||||
 | 
			
		||||
# the constructor accepts an array of polygons 
 | 
			
		||||
# or a Math::Clipper ExPolygon (hashref)
 | 
			
		||||
| 
						 | 
				
			
			@ -28,8 +29,7 @@ sub new {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
sub clone {
 | 
			
		||||
    my $self = shift;
 | 
			
		||||
    return (ref $self)->new(map $_->clone, @$self);
 | 
			
		||||
    Storable::dclone($_[0])
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
sub contour {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,6 +6,7 @@ use Scalar::Util qw(reftype);
 | 
			
		|||
use Slic3r::Geometry qw(A B X Y X1 X2 Y1 Y2 polyline_remove_parallel_continuous_edges polyline_remove_acute_vertices
 | 
			
		||||
    polyline_lines move_points same_point);
 | 
			
		||||
use Slic3r::Geometry::Clipper qw(JT_SQUARE);
 | 
			
		||||
use Storable qw();
 | 
			
		||||
 | 
			
		||||
# the constructor accepts an array(ref) of points
 | 
			
		||||
sub new {
 | 
			
		||||
| 
						 | 
				
			
			@ -18,8 +19,7 @@ sub new {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
sub clone {
 | 
			
		||||
    my $self = shift;
 | 
			
		||||
    return (ref $self)->new(map $_->clone, @$self);
 | 
			
		||||
    Storable::dclone($_[0])
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
sub serialize {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue