mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 20:21:12 -06:00 
			
		
		
		
	Very large refactoring. Ditched Slic3r::Polyline::Closed and reorganized geometric classes.
This commit is contained in:
		
							parent
							
								
									2def6a9787
								
							
						
					
					
						commit
						8ed91a8ec4
					
				
					 20 changed files with 293 additions and 349 deletions
				
			
		|  | @ -30,7 +30,7 @@ sub make_perimeter { | |||
|      | ||||
|     # organize perimeter surfaces using a shortest path search | ||||
|     my @surfaces = @{shortest_path([ | ||||
|         map [ $_->contour->points->[0], $_ ], @{$layer->slices}, | ||||
|         map [ $_->contour->[0], $_ ], @{$layer->slices}, | ||||
|     ])}; | ||||
|      | ||||
|     foreach my $surface (@surfaces) { | ||||
|  | @ -50,9 +50,7 @@ sub make_perimeter { | |||
|          | ||||
|         # create one more offset to be used as boundary for fill | ||||
|         { | ||||
|             my @fill_boundaries = map Slic3r::Surface->cast_from_expolygon | ||||
|                 ($_, surface_type => $surface->surface_type), | ||||
|                 map $_->offset_ex(-$distance), @last_offsets; | ||||
|             my @fill_boundaries = map $_->offset_ex(-$distance), @last_offsets; | ||||
|              | ||||
|             # TODO: diff(offset(@last_offsets, -$distance/2), offset(@fill_boundaries, +$distance/2)) | ||||
|             # this represents the small gaps that we need to treat like thin polygons, | ||||
|  | @ -66,12 +64,12 @@ sub make_perimeter { | |||
|     foreach my $island (@perimeters) { | ||||
|         # do holes starting from innermost one | ||||
|         foreach my $hole (map $_->holes, map @$_, @$island) { | ||||
|             push @{ $layer->perimeters }, Slic3r::ExtrusionLoop->cast($hole, role => 'perimeter'); | ||||
|             push @{ $layer->perimeters }, Slic3r::ExtrusionLoop->new(polygon => $hole, role => 'perimeter'); | ||||
|         } | ||||
|          | ||||
|         # do contours starting from innermost one | ||||
|         foreach my $contour (map $_->contour, map @$_, reverse @$island) { | ||||
|             push @{ $layer->perimeters }, Slic3r::ExtrusionLoop->cast($contour, role => 'perimeter'); | ||||
|             push @{ $layer->perimeters }, Slic3r::ExtrusionLoop->new(polygon => $contour, role => 'perimeter'); | ||||
|         } | ||||
|     } | ||||
|      | ||||
|  | @ -83,9 +81,9 @@ sub make_perimeter { | |||
|     # add thin walls as perimeters | ||||
|     for (@{ $layer->thin_walls }) { | ||||
|         if ($_->isa('Slic3r::Polygon')) { | ||||
|             push @{ $layer->perimeters }, Slic3r::ExtrusionLoop->cast($_, role => 'perimeter'); | ||||
|             push @{ $layer->perimeters }, Slic3r::ExtrusionLoop->new(polygon => $_, role => 'perimeter'); | ||||
|         } else { | ||||
|             push @{ $layer->perimeters }, Slic3r::ExtrusionPath->cast($_->points, role => 'perimeter'); | ||||
|             push @{ $layer->perimeters }, Slic3r::ExtrusionPath->new(polyline => $_->points, role => 'perimeter'); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Alessandro Ranellucci
						Alessandro Ranellucci