bc-model-viewer 1.6.90 → 1.6.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bc-model-viewer.min.js +1 -1
- package/examples/hhds.html +87 -0
- package/package.json +1 -1
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
<title>Bc-model-viewer</title>
|
|
8
|
+
<style>
|
|
9
|
+
body {
|
|
10
|
+
margin: 0;
|
|
11
|
+
position: relative;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.demo {
|
|
15
|
+
position: absolute;
|
|
16
|
+
z-index: 1;
|
|
17
|
+
top: 0;
|
|
18
|
+
}
|
|
19
|
+
</style>
|
|
20
|
+
</head>
|
|
21
|
+
|
|
22
|
+
<body>
|
|
23
|
+
<div id="container">
|
|
24
|
+
</div>
|
|
25
|
+
<div class="demo">
|
|
26
|
+
<h2>汇鸿大厦演示</h2>
|
|
27
|
+
<p></p>
|
|
28
|
+
<button onclick="viewer.activateSceneByName('2F')">切换2F场景</button>
|
|
29
|
+
<button onclick="viewer.activateSceneByName('12F')">切换12F场景</button>
|
|
30
|
+
<button onclick="viewer.activateSceneByName('glf')">锅炉房</button>
|
|
31
|
+
<button onclick="viewer.activateSceneByName('jz')">建筑</button>
|
|
32
|
+
<button onclick="tool.deactivate()">停用工具(Esc)</button>
|
|
33
|
+
<button onclick="tool.toggle()">切换工具状态</button>
|
|
34
|
+
<br>
|
|
35
|
+
<button onclick="tool.removeLast()">清除上一次</button>
|
|
36
|
+
<button onclick="tool.clear()">清除所有</button>
|
|
37
|
+
<br>
|
|
38
|
+
<button onclick="console.log(tool.getMeasurements())">打印数据</button>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<script type="module">
|
|
42
|
+
|
|
43
|
+
import { Viewer, FaceDistanceMeasureTool } from '../../index.ts'
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
const container = document.getElementById('container')
|
|
47
|
+
|
|
48
|
+
// 实例化 Viewer 对象
|
|
49
|
+
const viewer = new Viewer(container, {
|
|
50
|
+
style: {
|
|
51
|
+
background: {
|
|
52
|
+
color: "#00005B",
|
|
53
|
+
middleColor: "#00005B",
|
|
54
|
+
gradientColor: "#00005B",
|
|
55
|
+
},
|
|
56
|
+
// axes: {
|
|
57
|
+
// show: false,
|
|
58
|
+
// },
|
|
59
|
+
// edge: {
|
|
60
|
+
// enabled: false,
|
|
61
|
+
// },
|
|
62
|
+
},
|
|
63
|
+
render: {
|
|
64
|
+
webGLRenderer: {
|
|
65
|
+
logarithmicDepthBuffer: true,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
load: {
|
|
69
|
+
proxy: {
|
|
70
|
+
enabled: false,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
// 加载测试模型
|
|
77
|
+
// await viewer.loadZipAsync('../../assets/dgz/建筑.dgz')
|
|
78
|
+
await viewer.loadZipAsync('../../assets/112211.dgz')
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
window.viewer = viewer
|
|
83
|
+
</script>
|
|
84
|
+
|
|
85
|
+
</body>
|
|
86
|
+
|
|
87
|
+
</html>
|