Browse Source

New option to make infill before perimeters. #1039

Alessandro Ranellucci 12 years ago
parent
commit
2942485a94
5 changed files with 12 additions and 2 deletions
  1. 1 0
      README.markdown
  2. 7 0
      lib/Slic3r/Config.pm
  3. 1 1
      lib/Slic3r/GUI/Tab.pm
  4. 2 1
      lib/Slic3r/Print.pm
  5. 1 0
      slic3r.pl

+ 1 - 0
README.markdown

@@ -205,6 +205,7 @@ The author of the Silk icon set is Mark James.
                             (mm^2, default: 70)
         --infill-only-where-needed
                             Only infill under ceilings (default: no)
+        --infill-first      Make infill before perimeters (default: no)
       
        Support material options:
         --support-material  Generate support material for overhangs

+ 7 - 0
lib/Slic3r/Config.pm

@@ -395,6 +395,13 @@ our $Options = {
         type    => 'bool',
         default => 0,
     },
+    'infill_first' => {
+        label   => 'Infill before perimeters',
+        tooltip => 'This option will switch the print order of perimeters and infill, making the latter first.',
+        cli     => 'infill-first!',
+        type    => 'bool',
+        default => 0,
+    },
     
     # flow options
     'extrusion_width' => {

+ 1 - 1
lib/Slic3r/GUI/Tab.pm

@@ -419,7 +419,7 @@ sub build {
         {
             title => 'Advanced',
             options => [qw(infill_every_layers infill_only_where_needed solid_infill_every_layers fill_angle
-                solid_infill_below_area only_retract_when_crossing_perimeters)],
+                solid_infill_below_area only_retract_when_crossing_perimeters infill_first)],
         },
     ]);
     

+ 2 - 1
lib/Slic3r/Print.pm

@@ -909,7 +909,8 @@ sub write_gcode {
                     };
                     
                     # give priority to infill if we were already using its extruder
-                    if ($gcodegen->multiple_extruders && $region->extruders->{infill} eq $gcodegen->extruder) {
+                    if ($Slic3r::Config->infill_first
+                        || ($gcodegen->multiple_extruders && $region->extruders->{infill} eq $gcodegen->extruder)) {
                         $extrude_fills->();
                         $extrude_perimeters->();
                     } else {

+ 1 - 0
slic3r.pl

@@ -258,6 +258,7 @@ $j
                         (mm^2, default: $config->{solid_infill_below_area})
     --infill-only-where-needed
                         Only infill under ceilings (default: no)
+    --infill-first      Make infill before perimeters (default: no)
   
    Support material options:
     --support-material  Generate support material for overhangs