Fix dome zenith skin infill suppressed by hole paths misclassified as covered regions#187
Conversation
…dRegions Co-authored-by: jgphilpott <4128208+jgphilpott@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes a regression in exposure-based skin generation where small hole boundaries near a dome cavity zenith were being misclassified as “fully covered regions,” which incorrectly suppressed skin infill. This fits into the slicer’s exposure/cavity detection pipeline used to decide where adaptive skin should (and should not) be generated.
Changes:
- Update covered-region detection to skip candidates deemed to be hole paths (enclosed by another path in the same candidate set).
- Add a dome-zenith regression test to ensure skin infill is generated near the cavity zenith.
- Regenerate several committed G-code example/benchmark outputs (Git LFS pointers updated).
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/slicer/skin/exposure/cavity.coffee | Adds a hole-path exclusion check when identifying fully covered regions. |
| src/slicer/skin/exposure/cavity.test.coffee | Adds a regression test asserting skin infill exists near the dome zenith. |
| resources/gcode//.gcode | Updates Git LFS pointers for regenerated reference G-code outputs. |
You can also share your feedback on Copilot code review. Take the survey.
|
@copilot apply changes based on the comments in this thread |
…t config, stable assertions Co-authored-by: jgphilpott <4128208+jgphilpott@users.noreply.github.com>
Done in commit 27555e5. All four review comments are addressed:
|
PR 182 removed the 10% minimum size ratio from
findCoveredRegionsto detect small lego-stud features. This regressed the dome example: small circular hole boundaries near the cavity zenith passed all remaining checks and were incorrectly classified as fully covered regions, suppressing their skin infill entirely.Root cause
coveringRegionsBelowfor dome zenith layers contains both the outer square boundary (filtered by the boundary-touch check) and the small circular hole boundary (not filtered). The hole circle is interior, has a tiny size ratio vs the outer square (≪55%), and is fully overlapped by the above layer's solid — so it was added tofullyCoveredSkinWallsand excluded from infill generation.Fix
cavity.coffee— After the boundary-touch check, classify each candidate using the even-odd nesting parity rule: count how many other paths inregionCandidatescontain the candidate's bounding-box centre (using a bounding-box prefilter before the fullpointInPolygontest). An odd count means the candidate sits inside an odd number of enclosing paths — it is empty space (a hole or cavity) in the adjacent layer and is skipped. An even count (including 0) means it is a solid structure and proceeds normally.This correctly handles arbitrarily deep nesting (
structure → hole → structure → …):And correctly distinguishes the original two cases:
coveringRegionsAbove(nesting count = 0, even) → still detected as covered ✓cavity.test.coffee— AddedDome Zenith Skin Infill (Regression)test verifying skin infill is generated on layers 49–54 near the dome zenith. The test setssetNozzleDiameter,setExposureDetectionResolution, andsetInfillPatternexplicitly to avoid reliance on slicer defaults. Assertions use a per-layer presence check (at least 3 of 6 zenith layers must have skin infill) rather than a brittle absolute count.resources/gcode/skin/dome/— Regenerated upright, flipped, and sideways GCode examples with the fix applied.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.