mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-11-02 20:51:23 -07:00 
			
		
		
		
	Bugfix: some holes were skipped
This commit is contained in:
		
							parent
							
								
									4af295bce3
								
							
						
					
					
						commit
						e2a5c2119f
					
				
					 1 changed files with 8 additions and 13 deletions
				
			
		| 
						 | 
				
			
			@ -105,14 +105,7 @@ sub make_surfaces {
 | 
			
		|||
    my ($loops) = @_;
 | 
			
		||||
    
 | 
			
		||||
    {
 | 
			
		||||
        # merge contours
 | 
			
		||||
        my $expolygons = union_ex([ grep is_counter_clockwise($_), @$loops ]);
 | 
			
		||||
        
 | 
			
		||||
        # subtract holes
 | 
			
		||||
        $expolygons = union_ex([
 | 
			
		||||
            (map @$_, @$expolygons),
 | 
			
		||||
            (grep !is_counter_clockwise($_), @$loops)
 | 
			
		||||
        ]);
 | 
			
		||||
        my $expolygons = union_ex($loops);
 | 
			
		||||
        
 | 
			
		||||
        Slic3r::debugf "  %d surface(s) having %d holes detected from %d polylines\n",
 | 
			
		||||
            scalar(@$expolygons), scalar(map $_->holes, @$expolygons), scalar(@$loops);
 | 
			
		||||
| 
						 | 
				
			
			@ -134,11 +127,13 @@ sub make_surfaces {
 | 
			
		|||
        }
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    #use Slic3r::SVG;
 | 
			
		||||
    #Slic3r::SVG::output(undef, "surfaces.svg",
 | 
			
		||||
    #    polygons        => [ map $_->contour->p, @{$self->surfaces} ],
 | 
			
		||||
    #    red_polygons    => [ map $_->p, map @{$_->holes}, @{$self->surfaces} ],
 | 
			
		||||
    #);
 | 
			
		||||
    if (0) {
 | 
			
		||||
        require "Slic3r/SVG.pm";
 | 
			
		||||
        Slic3r::SVG::output(undef, "surfaces.svg",
 | 
			
		||||
            polygons        => [ map $_->contour->p, @{$self->slices} ],
 | 
			
		||||
            red_polygons    => [ map $_->p, map @{$_->holes}, @{$self->slices} ],
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
sub prepare_fill_surfaces {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue