mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 20:21:12 -06:00 
			
		
		
		
	New --bridge-feed-rate option. #68
This commit is contained in:
		
							parent
							
								
									7b50e1bead
								
							
						
					
					
						commit
						975387d953
					
				
					 12 changed files with 47 additions and 17 deletions
				
			
		|  | @ -94,19 +94,23 @@ The author is Alessandro Ranellucci (me). | |||
|                             (+/-, default: 0) | ||||
|         --gcode-arcs        Use G2/G3 commands for native arcs (experimental, not supported | ||||
|                             by all firmwares) | ||||
|         --g0                Use G0 commands for retraction (experimenta, not supported by all | ||||
|                             firmwares) | ||||
|          | ||||
|       Filament options: | ||||
|         --filament-diameter Diameter in mm of your raw filament (default: 3) | ||||
|         --filament-packing-density | ||||
|                             Ratio of the extruded volume over volume pushed  | ||||
|                             into the extruder (default: 1) | ||||
|         --temperature       Extrusion temperature (default: 200) | ||||
|         --extrusion-multiplier | ||||
|                             Change this to alter the amount of plastic extruded. There should be  | ||||
|                             very little need to change this value, which is only useful to  | ||||
|                             compensate for filament packing (default: 1) | ||||
|         --temperature       Extrusion temperature, set 0 to disable (default: 200) | ||||
|          | ||||
|       Speed options: | ||||
|         --print-feed-rate   Speed of print moves in mm/sec (default: 60) | ||||
|         --travel-feed-rate  Speed of non-print moves in mm/sec (default: 130) | ||||
|         --perimeter-feed-rate | ||||
|                             Speed of print moves for perimeters in mm/sec (default: 60) | ||||
|         --bridge-feed-rate  Speed of bridge print moves in mm/sec (default: 60) | ||||
|         --bottom-layer-speed-ratio | ||||
|                             Factor to increase/decrease speeds on bottom  | ||||
|                             layer by (default: 0.3) | ||||
|  | @ -118,6 +122,9 @@ The author is Alessandro Ranellucci (me). | |||
|                             layer with (> 0, default: 1) | ||||
|         --infill-every-layers | ||||
|                             Infill every N layers (default: 1) | ||||
|         --extrusion-width-ratio | ||||
|                             Calculate the extrusion width as the layer height multiplied by | ||||
|                             this value (> 0, default: calculated automatically) | ||||
|        | ||||
|       Print options: | ||||
|         --perimeters        Number of perimeters/horizontal skins (range: 1+,  | ||||
|  |  | |||
|  | @ -50,6 +50,7 @@ our $temperature        = 200; | |||
| our $print_feed_rate            = 60;   # mm/sec | ||||
| our $travel_feed_rate           = 130;   # mm/sec | ||||
| our $perimeter_feed_rate        = 30;   # mm/sec | ||||
| our $bridge_feed_rate           = 60;   # mm/sec | ||||
| our $bottom_layer_speed_ratio   = 0.3; | ||||
| 
 | ||||
| # accuracy options | ||||
|  |  | |||
|  | @ -59,6 +59,10 @@ our $Options = { | |||
|         label   => 'Perimeter feed rate (mm/s)', | ||||
|         type    => 'f', | ||||
|     }, | ||||
|     'bridge_feed_rate' => { | ||||
|         label   => 'Bridge feed rate (mm/s)', | ||||
|         type    => 'f', | ||||
|     }, | ||||
|     'bottom_layer_speed_ratio' => { | ||||
|         label   => 'Bottom layer ratio', | ||||
|         type    => 'f', | ||||
|  | @ -351,6 +355,9 @@ sub validate { | |||
|     # --skirt-height | ||||
|     die "Invalid value for --skirt-height\n" | ||||
|         if $Slic3r::skirt_height < 1; | ||||
|      | ||||
|     # legacy with existing config files | ||||
|     $Slic3r::bridge_feed_rate ||= $Slic3r::print_feed_rate; | ||||
| } | ||||
| 
 | ||||
| 1; | ||||
|  |  | |||
|  | @ -5,6 +5,9 @@ use XXX; | |||
| 
 | ||||
| extends 'Slic3r::Polyline::Closed'; | ||||
| 
 | ||||
| # perimeter/fill/bridge/skirt | ||||
| has 'role'         => (is => 'ro', required => 1); | ||||
| 
 | ||||
| sub split_at { | ||||
|     my $self = shift; | ||||
|     my ($point) = @_; | ||||
|  | @ -25,7 +28,7 @@ sub split_at { | |||
|     push @new_points, @{$self->points}[$i .. $#{$self->points}]; | ||||
|     push @new_points, @{$self->points}[0 .. $i]; | ||||
|      | ||||
|     return Slic3r::ExtrusionPath->new(points => [@new_points]); | ||||
|     return Slic3r::ExtrusionPath->new(points => [@new_points], role => $self->role); | ||||
| } | ||||
| 
 | ||||
| 1; | ||||
|  |  | |||
|  | @ -7,6 +7,9 @@ extends 'Slic3r::Polyline'; | |||
| # expressed in layers | ||||
| has 'depth_layers' => (is => 'ro', default => sub {1}); | ||||
| 
 | ||||
| # perimeter/fill/bridge/skirt | ||||
| has 'role'         => (is => 'ro', required => 1); | ||||
| 
 | ||||
| use Slic3r::Geometry qw(PI X Y epsilon deg2rad rotate_points); | ||||
| use XXX; | ||||
| 
 | ||||
|  | @ -67,7 +70,12 @@ sub split_at_acute_angles { | |||
|             push @p, $p3; | ||||
|         } | ||||
|     } | ||||
|     push @paths, (ref $self)->cast([@p]) if @p > 1; | ||||
|     push @paths, (ref $self)->cast( | ||||
|         [@p], | ||||
|         role => $self->role, | ||||
|         depth_layers => $self->depth_layers, | ||||
|     ) if @p > 1; | ||||
|      | ||||
|     return @paths; | ||||
| } | ||||
| 
 | ||||
|  | @ -152,6 +160,7 @@ sub detect_arcs { | |||
|              | ||||
|             my $arc = Slic3r::ExtrusionPath::Arc->new( | ||||
|                 points      => [@arc_points], | ||||
|                 role        => $self->role, | ||||
|                 orientation => $orientation, | ||||
|                 center      => $arc_center, | ||||
|                 radius      => $arc_center->distance_to($points[$i]), | ||||
|  |  | |||
|  | @ -80,10 +80,10 @@ sub make_fill { | |||
|         my $filler      = $Slic3r::fill_pattern; | ||||
|         my $density     = $Slic3r::fill_density; | ||||
|         my $flow_width  = $Slic3r::flow_width; | ||||
|         my $is_bridge = $layer->id > 0 && $surface->surface_type eq 'bottom'; | ||||
|          | ||||
|         # force 100% density and rectilinear fill for external surfaces | ||||
|         if ($surface->surface_type ne 'internal') { | ||||
|             my $is_bridge = $layer->id > 0 && $surface->surface_type eq 'bottom'; | ||||
|             $density = 1; | ||||
|             $filler = $is_bridge ? 'rectilinear' : $Slic3r::solid_fill_pattern; | ||||
|             $flow_width = $Slic3r::nozzle_diameter if $is_bridge; | ||||
|  | @ -102,6 +102,7 @@ sub make_fill { | |||
|             paths => [ | ||||
|                 map Slic3r::ExtrusionPath->cast( | ||||
|                     [ @$_ ], | ||||
|                     role => ($is_bridge ? 'bridge' : 'fill'), | ||||
|                     depth_layers => $surface->depth_layers, | ||||
|                 ), @paths, | ||||
|             ], | ||||
|  |  | |||
|  | @ -35,7 +35,7 @@ sub fill_surface { | |||
|     # make paths | ||||
|     my @paths = (); | ||||
|     my $cur_pos = Slic3r::Point->new(0,0); | ||||
|     foreach my $loop (map Slic3r::ExtrusionLoop->cast($_), @loops) { | ||||
|     foreach my $loop (map Slic3r::ExtrusionLoop->cast($_, role => 'fill'), @loops) { | ||||
|         # find the point of the loop that is closest to the current extruder position | ||||
|         $cur_pos = $loop->nearest_point_to($cur_pos); | ||||
|          | ||||
|  |  | |||
|  | @ -25,7 +25,7 @@ sub new { | |||
|         }, | ||||
|         speed => { | ||||
|             title => 'Speed', | ||||
|             options => [qw(print_feed_rate travel_feed_rate perimeter_feed_rate bottom_layer_speed_ratio)], | ||||
|             options => [qw(travel_feed_rate print_feed_rate perimeter_feed_rate bridge_feed_rate bottom_layer_speed_ratio)], | ||||
|         }, | ||||
|         accuracy => { | ||||
|             title => 'Accuracy', | ||||
|  |  | |||
|  | @ -64,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); | ||||
|             push @{ $layer->perimeters }, Slic3r::ExtrusionLoop->cast($hole, role => 'perimeter'); | ||||
|         } | ||||
|          | ||||
|         # do contours starting from innermost one | ||||
|         foreach my $contour (map $_->contour, map @$_, reverse @$island) { | ||||
|             push @{ $layer->perimeters }, Slic3r::ExtrusionLoop->cast($contour); | ||||
|             push @{ $layer->perimeters }, Slic3r::ExtrusionLoop->cast($contour, role => 'perimeter'); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  |  | |||
|  | @ -273,7 +273,7 @@ sub extrude_skirt { | |||
|     for (my $i = $Slic3r::skirts - 1; $i >= 0; $i--) { | ||||
|         my $distance = ($Slic3r::skirt_distance + ($Slic3r::flow_width * $i)) / $Slic3r::resolution; | ||||
|         my $outline = offset([$convex_hull], $distance, $Slic3r::resolution * 100, JT_ROUND); | ||||
|         push @skirts, Slic3r::ExtrusionLoop->cast([ @{$outline->[0]} ]); | ||||
|         push @skirts, Slic3r::ExtrusionLoop->cast([ @{$outline->[0]} ], role => 'skirt'); | ||||
|     } | ||||
|      | ||||
|     # apply skirts to all layers | ||||
|  |  | |||
|  | @ -42,6 +42,7 @@ GetOptions( | |||
|     'print-feed-rate=i'             => \$Slic3r::print_feed_rate, | ||||
|     'travel-feed-rate=i'            => \$Slic3r::travel_feed_rate, | ||||
|     'perimeter-feed-rate=i'         => \$Slic3r::perimeter_feed_rate, | ||||
|     'bridge-feed-rate=i'            => \$Slic3r::bridge_feed_rate, | ||||
|     'bottom-layer-speed-ratio=f'    => \$Slic3r::bottom_layer_speed_ratio, | ||||
|      | ||||
|     # accuracy options | ||||
|  | @ -147,9 +148,9 @@ Usage: slic3r.pl [ OPTIONS ] file.stl | |||
|   Filament options: | ||||
|     --filament-diameter Diameter in mm of your raw filament (default: $Slic3r::filament_diameter) | ||||
|     --extrusion-multiplier | ||||
|                         Change this to alter the amount of plastic extruded. There should be very little | ||||
|                         need to change this value, which is only useful to compensate for | ||||
|                         filament packing (default: $Slic3r::extrusion_multiplier) | ||||
|                         Change this to alter the amount of plastic extruded. There should be | ||||
|                         very little need to change this value, which is only useful to  | ||||
|                         compensate for filament packing (default: $Slic3r::extrusion_multiplier) | ||||
|     --temperature       Extrusion temperature, set 0 to disable (default: $Slic3r::temperature) | ||||
|      | ||||
|   Speed options: | ||||
|  | @ -157,6 +158,7 @@ Usage: slic3r.pl [ OPTIONS ] file.stl | |||
|     --travel-feed-rate  Speed of non-print moves in mm/sec (default: $Slic3r::travel_feed_rate) | ||||
|     --perimeter-feed-rate | ||||
|                         Speed of print moves for perimeters in mm/sec (default: $Slic3r::print_feed_rate) | ||||
|     --bridge-feed-rate  Speed of bridge print moves in mm/sec (default: $Slic3r::bridge_feed_rate) | ||||
|     --bottom-layer-speed-ratio | ||||
|                         Factor to increase/decrease speeds on bottom  | ||||
|                         layer by (default: $Slic3r::bottom_layer_speed_ratio) | ||||
|  |  | |||
							
								
								
									
										4
									
								
								t/arcs.t
									
										
									
									
									
								
							
							
						
						
									
										4
									
								
								t/arcs.t
									
										
									
									
									
								
							|  | @ -18,7 +18,7 @@ use Slic3r; | |||
|         [306517.1,219034.23], [286979.42,248012.49], [258001.16,267550.17], [222515.14,274714.47],  | ||||
|         [187029.11,267550.17], [158050.85,248012.49], [138513.17,219034.23], [131348.87,183548.2],  | ||||
|         [86948.77,175149.09], [119825.35,100585], | ||||
|     ]); | ||||
|     ], role => 'fill'); | ||||
|      | ||||
|     my $collection = Slic3r::ExtrusionPath::Collection->new(paths => [$path]); | ||||
|     $collection->detect_arcs(30); | ||||
|  | @ -36,7 +36,7 @@ use Slic3r; | |||
|         [13.8268343236509,19.2387953251129], [14.5399049973955,18.9100652418837],  | ||||
|         [15.2249856471595,18.5264016435409], [15.8778525229247,18.0901699437495],  | ||||
|         [16.4944804833018,17.6040596560003], | ||||
|     ]); | ||||
|     ], role => 'fill'); | ||||
|     my $collection = Slic3r::ExtrusionPath::Collection->new(paths => [$path]); | ||||
|     $collection->detect_arcs(10, 1); | ||||
|      | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Alessandro Ranellucci
						Alessandro Ranellucci