Skip to content

Commit 2b0a7cc

Browse files
committed
invalidate posPrepareInfill on pattern change, since that influences anchoring
filter out sparse infill with 100 density from bridgeable areas
1 parent 9054aa7 commit 2b0a7cc

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

src/libslic3r/PrintObject.cpp

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -718,15 +718,7 @@ bool PrintObject::invalidate_state_by_config_options(
718718
|| opt_key == "first_layer_extrusion_width") {
719719
steps.emplace_back(posInfill);
720720
} else if (opt_key == "fill_pattern") {
721-
steps.emplace_back(posInfill);
722-
723-
const auto *old_fill_pattern = old_config.option<ConfigOptionEnum<InfillPattern>>(opt_key);
724-
const auto *new_fill_pattern = new_config.option<ConfigOptionEnum<InfillPattern>>(opt_key);
725-
assert(old_fill_pattern && new_fill_pattern);
726-
// We need to recalculate infill surfaces when infill_only_where_needed is enabled, and we are switching from
727-
// the Lightning infill to another infill or vice versa.
728-
if (m_config.infill_only_where_needed && (new_fill_pattern->value == ipLightning || old_fill_pattern->value == ipLightning))
729-
steps.emplace_back(posPrepareInfill);
721+
steps.emplace_back(posPrepareInfill);
730722
} else if (opt_key == "fill_density") {
731723
// One likely wants to reslice only when switching between zero infill to simulate boolean difference (subtracting volumes),
732724
// normal infill and 100% (solid) infill.
@@ -1641,6 +1633,11 @@ void PrintObject::bridge_over_infill()
16411633
continue;
16421634
};
16431635

1636+
if (expansion_space[candidates.first].empty()){
1637+
// there is no expansion space to which can anchors on this island, skip
1638+
continue;
1639+
}
1640+
16441641
// Gather lower layers sparse infill areas, to depth defined by used bridge flow
16451642
Polygons lower_layers_sparse_infill{};
16461643
double bottom_z = layer->print_z - max_bridge_flow_height[candidates.first] - EPSILON;
@@ -1663,9 +1660,11 @@ void PrintObject::bridge_over_infill()
16631660

16641661
for (size_t region_idx : regions_under_to_check) {
16651662
const LayerRegion *region = po->get_layer(i)->get_region(region_idx);
1666-
for (const Surface *surface : region->fill_surfaces().filter_by_type(stInternal)) {
1667-
Polygons p = to_polygons(surface->expolygon);
1668-
lower_layers_sparse_infill.insert(lower_layers_sparse_infill.end(), p.begin(), p.end());
1663+
if (region->region().config().fill_density.value < 100) {
1664+
for (const Surface *surface : region->fill_surfaces().filter_by_type(stInternal)) {
1665+
Polygons p = to_polygons(surface->expolygon);
1666+
lower_layers_sparse_infill.insert(lower_layers_sparse_infill.end(), p.begin(), p.end());
1667+
}
16691668
}
16701669
}
16711670
}

0 commit comments

Comments
 (0)