mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 20:21:12 -06:00 
			
		
		
		
	Ported Polygon->is_valid() and ExPolygon->is_valid()
This commit is contained in:
		
							parent
							
								
									da0b85c0d9
								
							
						
					
					
						commit
						fe42427a54
					
				
					 13 changed files with 37 additions and 54 deletions
				
			
		|  | @ -4,7 +4,7 @@ use strict; | |||
| use warnings; | ||||
| 
 | ||||
| use Slic3r::XS; | ||||
| use Test::More tests => 20; | ||||
| use Test::More tests => 21; | ||||
| 
 | ||||
| use constant PI => 4 * atan2(1, 1); | ||||
| 
 | ||||
|  | @ -23,6 +23,7 @@ my $hole_in_square = [  # cw | |||
| 
 | ||||
| my $expolygon = Slic3r::ExPolygon->new($square, $hole_in_square); | ||||
| 
 | ||||
| ok $expolygon->is_valid, 'is_valid'; | ||||
| is ref($expolygon->pp), 'ARRAY', 'expolygon pp is unblessed'; | ||||
| is_deeply $expolygon->pp, [$square, $hole_in_square], 'expolygon roundtrip'; | ||||
| 
 | ||||
|  |  | |||
|  | @ -4,7 +4,7 @@ use strict; | |||
| use warnings; | ||||
| 
 | ||||
| use Slic3r::XS; | ||||
| use Test::More tests => 12; | ||||
| use Test::More tests => 13; | ||||
| 
 | ||||
| my $square = [  # ccw | ||||
|     [100, 100], | ||||
|  | @ -14,6 +14,7 @@ my $square = [  # ccw | |||
| ]; | ||||
| 
 | ||||
| my $polygon = Slic3r::Polygon->new(@$square); | ||||
| ok $polygon->is_valid, 'is_valid'; | ||||
| is_deeply $polygon->pp, $square, 'polygon roundtrip'; | ||||
| 
 | ||||
| is ref($polygon->arrayref), 'ARRAY', 'polygon arrayref is unblessed'; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Alessandro Ranellucci
						Alessandro Ranellucci