2
This commit is contained in:
@@ -99,40 +99,23 @@ export const createBinGeometry = (
|
||||
geometries.push(wallGeo);
|
||||
|
||||
partitions.forEach(p => {
|
||||
// Поддержка T-junctions: учитываем min и max
|
||||
const pMin = p.min ?? 0;
|
||||
const pMax = p.max ?? 1;
|
||||
|
||||
const lengthRatio = pMax - pMin;
|
||||
const midRatio = pMin + (lengthRatio / 2);
|
||||
|
||||
let pWidth = 0, pDepth = 0, pX = 0, pY = 0;
|
||||
|
||||
if (p.axis === 'x') {
|
||||
// Вертикальная перегородка
|
||||
pWidth = thickness;
|
||||
// Длина зависит от max-min
|
||||
const length = (pMax - pMin) * innerDepth;
|
||||
pDepth = length;
|
||||
|
||||
pDepth = lengthRatio * innerDepth;
|
||||
pX = (-innerWidth / 2) + (innerWidth * p.offset);
|
||||
|
||||
// Центр перегородки по Y (Z в 3D) смещен
|
||||
// Полный диапазон от -innerDepth/2 до +innerDepth/2
|
||||
// Начало: -innerDepth/2 + (innerDepth * pMin)
|
||||
// Конец: -innerDepth/2 + (innerDepth * pMax)
|
||||
// Центр: (Начало + Конец) / 2
|
||||
const startY = (-innerDepth / 2) + (innerDepth * pMin);
|
||||
const endY = (-innerDepth / 2) + (innerDepth * pMax);
|
||||
pY = (startY + endY) / 2;
|
||||
|
||||
pY = (-innerDepth / 2) + (innerDepth * midRatio);
|
||||
} else {
|
||||
// Горизонтальная перегородка
|
||||
const length = (pMax - pMin) * innerWidth;
|
||||
pWidth = length;
|
||||
pWidth = lengthRatio * innerWidth;
|
||||
pDepth = thickness;
|
||||
|
||||
const startX = (-innerWidth / 2) + (innerWidth * pMin);
|
||||
const endX = (-innerWidth / 2) + (innerWidth * pMax);
|
||||
pX = (startX + endX) / 2;
|
||||
|
||||
pX = (-innerWidth / 2) + (innerWidth * midRatio);
|
||||
pY = (-innerDepth / 2) + (innerDepth * p.offset);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user