#
luxiaotao1123
2021-12-13 4b3467e05cb0e2b68bc3e8ef08827e9e874562c8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
function StoreCrn(option, object) {
    this.crnBodyLength = option.crnBody.length||30;//库位长度
    this.crnBodyWidth = option.crnBody.width||50;//库位宽
    this.crnBodyHeight = option.crnBody.height||500;//库位高
    this.crnLoadLength = option.crnLoad.length||60;//库位长度
    this.crnLoadWidth = option.crnLoad.width||60;//库位宽
    this.crnLoadHeight = option.crnLoad.height||40;//库位高
    this.crnForkLength = option.crnFork.length||80;//库位长度
    this.crnForkWidth = option.crnFork.width||20;//库位宽
    this.crnForkHeight = option.crnFork.height||30;//库位高
 
    // 立柱
    var a = new THREE.Mesh(new THREE.BoxBufferGeometry(this.crnBodyLength, this.crnBodyHeight, this.crnBodyWidth), new THREE.MeshBasicMaterial({
        color: 0xff0000,
        transparent: true,
        opacity: .3
    }))
    a.name = option.crnNo + "-body";
    a.position.x = option.crnBody.position.x;
    a.position.y = option.crnBody.position.y + this.crnBodyHeight/2;
    a.position.z = option.crnBody.position.z - this.crnBodyWidth/2;
    object.addObject(a);
    // 载货台
    var b = new THREE.Mesh(new THREE.BoxBufferGeometry(this.crnLoadLength, this.crnLoadHeight, this.crnLoadWidth), new THREE.MeshBasicMaterial({
        color: 0x00ff00,
        transparent: true,
        opacity: .5
    }))
    b.name = option.crnNo + "-load";
    b.position.x = option.crnLoad.position.x;
    b.position.y = option.crnLoad.position.y + this.crnLoadHeight/2;
    b.position.z = option.crnLoad.position.z - this.crnLoadWidth/2 + 5;
    object.addObject(b);
    // 叉牙
    var c = new THREE.Mesh(new THREE.BoxBufferGeometry(this.crnForkLength, this.crnForkWidth, this.crnForkHeight), new THREE.MeshBasicMaterial({
        color: 0xff00ff,
        transparent: true,
        opacity: 1
    }))
    c.name = option.crnNo + "-fork";
    c.position.x = option.crnFork.position.x;
    c.position.y = option.crnFork.position.y + this.crnLoadHeight/2;
    c.position.z = option.crnFork.position.z - this.crnLoadWidth/2;
    object.addObject(c);
 
}