Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 34 additions & 17 deletions src/libslic3r/PerimeterGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1840,7 +1840,10 @@ void PerimeterGenerator::process_no_bridge(Surfaces& all_surfaces, coord_t perim
ExPolygons bridges_temp = offset2_ex(intersection_ex(last, diff_ex(unsupported_filtered, unbridgeable), ApplySafetyOffset::Yes), -ext_perimeter_width / 4, ext_perimeter_width / 4);
//remove the overhangs section from the surface polygons
ExPolygons reference = last;
last = diff_ex(last, unsupported_filtered);
// When support is enabled, do not remove the bridge area from the model surface,
// so that perimeters and overhang walls can still be generated for the supported overhang.
if (!this->object_config->enable_support.value)
last = diff_ex(last, unsupported_filtered);
//ExPolygons no_bridge = diff_ex(offset_ex(unbridgeable, ext_perimeter_width * 3 / 2), last);
//bridges_temp = diff_ex(bridges_temp, no_bridge);
coordf_t offset_to_do = bridged_infill_margin;
Expand Down Expand Up @@ -1881,22 +1884,36 @@ void PerimeterGenerator::process_no_bridge(Surfaces& all_surfaces, coord_t perim

if (!unsupported_filtered.empty()) {

//add this directly to the infill list.
// this will avoid to throw wrong offsets into a good polygons
this->fill_surfaces->append(
unsupported_filtered,
stInternal);

// store the results
last = diff_ex(last, unsupported_filtered, ApplySafetyOffset::Yes);
//remove "thin air" polygons (note: it assumes that all polygons below will be extruded)
for (int i = 0; i < last.size(); i++) {
if (intersection_ex(support, ExPolygons() = { last[i] }).empty()) {
this->fill_surfaces->append(
ExPolygons() = { last[i] },
stInternal);
last.erase(last.begin() + i);
i--;
if (!this->object_config->enable_support.value) {
// Support is disabled: remove the bridge area from the model surface
// to prevent unsupported perimeters, and add the full area to fill_surfaces
// to ensure the gap is still filled.
this->fill_surfaces->append(
unsupported_filtered,
stInternal);
last = diff_ex(last, unsupported_filtered, ApplySafetyOffset::Yes);
//remove "thin air" polygons (note: it assumes that all polygons below will be extruded)
for (int i = 0; i < last.size(); i++) {
if (intersection_ex(support, ExPolygons() = { last[i] }).empty()) {
this->fill_surfaces->append(
ExPolygons() = { last[i] },
stInternal);
last.erase(last.begin() + i);
i--;
}
}
} else {
// Support is enabled: keep the model surface intact so that perimeters
// and overhang walls are generated normally. Shrink the bridge fill area
// inward by the perimeter zone width before appending, to avoid overlap
// with the perimeter walls.
int wall_loops = std::max(1, this->config->wall_loops.value);
coord_t perimeter_zone = ext_perimeter_width / 2
+ perimeter_spacing * (wall_loops - 1)
+ perimeter_spacing / 2;
ExPolygons fill_safe = offset_ex(unsupported_filtered, -perimeter_zone);
if (!fill_safe.empty()) {
this->fill_surfaces->append(fill_safe, stInternal);
}
}
}
Expand Down