fix(shelf): floor-anchor cubby no-bottom divider + embed bookshelf divider depth

- Cubby without a bottom board: the lowest cell opens onto the floor, but its
  column divider still started at the (missing) bottom board's top, leaving it
  floating ~thickness above the floor. Anchor it at y=0 when there's no bottom.

- Bookshelf full-height divider: it crosses the continuous shelves, so it can't
  share their depth plane (proud at the front, coplanar with the back panel —
  z-fighting down the centre back). Recess its depth to sit fully INSIDE the
  boards' depth: embedded at each shelf crossing (board occludes it) and tucked
  inside the back panel.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Wassim SAMAD
2026-06-16 13:05:47 -04:00
co-authored by Claude Opus 4.8
parent c68dfa2095
commit e079615196
+11 -2
View File
@@ -242,7 +242,14 @@ function buildBookshelf(group: Group, node: ShelfNode, materials: ShelfSlotMater
for (let c = 1; c < node.columns; c++) {
const x = -innerWidth / 2 + c * colStep
const divider = stampShelfSlot(
new Mesh(new BoxGeometry(node.thickness, fy.height, node.depth), materials.frame),
// A full-height divider crosses the shelves, so its depth must sit
// INSIDE the boards' (already recessed) depth: embedded at each crossing
// (the board occludes it — no coplanar fight) and tucked inside the back
// panel, rather than proud at the front / coplanar with the back.
new Mesh(
new BoxGeometry(node.thickness, fy.height, node.depth - 4 * BOARD_INSET),
materials.frame,
),
'frame',
)
divider.name = `shelf-divider-col-${c}`
@@ -343,7 +350,9 @@ function buildCubby(group: Group, node: ShelfNode, materials: ShelfSlotMaterials
const colStep = innerWidth / node.columns
const rowStep = node.height / node.rows
for (let r = 0; r < node.rows; r++) {
const cellBottomY = node.thickness + r * rowStep
// Without a bottom board the lowest cell opens onto the floor, so its
// divider must reach y=0 rather than rest on a (missing) board top.
const cellBottomY = r === 0 && !node.withBottom ? 0 : node.thickness + r * rowStep
const cellTopY = node.thickness + (r + 1) * rowStep
const dividerHeight = cellTopY - cellBottomY - node.thickness
if (dividerHeight <= 0) continue