From e0796151962e3921f6df25130a61dd1bda2f18bb Mon Sep 17 00:00:00 2001 From: Wassim SAMAD Date: Tue, 16 Jun 2026 13:05:47 -0400 Subject: [PATCH] fix(shelf): floor-anchor cubby no-bottom divider + embed bookshelf divider depth MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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) --- packages/nodes/src/shelf/geometry.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/nodes/src/shelf/geometry.ts b/packages/nodes/src/shelf/geometry.ts index 3e4e8d14..d5d266c9 100644 --- a/packages/nodes/src/shelf/geometry.ts +++ b/packages/nodes/src/shelf/geometry.ts @@ -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