Fix: small covered regions (e.g. lego studs) not detected as fully covered on transition layers#182
Merged
jgphilpott merged 4 commits intomainfrom Mar 8, 2026
Merged
Conversation
…regions (lego studs) Co-authored-by: jgphilpott <4128208+jgphilpott@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix skin generation for Lego brick G-code
Fix: small covered regions (e.g. lego studs) not detected as fully covered on transition layers
Mar 8, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes exposure-detection behavior on transition layers where small covered regions (e.g., lego studs) were not being recognized as “fully covered,” causing those areas to get skin infill instead of regular infill.
Changes:
- Remove the 10% minimum size-ratio guard in
findCoveredRegions, allowing legitimately small covered features to be detected. - Add a regression test covering the “small cylinders on a slab” scenario and asserting
TYPE: SKIN+TYPE: FILLbehavior on a transition layer. - Regenerate the
lego-brick.gcodebenchmark artifact (LFS pointer update).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/slicer/skin/exposure/cavity.coffee | Updates covered-region detection heuristic by removing the minimum size-ratio bound and documenting the rationale. |
| src/slicer/skin/exposure/cavity.test.coffee | Adds a lego-stud-style regression test intended to ensure small covered features produce regular infill under them on transition layers. |
| resources/gcode/benchmarks/lego-brick.gcode | Updates the stored benchmark output (Git LFS pointer) to reflect new slicing behavior. |
Owner
|
@copilot apply changes based on the comments in this thread |
…s, stronger fill-region assertion Co-authored-by: jgphilpott <4128208+jgphilpott@users.noreply.github.com>
Contributor
Author
Applied all four review suggestions in commit 3660889:
|
jgphilpott
approved these changes
Mar 8, 2026
This was referenced Mar 8, 2026
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
findCoveredRegionscavity.coffee: remove the 10% minimum size ratio lower bound; keep 55% upper bound and all other guardscavity.test.coffeelego-brick.gcodebenchmark — layers 151-154 now show SKIN (outer ring) + FILL (under each stud) instead of solid SKINcavity.coffeecomment: "its area" → "the candidate region's area" (reviewer feedback)setNozzleDiameter(0.4)andsetExposureDetectionResolution(961)to test (reviewer feedback)fillRegionsand assert ≥6 (one per stud) (reviewer feedback)🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.