diff --git a/lib/Slic3r/Config.pm b/lib/Slic3r/Config.pm index 5299847295..61d4bb97c5 100644 --- a/lib/Slic3r/Config.pm +++ b/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" diff --git a/lib/Slic3r/Fill.pm b/lib/Slic3r/Fill.pm index de322153df..82c2ec6cce 100644 --- a/lib/Slic3r/Fill.pm +++ b/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; diff --git a/lib/Slic3r/GUI/Tab.pm b/lib/Slic3r/GUI/Tab.pm index 0121a8b200..ecb476fd59 100644 --- a/lib/Slic3r/GUI/Tab.pm +++ b/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'); diff --git a/slic3r.pl b/slic3r.pl index cd8ddd371f..70e1092152 100755 --- a/slic3r.pl +++ b/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 diff --git a/t/fill.t b/t/fill.t index f0fe6f9036..24370b6603 100644 --- a/t/fill.t +++ b/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); diff --git a/xs/src/libslic3r/PrintConfig.cpp b/xs/src/libslic3r/PrintConfig.cpp index 0ced2c8320..54deaee82b 100644 --- a/xs/src/libslic3r/PrintConfig.cpp +++ b/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::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::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"; diff --git a/xs/src/libslic3r/PrintConfig.hpp b/xs/src/libslic3r/PrintConfig.hpp index c1e6ac69fd..447948a269 100644 --- a/xs/src/libslic3r/PrintConfig.hpp +++ b/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 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 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; diff --git a/xs/src/libslic3r/PrintObject.cpp b/xs/src/libslic3r/PrintObject.cpp index 54ddea33de..b4ce83e064 100644 --- a/xs/src/libslic3r/PrintObject.cpp +++ b/xs/src/libslic3r/PrintObject.cpp @@ -234,9 +234,9 @@ PrintObject::invalidate_state_by_config_options(const std::vectorsurface_type == stTop || this->surface_type == stBottom || this->surface_type == stBottomBridge - || this->surface_type == stInternalSolid; + || this->surface_type == stInternalSolid + || this->surface_type == stInternalBridge; } bool