mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-11-02 20:51:23 -07:00 
			
		
		
		
	Refactoring, new size_3D function
This commit is contained in:
		
							parent
							
								
									b5672de3ca
								
							
						
					
					
						commit
						82ac4722d2
					
				
					 2 changed files with 9 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -20,7 +20,7 @@ our @EXPORT_OK = qw(
 | 
			
		|||
    shortest_path collinear scale unscale merge_collinear_lines
 | 
			
		||||
    rad2deg_dir bounding_box_center line_intersects_any douglas_peucker
 | 
			
		||||
    polyline_remove_short_segments normal triangle_normal polygon_is_convex
 | 
			
		||||
    scaled_epsilon bounding_box_3D
 | 
			
		||||
    scaled_epsilon bounding_box_3D size_3D
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -721,6 +721,13 @@ sub bounding_box_3D {
 | 
			
		|||
    return @extents;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
sub size_3D {
 | 
			
		||||
    my ($points) = @_;
 | 
			
		||||
    
 | 
			
		||||
    my @extents = bounding_box_3D($points);
 | 
			
		||||
    return map $extents[$_][MAX] - $extents[$_][MIN], (X,Y,Z);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
sub angle3points {
 | 
			
		||||
    my ($p1, $p2, $p3) = @_;
 | 
			
		||||
    # p1 is the center
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -386,9 +386,7 @@ sub extents {
 | 
			
		|||
 | 
			
		||||
sub size {
 | 
			
		||||
    my $self = shift;
 | 
			
		||||
    
 | 
			
		||||
    my @extents = $self->extents;
 | 
			
		||||
    return map $extents[$_][MAX] - $extents[$_][MIN], (X,Y,Z);
 | 
			
		||||
    return Slic3r::Geometry::size_3D($self->vertices);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
sub slice_facet {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue