mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 04:31:15 -06:00 
			
		
		
		
	Apply Douglas-Peucker to all paths before generating G-code
This commit is contained in:
		
							parent
							
								
									08700aa942
								
							
						
					
					
						commit
						a66e8e547d
					
				
					 5 changed files with 6 additions and 4 deletions
				
			
		|  | @ -15,7 +15,7 @@ use Slic3r::Geometry qw(PI X Y epsilon deg2rad rotate_points); | |||
| has 'polyline' => ( | ||||
|     is          => 'rw', | ||||
|     required    => 1, | ||||
|     handles     => [qw(merge_continuous_lines lines length reverse clip_end)], | ||||
|     handles     => [qw(merge_continuous_lines lines length reverse clip_end simplify)], | ||||
| ); | ||||
| 
 | ||||
| # height is the vertical thickness of the extrusion expressed in mm | ||||
|  |  | |||
|  | @ -126,6 +126,7 @@ sub extrude_path { | |||
|     my ($path, $description, $recursive) = @_; | ||||
|      | ||||
|     $path = $path->unpack if $path->isa('Slic3r::ExtrusionPath::Packed'); | ||||
|     $path->simplify(&Slic3r::SCALED_RESOLUTION); | ||||
|      | ||||
|     # detect arcs | ||||
|     if ($Slic3r::Config->gcode_arcs && !$recursive) { | ||||
|  |  | |||
|  | @ -228,7 +228,7 @@ sub make_perimeters { | |||
|         # create one more offset to be used as boundary for fill | ||||
|         { | ||||
|             my @fill_boundaries = map $_->offset_ex(-$distance), @last_offsets; | ||||
|             $_->simplify(scale &Slic3r::RESOLUTION) for @fill_boundaries; | ||||
|             $_->simplify(&Slic3r::SCALED_RESOLUTION) for @fill_boundaries; | ||||
|             push @{ $self->surfaces }, @fill_boundaries; | ||||
|         } | ||||
|          | ||||
|  |  | |||
|  | @ -341,7 +341,7 @@ sub export_gcode { | |||
|     # simplify slices (both layer and region slices), | ||||
|     # we only need the max resolution for perimeters | ||||
|     foreach my $layer (map @{$_->layers}, @{$self->objects}) { | ||||
|         $_->simplify(scale &Slic3r::RESOLUTION) | ||||
|         $_->simplify(&Slic3r::SCALED_RESOLUTION) | ||||
|             for @{$layer->slices}, (map $_->expolygon, map @{$_->slices}, @{$layer->regions}); | ||||
|     } | ||||
|      | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Alessandro Ranellucci
						Alessandro Ranellucci