Skip to content

Commit

Permalink
Don't use bridge flow over dense infill
Browse files Browse the repository at this point in the history
Make infill bridging use the same void threshold check as other bridging
spans (previously bridge flow applied to all non-solid infill.)
  • Loading branch information
jschuh committed Dec 10, 2021
1 parent 121bb26 commit 94422c8
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions src/libslic3r/PrintObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1418,10 +1418,6 @@ void PrintObject::bridge_over_infill()
for (size_t region_id = 0; region_id < this->num_printing_regions(); ++ region_id) {
const PrintRegion &region = this->printing_region(region_id);

// skip bridging in case there are no voids
if (region.config().fill_density.value == 100)
continue;

for (LayerPtrs::iterator layer_it = m_layers.begin(); layer_it != m_layers.end(); ++ layer_it) {
// skip first layer
if (layer_it == m_layers.begin())
Expand All @@ -1431,6 +1427,18 @@ void PrintObject::bridge_over_infill()
LayerRegion *layerm = layer->m_regions[region_id];
Flow bridge_flow = layerm->bridging_flow(frSolidInfill);

// Minimum width of a void for the extrusion above to be treated as a bridge.
const float min_void_width = float(bridge_flow.scaled_width()) * 3.f;

// Skip bridging if the infill voids are small enough.
const float fill_density = region.config().fill_density.value / 100.0;
if (fill_density > 0.0) {
// Estimate the infill void width from infill density and extrusion width.
const float infill_extrusion_width = layerm->flow(frInfill).scaled_width();
if (min_void_width > (infill_extrusion_width / fill_density - infill_extrusion_width))
continue;
}

// extract the stInternalSolid surfaces that might be transformed into bridges
Polygons internal_solid;
layerm->fill_surfaces.filter_by_type(stInternalSolid, &internal_solid);
Expand Down Expand Up @@ -1463,10 +1471,7 @@ void PrintObject::bridge_over_infill()
//FIXME Vojtech: The offset2 function is not a geometric offset,
// therefore it may create 1) gaps, and 2) sharp corners, which are outside the original contour.
// The gaps will be filled by a separate region, which makes the infill less stable and it takes longer.
{
float min_width = float(bridge_flow.scaled_width()) * 3.f;
to_bridge_pp = opening(to_bridge_pp, min_width);
}
to_bridge_pp = opening(to_bridge_pp, min_void_width);

if (to_bridge_pp.empty()) continue;

Expand Down Expand Up @@ -1799,11 +1804,9 @@ void PrintObject::discover_horizontal_shells()
const PrintRegionConfig &region_config = layerm->region().config();
if (region_config.solid_infill_every_layers.value > 0 && region_config.fill_density.value > 0 &&
(i % region_config.solid_infill_every_layers) == 0) {
// Insert a solid internal layer. Mark stInternal surfaces as stInternalSolid or stInternalBridge.
SurfaceType type = (region_config.fill_density == 100 || region_config.solid_infill_every_layers == 1) ? stInternalSolid : stInternalBridge;
for (Surface &surface : layerm->fill_surfaces.surfaces)
if (surface.surface_type == stInternal)
surface.surface_type = type;
surface.surface_type = stInternalSolid;
}

// If ensure_vertical_shell_thickness, then the rest has already been performed by discover_vertical_shells().
Expand Down

0 comments on commit 94422c8

Please sign in to comment.