Fix bridge anchor when bridge is also the top surface (#6654)

Fixes #6642

Cherry picked from b133579126
Huge thanks for their excellent work!

![image](https://github.com/user-attachments/assets/8fc054bb-68da-4f8f-82bd-943bcf0b80c0)
This commit is contained in:
SoftFever 2024-09-07 16:23:44 +08:00 committed by GitHub
commit 4e25217927
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 313 additions and 208 deletions

View file

@ -447,17 +447,6 @@ void PrintObject::prepare_infill()
#endif /* SLIC3R_DEBUG_SLICE_PROCESSING */
// Debugging output.
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
for (size_t region_id = 0; region_id < this->num_printing_regions(); ++ region_id) {
for (const Layer *layer : m_layers) {
LayerRegion *layerm = layer->m_regions[region_id];
layerm->export_region_slices_to_svg_debug("3_process_external_surfaces-final");
layerm->export_region_fill_surfaces_to_svg_debug("3_process_external_surfaces-final");
} // for each layer
} // for each region
#endif /* SLIC3R_DEBUG_SLICE_PROCESSING */
// Detect, which fill surfaces are near external layers.
// They will be split in internal and internal-solid surfaces.
// The purpose is to add a configurable number of solid layers to support the TOP surfaces
@ -469,6 +458,16 @@ void PrintObject::prepare_infill()
this->discover_horizontal_shells();
m_print->throw_if_canceled();
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
for (size_t region_id = 0; region_id < this->num_printing_regions(); ++ region_id) {
for (const Layer *layer : m_layers) {
LayerRegion *layerm = layer->m_regions[region_id];
layerm->export_region_slices_to_svg_debug("5_discover_horizontal_shells-final");
layerm->export_region_fill_surfaces_to_svg_debug("5_discover_horizontal_shells-final");
} // for each layer
} // for each region
#endif /* SLIC3R_DEBUG_SLICE_PROCESSING */
// this will detect bridges and reverse bridges
// and rearrange top/bottom/internal surfaces
// It produces enlarged overlapping bridging areas.
@ -481,12 +480,13 @@ void PrintObject::prepare_infill()
this->process_external_surfaces();
m_print->throw_if_canceled();
// Debugging output.
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
for (size_t region_id = 0; region_id < this->num_printing_regions(); ++ region_id) {
for (const Layer *layer : m_layers) {
LayerRegion *layerm = layer->m_regions[region_id];
layerm->export_region_slices_to_svg_debug("7_discover_horizontal_shells-final");
layerm->export_region_fill_surfaces_to_svg_debug("7_discover_horizontal_shells-final");
layerm->export_region_slices_to_svg_debug("7_process_external_surfaces-final");
layerm->export_region_fill_surfaces_to_svg_debug("7_process_external_surfaces-final");
} // for each layer
} // for each region
#endif /* SLIC3R_DEBUG_SLICE_PROCESSING */