mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-01 05:51:58 +08:00
Since prepare_infill is not actually idempotent, recalculate perimeters every time. #3827
This commit is contained in:
parent
1cd4bca648
commit
de1c900d8f
@ -155,12 +155,18 @@ sub detect_surfaces_type {
|
||||
sub prepare_infill {
|
||||
my ($self) = @_;
|
||||
|
||||
# prerequisites
|
||||
$self->make_perimeters; # do we need them? TODO: check
|
||||
$self->detect_surfaces_type;
|
||||
|
||||
return if $self->step_done(STEP_PREPARE_INFILL);
|
||||
$self->set_step_started(STEP_PREPARE_INFILL);
|
||||
|
||||
# This prepare_infill() is not really idempotent.
|
||||
# TODO: It should clear and regenerate fill_surfaces at every run
|
||||
# instead of modifying it in place.
|
||||
$self->invalidate_step(STEP_PERIMETERS);
|
||||
$self->make_perimeters;
|
||||
|
||||
# prerequisites
|
||||
$self->detect_surfaces_type;
|
||||
|
||||
$self->print->status_cb->(30, "Preparing infill");
|
||||
|
||||
# decide what surfaces are to be filled
|
||||
|
@ -66,7 +66,7 @@ LayerRegion::make_perimeters(const SurfaceCollection &slices, SurfaceCollection*
|
||||
g.process();
|
||||
}
|
||||
|
||||
// This function reads layer->slices andlower_layer->slices
|
||||
// This function reads layer->slices and lower_layer->slices
|
||||
// and writes this->bridged and this->fill_surfaces, so it's thread-safe.
|
||||
void
|
||||
LayerRegion::process_external_surfaces()
|
||||
@ -106,7 +106,6 @@ LayerRegion::process_external_surfaces()
|
||||
}
|
||||
|
||||
SurfaceCollection bottom;
|
||||
Polygons removed_holes;
|
||||
for (const Surface &surface : surfaces) {
|
||||
if (!surface.is_bottom()) continue;
|
||||
|
||||
|
@ -85,11 +85,19 @@ PrintRegion::invalidate_state_by_config(const PrintConfigBase &config)
|
||||
steps.insert(posPerimeters);
|
||||
} else if (opt_key == "first_layer_extrusion_width") {
|
||||
steps.insert(posSupportMaterial);
|
||||
} else if (opt_key == "solid_infill_below_area") {
|
||||
const float &cur_value = config.opt<ConfigOptionFloat>(opt_key)->value;
|
||||
const float &new_value = this->config.solid_infill_below_area.value;
|
||||
if (new_value >= cur_value) {
|
||||
steps.insert(posPrepareInfill);
|
||||
} else {
|
||||
// prepare_infill is not idempotent when solid_infill_below_area is reduced
|
||||
steps.insert(posPerimeters);
|
||||
}
|
||||
} else if (opt_key == "infill_every_layers"
|
||||
|| opt_key == "solid_infill_every_layers"
|
||||
|| opt_key == "bottom_solid_layers"
|
||||
|| opt_key == "top_solid_layers"
|
||||
|| opt_key == "solid_infill_below_area"
|
||||
|| opt_key == "infill_extruder"
|
||||
|| opt_key == "solid_infill_extruder"
|
||||
|| opt_key == "infill_extrusion_width") {
|
||||
@ -108,10 +116,10 @@ PrintRegion::invalidate_state_by_config(const PrintConfigBase &config)
|
||||
} else if (opt_key == "fill_density") {
|
||||
const float &cur_value = config.opt<ConfigOptionFloat>("fill_density")->value;
|
||||
const float &new_value = this->config.fill_density.value;
|
||||
if ((cur_value == 0) != (new_value == 0))
|
||||
if ((cur_value == 0) != (new_value == 0) || (cur_value == 100) != (new_value == 100))
|
||||
steps.insert(posPerimeters);
|
||||
|
||||
steps.insert(posPrepareInfill);
|
||||
steps.insert(posInfill);
|
||||
} else if (opt_key == "external_perimeter_extrusion_width"
|
||||
|| opt_key == "perimeter_extruder") {
|
||||
steps.insert(posPerimeters);
|
||||
|
Loading…
x
Reference in New Issue
Block a user