Try add wals

This commit is contained in:
Халимов Рустам
2026-01-10 22:35:25 +03:00
parent b60d7e6117
commit 9249b424fe
3 changed files with 291 additions and 237 deletions

View File

@@ -100,13 +100,30 @@ export const createBinGeometry = (
partitions.forEach(p => {
let pWidth = 0, pDepth = 0, pX = 0, pY = 0;
const pMin = p.min ?? 0;
const pMax = p.max ?? 1;
const lengthRatio = pMax - pMin;
const midRatio = pMin + (lengthRatio / 2);
if (p.axis === 'x') {
pWidth = thickness; pDepth = innerDepth;
pX = (-innerWidth / 2) + (innerWidth * p.offset); pY = 0;
// Вертикальная стенка
pWidth = thickness;
pDepth = lengthRatio * innerDepth;
pX = (-innerWidth / 2) + (innerWidth * p.offset);
// Центр по Z (Y в 2D) зависит от min/max
// innerTop = -innerDepth/2. Позиция = innerTop + (innerDepth * midRatio)
pY = (-innerDepth / 2) + (innerDepth * midRatio);
} else {
pWidth = innerWidth; pDepth = thickness;
pX = 0; pY = (-innerDepth / 2) + (innerDepth * p.offset);
// Горизонтальная стенка
pWidth = lengthRatio * innerWidth;
pDepth = thickness;
pX = (-innerWidth / 2) + (innerWidth * midRatio);
pY = (-innerDepth / 2) + (innerDepth * p.offset);
}
const pRadius = p.rounded ? Math.min(radius, thickness / 1.5) : 0;
const partShape = createRoundedRectShape(pWidth, pDepth, pRadius);
const partGeo = new THREE.ExtrudeGeometry(partShape, { depth: p.height, bevelEnabled: false, curveSegments: 8 });