From aaff0d06df7bd153770f478ba5f5ac2198ce5cc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A5=D0=B0=D0=BB=D0=B8=D0=BC=D0=BE=D0=B2=20=D0=A0=D1=83?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D0=BC?= Date: Mon, 12 Jan 2026 21:26:38 +0300 Subject: [PATCH] Fix height --- src/services/geometryGenerator.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/services/geometryGenerator.ts b/src/services/geometryGenerator.ts index 702cdcc..a0a29af 100644 --- a/src/services/geometryGenerator.ts +++ b/src/services/geometryGenerator.ts @@ -318,6 +318,9 @@ export const createBinGeometry = ( const lengthRatio = pMax - pMin; const midRatio = pMin + (lengthRatio / 2); + // FIX: Subtract thickness because partitions sit ON TOP of the floor + const effectiveHeight = Math.max(0.1, p.height - thickness); + // --- PERFORATED LOGIC FOR PARTITIONS --- // If enabled, use Plate. Else use Extrude Solid. const usePerf = perforation && perforation.enabled; @@ -334,7 +337,7 @@ export const createBinGeometry = ( pY = (-innerDepth / 2) + (innerDepth * midRatio); // Center of partition // Create Plate (Length, Height) - const plate = createPerforatedPlate(pLen, p.height, thickness, perforation!); + const plate = createPerforatedPlate(pLen, effectiveHeight, thickness, perforation!); plate.translate(-pLen / 2, 0, 0); // Center X // Rotate to align with Depth (along Z) @@ -352,7 +355,7 @@ export const createBinGeometry = ( pX = (-innerWidth / 2) + (innerWidth * midRatio); pY = (-innerDepth / 2) + (innerDepth * p.offset); - const plate = createPerforatedPlate(pLen, p.height, thickness, perforation!); + const plate = createPerforatedPlate(pLen, effectiveHeight, thickness, perforation!); plate.translate(-pLen / 2, 0, 0); // Center X // Already aligned with X. Thickness along Z. @@ -381,7 +384,7 @@ export const createBinGeometry = ( } const partShape = createRoundedRectShape(pWidth, pDepth, 0.1); - const partGeo = new THREE.ExtrudeGeometry(partShape, { depth: p.height, bevelEnabled: false }); + const partGeo = new THREE.ExtrudeGeometry(partShape, { depth: effectiveHeight, bevelEnabled: false }); partGeo.rotateX(-Math.PI / 2); partGeo.translate(pX, thickness, pY); geometries.push(partGeo); @@ -409,8 +412,9 @@ export const createBinGeometry = ( const hEnd = Math.min(p.height, getNeighborHeight(pMax)); const addFillet = (x: number, y: number, rotY: number, h: number) => { - if (h <= 1) return; - const geo = new THREE.ExtrudeGeometry(filletShape, { depth: h, bevelEnabled: false }); + const hEff = Math.max(0.1, h - thickness); + if (hEff <= 1) return; + const geo = new THREE.ExtrudeGeometry(filletShape, { depth: hEff, bevelEnabled: false }); geo.rotateX(-Math.PI / 2); geo.rotateY(rotY); geo.translate(x, thickness, y);