feat(paint-slots): migrate fence onto the unified slot model

Fence joins the node.slots paint model with one paintable 'surface' slot
(merged post/base/rail geometry is a single mesh). Resolution order matches
slab: textures-off joinery role -> node.slots.surface ref -> legacy inline
material/preset -> declared default (library:wood-finewood27). Tags the mesh
userData.slotId='surface' and wires capabilities.slots + paint. Stops
borrowing DEFAULT_STAIR_MATERIAL.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Wassim SAMAD
2026-06-17 15:29:20 -04:00
co-authored by Claude Opus 4.8
parent a8f32dd47a
commit 5555ad1fe0
4 changed files with 115 additions and 8 deletions
+14
View File
@@ -0,0 +1,14 @@
import type { AnyNode, FenceNode } from '@pascal-app/core'
import { createSlotPaintCapability, previewGeometrySlot } from '../shared/slot-paint'
export const fencePaint = createSlotPaintCapability({
resolveRole: () => 'surface',
applyPreview: previewGeometrySlot,
legacyEffective: (node: AnyNode) => {
const fence = node as FenceNode
if (fence.materialPreset || fence.material) {
return { material: fence.material, materialPreset: fence.materialPreset }
}
return null
},
})