fix(paint-slots): nudge fence vertical members 0.001m thinner than the rails

The posts/infill and the accent rail shared the same panelDepth*0.35 depth, so
their faces were coplanar where they cross -> z-fighting. Make the verticals
0.001m shy so the rail wins the depth test cleanly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Wassim SAMAD
2026-06-17 21:12:53 -04:00
co-authored by Claude Opus 4.8
parent f7e774485c
commit 0e8df1b946
@@ -217,10 +217,12 @@ function createFenceParts(fence: FenceNode): FenceSlotParts {
// End posts are the structural `posts` slot; the intermediate verticals are // End posts are the structural `posts` slot; the intermediate verticals are
// the `infill` slats (only present when showInfill adds them). // the `infill` slats (only present when showInfill adds them).
// Depth is 0.001 m shy of the accent rail's `panelDepth * 0.35` so the two
// never share a coplanar face where they cross (kills the rail z-fighting).
;(isEdgePost ? posts : infill).push({ ;(isEdgePost ? posts : infill).push({
position: [frame.point.x, postY, frame.point.y], position: [frame.point.x, postY, frame.point.y],
rotationY: -frame.tangentAngle, rotationY: -frame.tangentAngle,
scale: [postWidth, postHeight, Math.max(panelDepth * 0.35, 0.012)], scale: [postWidth, postHeight, Math.max(panelDepth * 0.35 - 0.001, 0.011)],
}) })
} }