Clean top layer with small items above #869

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

Originally created by @robplusplus on 2/5/2026

Description

When a model has small or thin raised features on its top surface — most commonly embossed/raised text — the slicer treats the geometry on the layer above as "coverage" and subtracts it from the top-surface region below. For thin text strokes this creates a fragmented top surface with interrupted extrusions, gap fill artifacts, and internal solid infill patches visible on what should be a clean, continuous top skin.

This PR adds an opt-in setting that filters out small/thin upper-layer features before they carve into the top surface below, so the layer under raised text prints as one uninterrupted top fill.

What issue does this PR address?
Raised text (and similar thin embossed details) on the top surface of a model causes the layer directly below the text to have:

Interrupted top-surface extrusions
Gap fill segments where continuous lines should be
Internal solid infill patches breaking through the top skin
This is because the slicer's top-surface detection subtracts any upper-layer geometry from the current layer, regardless of how small or thin it is. Thin text strokes are real geometry, so they fragment the top region below into slivers.

What new features or enhancements does this PR introduce?
Two new settings under Quality → Walls and surfaces (Advanced mode):

Ignore small upper-layer features (top_surface_ignore_small_upper_islands) — Bool, default off. When enabled, small or thin features on the next layer are excluded from the top-surface subtraction.
Max upper coverage ratio (top_surface_ignore_small_upper_islands_max_ratio) — Float 0–1, default 0.15. An upper-layer island is ignored if it covers at most this fraction of the current surface area. Additionally, any island that vanishes when shrunk by half the perimeter width is ignored regardless of area (catches thin text strokes that may span a large area but are structurally thin).
The filtering is evaluated per disjoint upper island, so a large legitimate feature (e.g. a raised square pad) on the same layer as thin text strokes is kept while the text is ignored.

The fix is applied at both decision points where upper-layer geometry fragments the current layer:

Perimeter generation (Classic split_top_surfaces() and Arachne process_arachne()) — prevents the geometry carve that creates interrupted extrusions and gap fill
Surface type detection (detect_surfaces_type()) — prevents misclassification of top regions as internal, which would cause wrong infill patterns
Both call sites share a single helper function (top_surface_filter_upper_islands) — no code duplication.

Are there any breaking changes or dependencies?
No breaking changes. The feature is off by default; when disabled, all code paths are identical to upstream.
No new dependencies. Uses existing Clipper geometry operations already in the codebase.
Preset compatible. Both settings are added to the preset whitelist and trigger perimeter regeneration when changed.

Screenshots/Recordings/Graphs

https://github.com/user-attachments/assets/c0ed01d1-5325-47b7-be52-bc7d8ac7c2e3

Fixes:
#10937
#7402
#5738

*Originally created by @robplusplus on 2/5/2026* # Description When a model has small or thin raised features on its top surface — most commonly embossed/raised text — the slicer treats the geometry on the layer above as "coverage" and subtracts it from the top-surface region below. For thin text strokes this creates a fragmented top surface with interrupted extrusions, gap fill artifacts, and internal solid infill patches visible on what should be a clean, continuous top skin. This PR adds an opt-in setting that filters out small/thin upper-layer features before they carve into the top surface below, so the layer under raised text prints as one uninterrupted top fill. What issue does this PR address? Raised text (and similar thin embossed details) on the top surface of a model causes the layer directly below the text to have: Interrupted top-surface extrusions Gap fill segments where continuous lines should be Internal solid infill patches breaking through the top skin This is because the slicer's top-surface detection subtracts any upper-layer geometry from the current layer, regardless of how small or thin it is. Thin text strokes are real geometry, so they fragment the top region below into slivers. What new features or enhancements does this PR introduce? Two new settings under Quality → Walls and surfaces (Advanced mode): Ignore small upper-layer features (top_surface_ignore_small_upper_islands) — Bool, default off. When enabled, small or thin features on the next layer are excluded from the top-surface subtraction. Max upper coverage ratio (top_surface_ignore_small_upper_islands_max_ratio) — Float 0–1, default 0.15. An upper-layer island is ignored if it covers at most this fraction of the current surface area. Additionally, any island that vanishes when shrunk by half the perimeter width is ignored regardless of area (catches thin text strokes that may span a large area but are structurally thin). The filtering is evaluated per disjoint upper island, so a large legitimate feature (e.g. a raised square pad) on the same layer as thin text strokes is kept while the text is ignored. The fix is applied at both decision points where upper-layer geometry fragments the current layer: Perimeter generation (Classic split_top_surfaces() and Arachne process_arachne()) — prevents the geometry carve that creates interrupted extrusions and gap fill Surface type detection (detect_surfaces_type()) — prevents misclassification of top regions as internal, which would cause wrong infill patterns Both call sites share a single helper function (top_surface_filter_upper_islands) — no code duplication. Are there any breaking changes or dependencies? No breaking changes. The feature is off by default; when disabled, all code paths are identical to upstream. No new dependencies. Uses existing Clipper geometry operations already in the codebase. Preset compatible. Both settings are added to the preset whitelist and trigger perimeter regeneration when changed. # Screenshots/Recordings/Graphs https://github.com/user-attachments/assets/c0ed01d1-5325-47b7-be52-bc7d8ac7c2e3 Fixes: #10937 #7402 #5738
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/OrcaSlicer#869