mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-11-02 20:51:23 -07:00 
			
		
		
		
	Thin walls. #24
This commit is contained in:
		
							parent
							
								
									62ee79f0c9
								
							
						
					
					
						commit
						1c7564e4a4
					
				
					 12 changed files with 203 additions and 12 deletions
				
			
		| 
						 | 
				
			
			@ -30,6 +30,10 @@ has 'slices' => (
 | 
			
		|||
    default => sub { [] },
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
# collection of polygons or polylines representing thin walls contained 
 | 
			
		||||
# in the original geometry
 | 
			
		||||
has 'thin_walls' => (is => 'rw', default => sub { [] });
 | 
			
		||||
 | 
			
		||||
# collection of surfaces generated by offsetting the innermost perimeter(s)
 | 
			
		||||
# they represent boundaries of areas to fill
 | 
			
		||||
has 'fill_boundaries' => (
 | 
			
		||||
| 
						 | 
				
			
			@ -160,6 +164,19 @@ sub make_surfaces {
 | 
			
		|||
                ($_, surface_type => 'internal'),
 | 
			
		||||
                $surface->expolygon->offset_ex(-$distance);
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        # now detect thin walls by re-outgrowing offsetted surfaces and subtracting
 | 
			
		||||
        # them from the original slices
 | 
			
		||||
        my $outgrown = Math::Clipper::offset([ map $_->p, @{$self->slices} ], $distance);
 | 
			
		||||
        my $diff = diff_ex(
 | 
			
		||||
            [ map $_->p, @surfaces ],
 | 
			
		||||
            $outgrown,
 | 
			
		||||
        );
 | 
			
		||||
        
 | 
			
		||||
        push @{$self->thin_walls},
 | 
			
		||||
            grep $_,
 | 
			
		||||
            map $_->medial_axis(scale $Slic3r::flow_width),
 | 
			
		||||
            @$diff;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    if (0) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue