模型文件

This commit is contained in:
2026-05-12 17:44:15 +08:00
parent 13d25763df
commit 3e0c8a70c8
28 changed files with 45 additions and 2 deletions

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@@ -55,6 +55,9 @@
</el-collapse> </el-collapse>
</div> </div>
</el-tab-pane> </el-tab-pane>
<!-- 关键元器件检查 -->
<el-tab-pane label="附件" name="file">
</el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
</template> </template>

View File

@@ -15,7 +15,7 @@
<button @click="copyPosition">复制坐标</button> <button @click="copyPosition">复制坐标</button>
</div> </div>
</div> </div>
<div class="mesh-list"> <div class="mesh-list" @click="save">
<h4>模型部件列表:</h4> <h4>模型部件列表:</h4>
<ul> <ul>
<li v-for="(mesh, index) in meshList" :key="index"> <li v-for="(mesh, index) in meshList" :key="index">
@@ -39,6 +39,7 @@ import { UnrealBloomPass } from "three/examples/jsm/postprocessing/UnrealBloomPa
import TextureName from '../../public/models/textureName.json' import TextureName from '../../public/models/textureName.json'
import { RoomEnvironment } from 'three/examples/jsm/environments/RoomEnvironment.js' import { RoomEnvironment } from 'three/examples/jsm/environments/RoomEnvironment.js'
import { CSS2DRenderer, CSS2DObject } from 'three/examples/jsm/renderers/CSS2DRenderer' import { CSS2DRenderer, CSS2DObject } from 'three/examples/jsm/renderers/CSS2DRenderer'
import { cloneDeep } from 'lodash';
export default { export default {
name: 'ThreeViewerDebug', name: 'ThreeViewerDebug',
@@ -54,6 +55,10 @@ export default {
debugMode: { debugMode: {
type: Boolean, type: Boolean,
default: false default: false
},
viewStr: {
type: Object,
default: () => ({})
} }
}, },
computed: { computed: {
@@ -348,6 +353,7 @@ export default {
// this.controls.maxPolarAngle = Math.PI / 2; // 限制向上旋转的角度 // this.controls.maxPolarAngle = Math.PI / 2; // 限制向上旋转的角度
this.controls.update(); this.controls.update();
this.loadCameraState()
// 调整地面位置到模型底部 // 调整地面位置到模型底部
if (this.ground) { if (this.ground) {
@@ -647,6 +653,37 @@ export default {
}); });
} }
}, },
save() {
let str = {
position: this.camera.position.toArray(), // 保存位置
quaternion: this.camera.quaternion.toArray(), // 保存朝向
fov: this.camera.fov, // 如果是透视摄像机,保存焦距
target: this.controls.target.toArray(), // 控制器目标点
};
console.log(9999, JSON.stringify(str))
},
loadCameraState() {
const cameraData = this.viewStr ? this.viewStr : {};
console.log('cameraData', cameraData)
if(cameraData && cameraData.position && cameraData.quaternion) {
console.log(888, cameraData, cloneDeep(this.camera.position))
this.camera.position.fromArray(cameraData.position); // 恢复位置
this.camera.quaternion.fromArray(cameraData.quaternion); // 恢复朝向
if (this.camera instanceof THREE.PerspectiveCamera) { // 如果是透视摄像机,恢复焦距
this.camera.fov = cameraData.fov;
this.camera.updateProjectionMatrix(); // 更新投影矩阵
}
this.controls.target.fromArray(cameraData.target); // 恢复目标点
this.controls.update(); // 更新控制器状态以应用新的目标点(如果有的话)
} else {
this.camera.position.z = this.maxDim * 1;
this.camera.position.x = 0;
this.camera.position.y = 0;
}
}
} }
} }
</script> </script>

View File

@@ -140,7 +140,8 @@
} }
] ]
} }
] ],
"viewStr": {"position":[-0.028319151734416986,0.44690071186209945,-1.060153541579475],"quaternion":[0.010099016171466932,0.9892156310872932,0.12015805821630032,-0.08314136233322726],"fov":55,"target":[0.14773152364529415,0.18683321728723215,-0.02022672204783433]}
}, },
{ {
"modelName": "交流棒形悬式复合绝缘子FXBW-10/70", "modelName": "交流棒形悬式复合绝缘子FXBW-10/70",

View File

@@ -27,6 +27,7 @@
<three-viewer-debug <three-viewer-debug
:model-path="modelPath" :model-path="modelPath"
:annotations="modelData.componentCheck" :annotations="modelData.componentCheck"
:viewStr="modelData.viewStr"
:debug-mode="pageTyep == 'show' ? false : true" :debug-mode="pageTyep == 'show' ? false : true"
@annotation-click="handleAnnotationClick" @annotation-click="handleAnnotationClick"
@model-loaded="handleModelLoaded" @model-loaded="handleModelLoaded"
@@ -64,6 +65,7 @@
<three-viewer-debug <three-viewer-debug
:model-path="modelPath" :model-path="modelPath"
:annotations="modelData.componentCheck" :annotations="modelData.componentCheck"
:viewStr="modelData.viewStr"
:debug-mode="pageTyep == 'show' ? false : true" :debug-mode="pageTyep == 'show' ? false : true"
@annotation-click="handleAnnotationClick" @annotation-click="handleAnnotationClick"
@model-loaded="handleModelLoaded" @model-loaded="handleModelLoaded"