From c0bbca1e72469a432f3e15e3af98eff2778a26a4 Mon Sep 17 00:00:00 2001 From: hzz Date: Fri, 16 Jun 2023 14:29:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B93D=E5=88=86=E5=B8=83=E5=9B=BE?= =?UTF-8?q?=20=E7=BD=91=E7=BB=9C=E8=BF=9E=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/FactoryView/threeMap.vue | 70 ++++++++++++++------------ src/views/FactoryViewTopo/threeMap.vue | 6 ++- 2 files changed, 42 insertions(+), 34 deletions(-) diff --git a/src/views/FactoryView/threeMap.vue b/src/views/FactoryView/threeMap.vue index c33f7f5..c74fda2 100644 --- a/src/views/FactoryView/threeMap.vue +++ b/src/views/FactoryView/threeMap.vue @@ -404,10 +404,10 @@ const init = () => { /**创建ac */ - createAc({x:52.56,y:0,z:52.24}) + createAc({ x: 52.56, y: 0, z: 52.24 }) //服装军团 - createAc({x:-88.39,y:0,z:-249.36}) - createAc({x:82.99,y:0,z:-170.17}) + createAc({ x: -88.39, y: 0, z: -249.36 }) + createAc({ x: 82.99, y: 0, z: -170.17 }) /**创建AC结束 */ @@ -442,7 +442,11 @@ const init = () => { /*创建第一条线******************/ let garyLine = 0x595959; let whiteColor = 0xffffff; - createLine(whiteColor, [{ x: -346.00, y: 23.6, z: 59.40 }, { x: -160.50, y: 2, z: 142.08 }], 2) + createLine(whiteColor, [ + { x: -346.00, y: 23.6, z: 39.78 }, + { x: -159.75, y: 2, z: 39.78 }, + { x: -159.75, y: 2, z: 139.78 }, + ], 2) //服装 createLine(whiteColor, [ { x: -345.65, y: 2, z: 36.40 }, @@ -457,7 +461,7 @@ const init = () => { ]) - createLine(garyLine, [{x:-88.73,y:2,z:-249.01},{x:-88.73,y:2,z:-117.33} , { x: -174.65, y: 2, z: -117.33 }]) + createLine(garyLine, [{ x: -88.73, y: 2, z: -249.01 }, { x: -88.73, y: 2, z: -117.33 }, { x: -174.65, y: 2, z: -117.33 }]) //汽车军团 createLine(whiteColor, [{ x: -293.44, y: 2, z: 52.52 }, { x: -293.44, y: 2, z: 36.40 }, { x: -235.84, y: 2, z: -30.87 }], 2) //机加 @@ -505,7 +509,7 @@ const init = () => { { x: -164.26, y: 2, z: 30.98 }, { x: -164.26, y: 2, z: 140.05 } - ],2) + ], 2) createLine(garyLine, [ { x: -164.26, y: 2, z: 140.05 }, { x: -214.35, y: 2, z: 140.05 } @@ -513,10 +517,10 @@ const init = () => { ]) //大件 总---精饰 createLine(garyLine, [ - { x: 26.61, y: 2, z: -27.08 }, + { x: 26.61, y: 2, z: -27.08 }, { x: 26.61, y: 2, z: 39.27 }, { x: -0.90, y: 2, z: 39.27 }, - {x:-0.90,y:2,z:52.24}, + { x: -0.90, y: 2, z: 52.24 }, { x: 133.97, y: 2, z: 53.16 }, { x: 133.97, y: 2, z: 154.31 } ]) @@ -525,13 +529,13 @@ const init = () => { { x: 53.43, y: 2, z: 53.16 }, { x: 53.43, y: 2, z: 154.31 } ]) -/** - * - { x: 26.61, y: 2, z: -27.08 }, - { x: 26.61, y: 2, z: 39.27 }, - { x: -0.90, y: 2, z: 39.27 }, - { x: 53.43, y: 2, z: 154.31 } - */ + /** + * + { x: 26.61, y: 2, z: -27.08 }, + { x: 26.61, y: 2, z: 39.27 }, + { x: -0.90, y: 2, z: 39.27 }, + { x: 53.43, y: 2, z: 154.31 } + */ //电控 createLine(whiteColor, [ { x: -292.24, y: 2, z: 30.98 }, @@ -554,7 +558,7 @@ const init = () => { createLine(whiteColor, [ { x: 18.30, y: 2, z: 30.98 }, { x: 18.30, y: 2, z: -28.94 } - ],2) + ], 2) setTipDom() sethoveMesh() @@ -609,7 +613,7 @@ const init = () => { // console.log("非正常坐标", "{x:" + (+selected.point.x - 0.83).toFixed(2) + ",y:2 ,z:" + (selected.point.z + 3.52).toFixed(2) + "}"); let workerShop = intersects[0]?.object?.name if (workerShopRoute.hasOwnProperty(workerShop) && !edit) { - router.push({ path: workerShopRoute[workerShop],query:{isBack:'back'} }) + router.push({ path: workerShopRoute[workerShop], query: { isBack: 'back' } }) } } @@ -747,7 +751,7 @@ function createLine(color: number, pointsList: any, width: number = 4) { color: color, transparent: true, // opacity: 0.5, - dashed: width !== 2?true:false, + dashed: width !== 2 ? true : false, dashScale: 1, dashSize: 3, gapSize: 1, @@ -831,21 +835,21 @@ const createSwitch = (boxposition: positionType, shadow: boolean = true): object const createAc = (boxposition: positionType, shadow: boolean = true): object => { -const wallTexture = new THREE.TextureLoader().load(requires.ac); -const wall = new THREE.BoxGeometry(15, 5, 10); -const wallMaterial = new THREE.MeshPhongMaterial({ - map: wallTexture, - color: 0xe7e7e7, - transparent: true, -}); -//墙体的网格 -const wallMesh = new THREE.Mesh(wall, wallMaterial); -// 物体移动位置 -// wallMesh.position.set((-size.baseWidth / 2 + boxposition.x + 1), size.baseHeght / 2 + boxposition.y, -size.baseLength / 2 + boxposition.z); -wallMesh.position.set(boxposition.x, 5 + boxposition.y, boxposition.z); -// 将立方体添加到场景中 -group.add(wallMesh) -return wallMesh + const wallTexture = new THREE.TextureLoader().load(requires.ac); + const wall = new THREE.BoxGeometry(15, 5, 10); + const wallMaterial = new THREE.MeshPhongMaterial({ + map: wallTexture, + color: 0xe7e7e7, + transparent: true, + }); + //墙体的网格 + const wallMesh = new THREE.Mesh(wall, wallMaterial); + // 物体移动位置 + // wallMesh.position.set((-size.baseWidth / 2 + boxposition.x + 1), size.baseHeght / 2 + boxposition.y, -size.baseLength / 2 + boxposition.z); + wallMesh.position.set(boxposition.x, 5 + boxposition.y, boxposition.z); + // 将立方体添加到场景中 + group.add(wallMesh) + return wallMesh } diff --git a/src/views/FactoryViewTopo/threeMap.vue b/src/views/FactoryViewTopo/threeMap.vue index 5928a97..886f96f 100644 --- a/src/views/FactoryViewTopo/threeMap.vue +++ b/src/views/FactoryViewTopo/threeMap.vue @@ -429,7 +429,11 @@ const init = () => { /*创建第一条线******************/ let garyLine = 0x595959; let whiteColor = 0xffffff; - createLine(whiteColor, [{ x: -346.00, y: 23.6, z: 59.40 }, { x: -160.50, y: 2, z: 142.08 }], 2) + createLine(whiteColor, [ + { x: -346.00, y: 23.6, z: 39.78 }, + { x: -159.75, y: 2, z: 39.78 }, + { x: -159.75, y: 2, z: 139.78 }, + ], 2) //服装 createLine(whiteColor, [ { x: -345.65, y: 2, z: 36.40 },