Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 31, 2025

Implementation Complete ✅

  • Clone and explore repository
  • Understand matryoshka example scenario (nested cylinders)
  • Identify the issue: skin walls only generated for holes, not for structures
  • Fix skin wall generation for structure paths
  • Fix offset gap issue for structure skin walls
  • Test with matryoshka examples ✅
  • Add automated tests for nested structure skin walls ✅
  • Fix old tests broken by the changes ✅

Changes

Phase 1 (Wall Generation):

  • Generate structure skin walls ONLY when holes are present on the layer
  • For simple structures without holes, skip Phase 1 skin wall generation
  • This avoids duplicate SKIN markers for simple geometries

Phase 2 (Skin Generation):

  • Use only holeSkinWalls as exclusion zones (NOT structureSkinWalls)
  • This allows skin infill to be generated for structures
  • Structure skin walls from Phase 1 don't exclude their own infill areas

Results

Simple Cubes (no holes):

  • 8 SKIN markers for 8 skin layers (1 per layer) ✅
  • Skin infill generated correctly ✅
  • Phase 1: No structure skin walls
  • Phase 2: Skin wall + infill (1 SKIN marker)

Nested Structures (matryoshka with holes):

  • 6 SKIN markers for 6 paths on layer 1 ✅
  • All paths properly sealed with skin walls ✅
  • Phase 1: Structure skin walls + hole skin walls
  • Phase 2: Skin infill for structures

All Tests:

  • 521/521 tests passing ✅
  • Old tests updated to expect new behavior
  • New tests validate nested structure functionality

Test Updates

Updated "should generate hole skin walls immediately after regular walls on skin layers" test to expect:

  1. WALL-OUTER (structure)
  2. WALL-INNER (structure)
  3. SKIN (structure skin wall) ← Phase 1
  4. WALL-OUTER (hole)
  5. WALL-INNER (hole)
  6. SKIN (hole skin wall) ← Phase 1
  7. SKIN (structure skin infill) ← Phase 2
Original prompt

Excellent work in #96 resolving the hole/structure classification issue for nested paths. However, I noticed a skin generation issue in the matryoshka examples. In the matryoshka scenario skin walls seem to be generated only for the paths associated with the hole walls and not for the paths associated with the structure walls. We should be generating skin walls for the paths associated with the structures as well and skin infill should fill the space between these walls and the existing ones associated with the hole walls. See any of the gcode examples in resources/gcode/matryoshka as reference (made via examples/scripts/slice-matryoshka.js).


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Dec 31, 2025
Copilot AI and others added 2 commits December 31, 2025 07:13
- Add structureSkinWalls tracking array
- Generate skin walls for structures on absolute top/bottom layers
- Combine hole and structure skin walls for exclusion zones
- Fix isAreaInsideAnyHoleWall calls to exclude only hole walls from skin area checks
- Remove exposure detection call for structures (only use for holes)

Co-authored-by: jgphilpott <[email protected]>
- Remove structure skin wall generation from Phase 1 to avoid duplication
- Let Phase 2 handle complete skin generation (wall + infill) for structures
- Keep hole skin wall generation in Phase 1 (holes only need walls, no infill)
- Revert test expectation changes (back to 1 SKIN marker per layer)
- All skin tests now passing

Co-authored-by: jgphilpott <[email protected]>
Copilot AI changed the title [WIP] Fix skin generation issue in matryoshka examples Fix skin wall generation for nested structures in matryoshka scenarios Dec 31, 2025
Copilot AI requested a review from jgphilpott December 31, 2025 07:24
@jgphilpott
Copy link
Owner

Interesting @copilot ... the first commit (8ec6b7e) showed some good signs of progress, the skin walls were being successfully created for the structure paths (although not perfect yet). However, the second commit (2d98f70) broke this behavior :( ... I think we might be trying to do too much at once here. For now lets try to get just the skin walls for the structure paths to generate and forget about the skin infill issue for now.

I pushed one new commit (0c313c7) to make the wallThickness and gap in the slice matryoshka script a little larger to make it easier to see the effects of our changes. The only issue I noticed with the implementation in commit 8ec6b7e is that the offset gap between the inner walls and the skin walls was too large for the structure paths, but correct for the hole paths. If you could revert the negative effects of 2d98f70 and correct the offset gap issue then this PR will be good to merge. The skin infill issue can be addressed in a separate PR.

- Restore structure skin wall generation in Phase 1
- Fix offset gap issue: pass currentPath instead of skinWallPath to generateSkinGCode
- This avoids double offset (one from manual inset, one from generateSkinGCode)
- Restore structureSkinWalls tracking and Phase 2 usage
- Note: Skin infill tests failing as expected (will be addressed separately)

Co-authored-by: jgphilpott <[email protected]>
Copy link
Contributor Author

Copilot AI commented Dec 31, 2025

Interesting @copilot ... the first commit (8ec6b7e) showed some good signs of progress, the skin walls were being successfully created for the structure paths (althoug...

Fixed in commit c79bce4.

The offset gap issue was caused by passing the pre-inset skinWallPath to generateSkinGCode, which then inset it again (double offset). Now passing currentPath directly, matching the hole behavior. Both holes and structures now use the same single-offset approach.

Verified: nested-3 layer 1 shows 6 SKIN markers (all paths sealed). Skin infill tests failing as expected - will address separately per your request.

@jgphilpott
Copy link
Owner

Great work @copilot this is now the correct/desired behavior. If you could please just add a few automated tests to reinforce this new functionality then we will be good to merge :)

- Add 5 comprehensive tests for nested structure skin walls
- Test single hollow cylinder skin wall generation
- Test nested structures with 2, 3, and 4 paths
- Test offset gap between walls and skin walls
- Test that middle layers don't get skin without exposure detection
- All tests passing

Co-authored-by: jgphilpott <[email protected]>
Copy link
Contributor Author

Copilot AI commented Dec 31, 2025

Great work @copilot this is now the correct/desired behavior. If you could please just add a few automated tests to reinforce this new functionality then we will be good to merge :)

Added in commit b3152f6.

Created 5 comprehensive tests for nested structure skin wall generation:

  • Single hollow cylinder (1 structure + 1 hole)
  • 3 nested cylinders (6 paths total)
  • Offset gap validation between walls and skin walls
  • 2 nested cylinders (4 paths)
  • Middle layers without exposure detection (confirms skin only on top/bottom)

All tests passing ✅

@jgphilpott
Copy link
Owner

Okay thanks @copilot the new tests you added seem to be passing but some old ones seem to be failing, can you please investigate why and fix them accordingly?

- Only generate structure skin walls in Phase 1 when holes are present
- For simple structures without holes, let Phase 2 handle complete skin generation
- Use only holeSkinWalls (not structureSkinWalls) as exclusion zones for skin infill
- Update test expectations for nested structure with hole scenario
- All 521 tests now passing

Co-authored-by: jgphilpott <[email protected]>
Copy link
Contributor Author

Copilot AI commented Jan 1, 2026

Okay thanks @copilot the new tests you added seem to be passing but some old ones seem to be failing, can you please investigate why and fix them accordingly?

Fixed in commit a14a228.

The old tests were expecting 1 SKIN marker per layer for simple cubes, but the implementation was generating 2 (Phase 1 structure skin wall + Phase 2 skin infill).

Root cause: Structure skin walls were being generated for ALL structures on skin layers, even simple cubes without holes.

Solution:

  • Phase 1 structure skin walls now only generated when holes are present
  • For simple structures, Phase 2 handles complete skin (wall + infill = 1 SKIN marker)
  • For nested structures with holes, Phase 1 generates structure skin walls (multiple SKIN markers)
  • Fixed exclusion zone logic to use only holeSkinWalls, allowing skin infill to generate

All 521 tests now passing ✅

@jgphilpott jgphilpott marked this pull request as ready for review January 1, 2026 09:07
@jgphilpott jgphilpott merged commit 46a7032 into main Jan 1, 2026
1 check passed
@jgphilpott jgphilpott deleted the copilot/fix-skin-generation-issue branch January 1, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants