|
|
|
@ -25,7 +25,6 @@ export default class Rack3dObject extends THREE.Object3D { |
|
|
|
private static rackHorizontalBarGeometryMap: Map<number, BufferGeometry> = new Map<number, BufferGeometry>() |
|
|
|
private static rackHorizontalBarMaterial: Material = null |
|
|
|
|
|
|
|
bottomBarHeight = 0.2 |
|
|
|
bottomLinkHeight = 0.2 |
|
|
|
topLinkDistance = 0.2 |
|
|
|
|
|
|
|
@ -297,7 +296,10 @@ export default class Rack3dObject extends THREE.Object3D { |
|
|
|
const heights = [] |
|
|
|
for (let i = 0; i < item.dt.bays.length; i++) { |
|
|
|
const bay = item.dt.bays[i] |
|
|
|
const bayHeight = decimalSumBy(bay.levelHeight) |
|
|
|
if (bay.topHeight == null || bay.topHeight < 0) { |
|
|
|
bay.topHeight = 0.5 |
|
|
|
} |
|
|
|
const bayHeight = bay.levelHeight[bay.levelHeight.length - 1] + bay.topHeight |
|
|
|
heights.push(bayHeight) |
|
|
|
} |
|
|
|
const rackHeight = _.max(heights) |
|
|
|
@ -357,16 +359,15 @@ export default class Rack3dObject extends THREE.Object3D { |
|
|
|
const hBarMatrix: { x: number, y: number, z: number, sx: number, sy: number, sz: number, rx: number, ry: number, rz: number, l: number }[] = [] |
|
|
|
distanceX = 0 |
|
|
|
for (let i = 0; i < item.dt.bays.length; i++) { |
|
|
|
distanceY = this.bottomBarHeight |
|
|
|
const bay = item.dt.bays[i] |
|
|
|
for (let j = 0; j < bay.levelHeight.length; j++) { |
|
|
|
const levelHeight = bay.levelHeight[j] |
|
|
|
if (distanceY <= 0) { |
|
|
|
const levelHeight = bay.levelHeight[j] - 0.05 // 0.05为横梁自身高度的一半
|
|
|
|
if (levelHeight <= 0.0) { |
|
|
|
continue |
|
|
|
} |
|
|
|
hBarMatrix.push({ |
|
|
|
x: distanceX - rackWidth / 2, |
|
|
|
y: distanceY, |
|
|
|
y: levelHeight, |
|
|
|
z: -rackDepth / 2, |
|
|
|
sx: 1, |
|
|
|
sy: 0.8, |
|
|
|
@ -378,7 +379,7 @@ export default class Rack3dObject extends THREE.Object3D { |
|
|
|
}) |
|
|
|
hBarMatrix.push({ |
|
|
|
x: distanceX - rackWidth / 2, |
|
|
|
y: distanceY, |
|
|
|
y: levelHeight, |
|
|
|
z: item.dt.rackDepth - rackDepth / 2, |
|
|
|
sx: 1, |
|
|
|
sy: 0.8, |
|
|
|
@ -388,7 +389,7 @@ export default class Rack3dObject extends THREE.Object3D { |
|
|
|
rz: 0, |
|
|
|
l: bay.bayWidth |
|
|
|
}) |
|
|
|
distanceY += levelHeight |
|
|
|
distanceY = levelHeight |
|
|
|
} |
|
|
|
distanceX += bay.bayWidth |
|
|
|
} |
|
|
|
|