Browse Source

Rename solid_fill_pattern to external_fill_pattern and clarify tooltip

Alessandro Ranellucci 10 years ago
parent
commit
7a7d00c8d6

+ 4 - 4
lib/Slic3r/Config.pm

@@ -250,14 +250,14 @@ sub validate {
     die "Invalid value for --fill-pattern\n"
         if !first { $_ eq $self->fill_pattern } @{$Options->{fill_pattern}{values}};
     
-    # --solid-fill-pattern
-    die "Invalid value for --solid-fill-pattern\n"
-        if !first { $_ eq $self->solid_fill_pattern } @{$Options->{solid_fill_pattern}{values}};
+    # --external-fill-pattern
+    die "Invalid value for --external-fill-pattern\n"
+        if !first { $_ eq $self->external_fill_pattern } @{$Options->{external_fill_pattern}{values}};
     
     # --fill-density
     die "The selected fill pattern is not supposed to work at 100% density\n"
         if $self->fill_density == 100
-            && !first { $_ eq $self->fill_pattern } @{$Options->{solid_fill_pattern}{values}};
+            && !first { $_ eq $self->fill_pattern } @{$Options->{external_fill_pattern}{values}};
     
     # --infill-every-layers
     die "Invalid value for --infill-every-layers\n"

+ 5 - 8
lib/Slic3r/Fill.pm

@@ -83,7 +83,7 @@ sub make_fill {
                         ? $layerm->flow(FLOW_ROLE_TOP_SOLID_INFILL)->width
                         : $solid_infill_flow->width;
                     $pattern[$i] = $groups[$i][0]->is_external
-                        ? $layerm->config->solid_fill_pattern
+                        ? $layerm->config->external_fill_pattern
                         : 'rectilinear';
                 } else {
                     $is_solid[$i]   = 0;
@@ -190,14 +190,11 @@ sub make_fill {
         my $is_bridge       = $layerm->id > 0 && $surface->is_bridge;
         my $is_solid        = $surface->is_solid;
         
-        # force 100% density and rectilinear fill for external surfaces
-        if ($surface->surface_type != S_TYPE_INTERNAL) {
+        if ($surface->is_solid) {
             $density = 100;
-            $filler = $layerm->config->solid_fill_pattern;
-            if ($is_bridge) {
-                $filler = 'rectilinear';
-            } elsif ($surface->surface_type == S_TYPE_INTERNALSOLID) {
-                $filler = 'rectilinear';
+            $filler = 'rectilinear';
+            if ($surface->is_external) {
+                $filler = $layerm->config->external_fill_pattern;
             }
         } else {
             next SURFACE unless $density > 0;

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

@@ -432,7 +432,7 @@ sub build {
         top_solid_layers bottom_solid_layers
         extra_perimeters avoid_crossing_perimeters thin_walls overhangs
         seam_position external_perimeters_first
-        fill_density fill_pattern solid_fill_pattern
+        fill_density fill_pattern external_fill_pattern
         infill_every_layers infill_only_where_needed
         solid_infill_every_layers fill_angle solid_infill_below_area 
         only_retract_when_crossing_perimeters infill_first
@@ -505,7 +505,7 @@ sub build {
             my $optgroup = $page->new_optgroup('Infill');
             $optgroup->append_single_option_line('fill_density');
             $optgroup->append_single_option_line('fill_pattern');
-            $optgroup->append_single_option_line('solid_fill_pattern');
+            $optgroup->append_single_option_line('external_fill_pattern');
         }
         {
             my $optgroup = $page->new_optgroup('Reducing printing time');

+ 1 - 1
slic3r.pl

@@ -364,7 +364,7 @@ $j
     --fill-density      Infill density (range: 0%-100%, default: $config->{fill_density}%)
     --fill-angle        Infill angle in degrees (range: 0-90, default: $config->{fill_angle})
     --fill-pattern      Pattern to use to fill non-solid layers (default: $config->{fill_pattern})
-    --solid-fill-pattern Pattern to use to fill solid layers (default: $config->{solid_fill_pattern})
+    --external-fill-pattern Pattern to use to fill solid layers (default: $config->{external_fill_pattern})
     --start-gcode       Load initial G-code from the supplied file. This will overwrite
                         the default command (home all axes [G28]).
     --end-gcode         Load final G-code from the supplied file. This will overwrite 

+ 1 - 1
t/fill.t

@@ -171,7 +171,7 @@ sub scale_points (@) { map [scale $_->[X], scale $_->[Y]], @_ }
 for my $pattern (qw(rectilinear honeycomb hilbertcurve concentric)) {
     my $config = Slic3r::Config->new_from_defaults;
     $config->set('fill_pattern', $pattern);
-    $config->set('solid_fill_pattern', $pattern);
+    $config->set('external_fill_pattern', $pattern);
     $config->set('perimeters', 1);
     $config->set('skirts', 0);
     $config->set('fill_density', 20);

+ 18 - 17
xs/src/libslic3r/PrintConfig.cpp

@@ -115,6 +115,24 @@ PrintConfigDef::build_def() {
     Options["end_gcode"].full_width = true;
     Options["end_gcode"].height = 120;
 
+    Options["external_fill_pattern"].type = coEnum;
+    Options["external_fill_pattern"].label = "Top/bottom fill pattern";
+    Options["external_fill_pattern"].category = "Infill";
+    Options["external_fill_pattern"].tooltip = "Fill pattern for top/bottom infill. This only affects the external visible layer, and not its adjacent solid shells.";
+    Options["external_fill_pattern"].cli = "external-fill-pattern=s";
+    Options["external_fill_pattern"].enum_keys_map = ConfigOptionEnum<InfillPattern>::get_enum_values();
+    Options["external_fill_pattern"].enum_values.push_back("rectilinear");
+    Options["external_fill_pattern"].enum_values.push_back("concentric");
+    Options["external_fill_pattern"].enum_values.push_back("hilbertcurve");
+    Options["external_fill_pattern"].enum_values.push_back("archimedeanchords");
+    Options["external_fill_pattern"].enum_values.push_back("octagramspiral");
+    Options["external_fill_pattern"].enum_labels.push_back("rectilinear");
+    Options["external_fill_pattern"].enum_labels.push_back("concentric");
+    Options["external_fill_pattern"].enum_labels.push_back("hilbertcurve (slow)");
+    Options["external_fill_pattern"].enum_labels.push_back("archimedeanchords (slow)");
+    Options["external_fill_pattern"].enum_labels.push_back("octagramspiral (slow)");
+    Options["external_fill_pattern"].aliases.push_back("solid_fill_pattern");
+
     Options["external_perimeter_extrusion_width"].type = coFloatOrPercent;
     Options["external_perimeter_extrusion_width"].label = "External perimeters";
     Options["external_perimeter_extrusion_width"].category = "Extrusion Width";
@@ -668,23 +686,6 @@ PrintConfigDef::build_def() {
     Options["small_perimeter_speed"].cli = "small-perimeter-speed=s";
     Options["small_perimeter_speed"].ratio_over = "perimeter_speed";
 
-    Options["solid_fill_pattern"].type = coEnum;
-    Options["solid_fill_pattern"].label = "Top/bottom fill pattern";
-    Options["solid_fill_pattern"].category = "Infill";
-    Options["solid_fill_pattern"].tooltip = "Fill pattern for top/bottom infill.";
-    Options["solid_fill_pattern"].cli = "solid-fill-pattern=s";
-    Options["solid_fill_pattern"].enum_keys_map = ConfigOptionEnum<InfillPattern>::get_enum_values();
-    Options["solid_fill_pattern"].enum_values.push_back("rectilinear");
-    Options["solid_fill_pattern"].enum_values.push_back("concentric");
-    Options["solid_fill_pattern"].enum_values.push_back("hilbertcurve");
-    Options["solid_fill_pattern"].enum_values.push_back("archimedeanchords");
-    Options["solid_fill_pattern"].enum_values.push_back("octagramspiral");
-    Options["solid_fill_pattern"].enum_labels.push_back("rectilinear");
-    Options["solid_fill_pattern"].enum_labels.push_back("concentric");
-    Options["solid_fill_pattern"].enum_labels.push_back("hilbertcurve (slow)");
-    Options["solid_fill_pattern"].enum_labels.push_back("archimedeanchords (slow)");
-    Options["solid_fill_pattern"].enum_labels.push_back("octagramspiral (slow)");
-
     Options["solid_infill_below_area"].type = coFloat;
     Options["solid_infill_below_area"].label = "Solid infill threshold area";
     Options["solid_infill_below_area"].category = "Infill";

+ 3 - 3
xs/src/libslic3r/PrintConfig.hpp

@@ -205,6 +205,7 @@ class PrintRegionConfig : public virtual StaticPrintConfig
     ConfigOptionInt                 bottom_solid_layers;
     ConfigOptionFloat               bridge_flow_ratio;
     ConfigOptionFloat               bridge_speed;
+    ConfigOptionEnum<InfillPattern> external_fill_pattern;
     ConfigOptionFloatOrPercent      external_perimeter_extrusion_width;
     ConfigOptionFloatOrPercent      external_perimeter_speed;
     ConfigOptionBool                external_perimeters_first;
@@ -223,7 +224,6 @@ class PrintRegionConfig : public virtual StaticPrintConfig
     ConfigOptionFloat               perimeter_speed;
     ConfigOptionInt                 perimeters;
     ConfigOptionFloatOrPercent      small_perimeter_speed;
-    ConfigOptionEnum<InfillPattern> solid_fill_pattern;
     ConfigOptionFloat               solid_infill_below_area;
     ConfigOptionFloatOrPercent      solid_infill_extrusion_width;
     ConfigOptionInt                 solid_infill_every_layers;
@@ -237,6 +237,7 @@ class PrintRegionConfig : public virtual StaticPrintConfig
         this->bottom_solid_layers.value                          = 3;
         this->bridge_flow_ratio.value                            = 1;
         this->bridge_speed.value                                 = 60;
+        this->external_fill_pattern.value                        = ipRectilinear;
         this->external_perimeter_extrusion_width.value           = 0;
         this->external_perimeter_extrusion_width.percent         = false;
         this->external_perimeter_speed.value                     = 70;
@@ -260,7 +261,6 @@ class PrintRegionConfig : public virtual StaticPrintConfig
         this->perimeters.value                                   = 3;
         this->small_perimeter_speed.value                        = 30;
         this->small_perimeter_speed.percent                      = false;
-        this->solid_fill_pattern.value                           = ipRectilinear;
         this->solid_infill_below_area.value                      = 70;
         this->solid_infill_extrusion_width.value                 = 0;
         this->solid_infill_extrusion_width.percent               = false;
@@ -279,6 +279,7 @@ class PrintRegionConfig : public virtual StaticPrintConfig
         if (opt_key == "bottom_solid_layers")                        return &this->bottom_solid_layers;
         if (opt_key == "bridge_flow_ratio")                          return &this->bridge_flow_ratio;
         if (opt_key == "bridge_speed")                               return &this->bridge_speed;
+        if (opt_key == "external_fill_pattern")                      return &this->external_fill_pattern;
         if (opt_key == "external_perimeter_extrusion_width")         return &this->external_perimeter_extrusion_width;
         if (opt_key == "external_perimeter_speed")                   return &this->external_perimeter_speed;
         if (opt_key == "external_perimeters_first")                  return &this->external_perimeters_first;
@@ -297,7 +298,6 @@ class PrintRegionConfig : public virtual StaticPrintConfig
         if (opt_key == "perimeter_speed")                            return &this->perimeter_speed;
         if (opt_key == "perimeters")                                 return &this->perimeters;
         if (opt_key == "small_perimeter_speed")                      return &this->small_perimeter_speed;
-        if (opt_key == "solid_fill_pattern")                         return &this->solid_fill_pattern;
         if (opt_key == "solid_infill_below_area")                    return &this->solid_infill_below_area;
         if (opt_key == "solid_infill_extrusion_width")               return &this->solid_infill_extrusion_width;
         if (opt_key == "solid_infill_every_layers")                  return &this->solid_infill_every_layers;

+ 2 - 2
xs/src/libslic3r/PrintObject.cpp

@@ -234,9 +234,9 @@ PrintObject::invalidate_state_by_config_options(const std::vector<t_config_optio
             || *opt_key == "infill_extruder"
             || *opt_key == "infill_extrusion_width") {
             steps.insert(posPrepareInfill);
-        } else if (*opt_key == "fill_angle"
+        } else if (*opt_key == "external_fill_pattern"
+            || *opt_key == "fill_angle"
             || *opt_key == "fill_pattern"
-            || *opt_key == "solid_fill_pattern"
             || *opt_key == "infill_every_layers"
             || *opt_key == "solid_infill_every_layers"
             || *opt_key == "top_infill_extrusion_width") {

+ 2 - 1
xs/src/libslic3r/Surface.cpp

@@ -14,7 +14,8 @@ Surface::is_solid() const
     return this->surface_type == stTop
         || this->surface_type == stBottom
         || this->surface_type == stBottomBridge
-        || this->surface_type == stInternalSolid;
+        || this->surface_type == stInternalSolid
+        || this->surface_type == stInternalBridge;
 }
 
 bool