fix gaps between walls and sparse infill, issue #12304 #323

Open
opened 2026-04-05 16:19:52 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @echipachenko on 3/14/2026

Description

This fixes issue #12304: gaps between walls and sparse infill.
When "Detect Narrow Infill" is enabled, sparse infill (Grid pattern) shows gaps between the infill lines and the walls.

Root Cause: In the split_solid_surface() function in src/libslic3r/Fill/Fill.cpp:
Line 656: The inner_area is shrunk by scaled_spacing * 0.5 (minus overlap)
Line 813 (original): The normal infill is expanded by only scaled_spacing * 0.1

This creates a net inward shift of 0.4 * spacing, leaving a gap

Solution: Increase the expansion amount from scaled_spacing * 0.1 to scaled_spacing * 0.5 to match the shrinkage applied earlier. This ensures the normal infill properly covers the area and connects seamlessly with the narrow infill.

Additional Context
When "Ensure vertical shell thickness" triggers on sloping walls (e.g., spheres), it generates a Solid Infill band. This function separates the thin sections of that band. Expanding normal_infill by scaled_spacing * 0.5 ensures the zig-zag paths physically overlap the concentric narrow lines by half a line width. This welds the plastic together during printing and prevents shrinkage gaps inside the shell.

Screenshots/Recordings/Graphs

Before fix:

Screenshot 2026-03-15 о 2 54 26 пп Screenshot 2026-03-15 о 2 54 35 пп

After fix:
When "Detect narrow internal solid infill" is enabled:
Screenshot 2026-03-15 о 3 51 00 пп

When "Detect narrow internal solid infill" is disabled:
Screenshot 2026-03-15 о 3 53 22 пп

Tests

See attached screenshots.

NOTE:
This PR addresses the gaps between sparse infill and walls that occur when both Detect narrow internal solid infill and Ensure vertical shell thickness are enabled. While a gap remains when Detect narrow internal solid infill is disabled (where a zig-zag line is expected), this fix improves print quality for the primary use case.
Additionally, these changes bring the output closer to the behaviour seen in Bambu Studio. Given the partial improvement, I believe this is ready for merge

Fix #12304

*Originally created by @echipachenko on 3/14/2026* # Description This fixes issue #12304: gaps between walls and sparse infill. When "Detect Narrow Infill" is enabled, sparse infill (Grid pattern) shows gaps between the infill lines and the walls. **Root Cause:** In the `split_solid_surface()` function in `src/libslic3r/Fill/Fill.cpp`: Line 656: The `inner_area` is shrunk by `scaled_spacing * 0.5` (minus overlap) Line 813 (original): The normal infill is expanded by only `scaled_spacing * 0.1` This creates a net inward shift of 0.4 * spacing, leaving a gap **Solution:** Increase the expansion amount from scaled_spacing * 0.1 to scaled_spacing * 0.5 to match the shrinkage applied earlier. This ensures the normal infill properly covers the area and connects seamlessly with the narrow infill. **Additional Context** When "Ensure vertical shell thickness" triggers on sloping walls (e.g., spheres), it generates a Solid Infill band. This function separates the thin sections of that band. Expanding normal_infill by `scaled_spacing * 0.5` ensures the zig-zag paths physically overlap the concentric narrow lines by half a line width. This welds the plastic together during printing and prevents shrinkage gaps inside the shell. # Screenshots/Recordings/Graphs **Before fix:** <img width="1499" height="792" alt="Screenshot 2026-03-15 о 2 54 26 пп" src="https://github.com/user-attachments/assets/6bad4da1-d74d-4321-b853-48c9fba9ba5b" /> <img width="1504" height="814" alt="Screenshot 2026-03-15 о 2 54 35 пп" src="https://github.com/user-attachments/assets/2ccbea06-1c4c-4289-9633-cdd012b3296d" /> **After fix:** When "Detect narrow internal solid infill" is **enabled**: <img width="1512" height="982" alt="Screenshot 2026-03-15 о 3 51 00 пп" src="https://github.com/user-attachments/assets/c65c2d87-732f-4c03-975f-fe3d2b9e7404" /> When "Detect narrow internal solid infill" is **disabled**: <img width="1512" height="982" alt="Screenshot 2026-03-15 о 3 53 22 пп" src="https://github.com/user-attachments/assets/4449e26e-8deb-4562-9d0e-7307bc9f68ff" /> ## Tests See attached screenshots. **NOTE**: This PR addresses the gaps between sparse infill and walls that occur when both `Detect narrow internal solid infill` and `Ensure vertical shell thickness` are enabled. While a gap remains when `Detect narrow internal solid infill` is disabled (where a zig-zag line is expected), this fix improves print quality for the primary use case. Additionally, these changes bring the output closer to the behaviour seen in Bambu Studio. Given the partial improvement, I believe this is ready for merge Fix #12304
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/OrcaSlicer#323