廖杰:风压阀动态添加墙壁功能大致完成

This commit is contained in:
Hcat
2023-12-23 15:13:44 +08:00
parent 7684e21d33
commit c27f1a5652
5 changed files with 35 additions and 21 deletions

View File

@@ -76,7 +76,7 @@ async function handleMounted() {
demo = new ThreeDScene(three, content.value);
//看是不是预览模式,然后继续相关的操作(会在demo中的初始化中进行)
demo.isedit = params.isedit;
let tunnelasync = await demo.loadModel(GLTFLoader, "./assets/tunnelModel/chanel-No-have-wall.gltf");
let tunnelasync = await demo.loadModel(GLTFLoader, "./assets/tunnelModel/chanel-have-wall.gltf");
demo.addOrbitControls(OrbitControls);
demo.addTween(TWEEN);
demo.addCSS3Renderer(CSS3DRenderer, CSS3DSprite, doms);

View File

@@ -76,7 +76,7 @@ async function handleMounted() {
const loaded = await demo.loadModel(
GLTFLoader,
"./assets/tunnelModel/chanel.gltf"
"./assets/tunnelModel/chanel-have-wall.gltf"
);
demo.addOrbitControls(OrbitControls);
demo.addTween(TWEEN);
@@ -229,6 +229,7 @@ function handleCancel() {
demo._resetState();
demo.clearTagsObj();
}
//现在首先有二种方案是写在TunnelScene.vue中还是demo.js中呢
//我认为可能看数据在哪获取到时候看在哪里导入首先我们放在TunnelScene里面吧
//因为没获取到接口,我们先写死!!!

View File

@@ -164,6 +164,8 @@ export default class Demo {
this._hoverModel(this.points);
// 可以进行点击
this._ClickModel(this.points);
//将墙壁进行隐藏
this.WallInit()
}
// 在此方法中对模型批量操作,这里遍历附着点
@@ -485,5 +487,16 @@ export default class Demo {
opacityTween(0.1, 0.5, true);
}
}
//初始将墙壁进行隐藏
WallInit() {
for (let line = 1; line <= 20; line++) {
if (line < 10) {
let wall = 'wall_' + '0' + line
this.scene.getObjectByName(wall).visible = false
} else if (line >= 10) {
let wall = 'wall_' + line
this.scene.getObjectByName(wall).visible = false
}
}
}
}

View File

@@ -1,14 +1,14 @@
export function editTunnelInit(equipmentList) {
//初始化将墙壁隐藏起来
for (let line = 1; line <= 20; line++) {
if (line < 10) {
let wall = 'wall_' + '0' + line
this.scene.getObjectByName(wall).visible = false
} else if (line >= 10) {
let wall = 'wall_' + line
this.scene.getObjectByName(wall).visible = false
}
}
// for (let line = 1; line <= 20; line++) {
// if (line < 10) {
// let wall = 'wall_' + '0' + line
// this.scene.getObjectByName(wall).visible = false
// } else if (line >= 10) {
// let wall = 'wall_' + line
// this.scene.getObjectByName(wall).visible = false
// }
// }
equipmentList.forEach((item) => {
const formInfo = {

View File

@@ -1,14 +1,14 @@
export default function previewtunnelModeInit(equipmentList) {
//初始化将墙壁隐藏起来
for (let line = 1; line <= 20; line++) {
if (line < 10) {
let wall = 'wall_' + '0' + line
this.scene.getObjectByName(wall).visible = false
} else if (line >= 10) {
let wall = 'wall_' + line
this.scene.getObjectByName(wall).visible = false
}
}
// for (let line = 1; line <= 20; line++) {
// if (line < 10) {
// let wall = 'wall_' + '0' + line
// this.scene.getObjectByName(wall).visible = false
// } else if (line >= 10) {
// let wall = 'wall_' + line
// this.scene.getObjectByName(wall).visible = false
// }
// }
equipmentList.forEach((item) => {
const formInfo = {