Make sure infill_only_where_needed has no effect when fill_density = 0%. No need to require it to be explicitely turned off for spiral_vase, since it's disabled anyway. #3386 #3126

This commit is contained in:
Alessandro Ranellucci 2017-03-17 19:17:24 +01:00
parent 4c577043f4
commit 69d169165e
2 changed files with 7 additions and 7 deletions

View File

@ -745,14 +745,13 @@ sub _update {
my $config = $self->{config};
if ($config->spiral_vase && !($config->perimeters == 1 && $config->top_solid_layers == 0 && $config->fill_density == 0 && $config->infill_only_where_needed == 0 && $config->support_material == 0)) {
if ($config->spiral_vase && !($config->perimeters == 1 && $config->top_solid_layers == 0 && $config->fill_density == 0 && $config->support_material == 0)) {
my $dialog = Wx::MessageDialog->new($self,
"The Spiral Vase mode requires:\n"
. "- one perimeter\n"
. "- no top solid layers\n"
. "- 0% fill density\n"
. "- no support material\n"
. "- no infill where necessary\n"
. "\nShall I adjust those settings in order to enable Spiral Vase?",
'Spiral Vase', wxICON_WARNING | wxYES | wxNO);
if ($dialog->ShowModal() == wxID_YES) {
@ -761,7 +760,6 @@ sub _update {
$new_conf->set("top_solid_layers", 0);
$new_conf->set("fill_density", 0);
$new_conf->set("support_material", 0);
$new_conf->set("infill_only_where_needed", 0);
$self->load_config($new_conf);
} else {
my $new_conf = Slic3r::Config->new;

View File

@ -3,7 +3,7 @@ package Slic3r::Print::Object;
use strict;
use warnings;
use List::Util qw(min max sum first);
use List::Util qw(min max sum first any);
use Slic3r::Flow ':roles';
use Slic3r::Geometry qw(X Y Z PI scale unscale chained_path epsilon);
use Slic3r::Geometry::Clipper qw(diff diff_ex intersection intersection_ex union union_ex
@ -488,9 +488,9 @@ sub _support_material {
# fill_surfaces but we only turn them into VOID surfaces, thus preserving the boundaries.
sub clip_fill_surfaces {
my $self = shift;
# sanity check for incompatible options:
# spiral_vase and infill_only_where_needed
return unless $self->config->infill_only_where_needed and not $self->config->spiral_vase;
return unless $self->config->infill_only_where_needed
&& any { $_->config->fill_density > 0 } @{$self->print->regions};
# We only want infill under ceilings; this is almost like an
# internal support material.
@ -548,6 +548,8 @@ sub clip_fill_surfaces {
# apply new internal infill to regions
foreach my $layerm (@{$lower_layer->regions}) {
next if $layerm->config->fill_density == 0;
my (@internal, @other) = ();
foreach my $surface (map $_->clone, @{$layerm->fill_surfaces}) {
if ($surface->surface_type == S_TYPE_INTERNAL || $surface->surface_type == S_TYPE_INTERNALVOID) {