mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-11-02 20:51:23 -07:00 
			
		
		
		
	Refactoring: use Slic3r::Geometry::BoundingBox objects everywhere
This commit is contained in:
		
							parent
							
								
									07407e5dbd
								
							
						
					
					
						commit
						ac4a0bcdd8
					
				
					 20 changed files with 105 additions and 127 deletions
				
			
		| 
						 | 
				
			
			@ -36,7 +36,14 @@ sub bb {
 | 
			
		|||
 | 
			
		||||
sub polygon {
 | 
			
		||||
    my $self = shift;
 | 
			
		||||
    return Slic3r::Polygon->new_from_bounding_box($self->bb);
 | 
			
		||||
    
 | 
			
		||||
    my $e = $self->extents;
 | 
			
		||||
    return Slic3r::Polygon->new([
 | 
			
		||||
        [ $e->[X][MIN], $e->[Y][MIN] ],
 | 
			
		||||
        [ $e->[X][MAX], $e->[Y][MIN] ],
 | 
			
		||||
        [ $e->[X][MAX], $e->[Y][MAX] ],
 | 
			
		||||
        [ $e->[X][MIN], $e->[Y][MAX] ],
 | 
			
		||||
    ]);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# note to $self
 | 
			
		||||
| 
						 | 
				
			
			@ -84,4 +91,24 @@ sub max_point {
 | 
			
		|||
    return Slic3r::Point->new($self->extents->[X][MAX], $self->extents->[Y][MAX]);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
sub x_min {
 | 
			
		||||
    my $self = shift;
 | 
			
		||||
    return $self->extents->[X][MIN];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
sub x_max {
 | 
			
		||||
    my $self = shift;
 | 
			
		||||
    return $self->extents->[X][MAX];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
sub y_min {
 | 
			
		||||
    my $self = shift;
 | 
			
		||||
    return $self->extents->[Y][MIN];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
sub y_max {
 | 
			
		||||
    my $self = shift;
 | 
			
		||||
    return $self->extents->[Y][MAX];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
1;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue