bc-model-viewer 1.6.32 → 1.6.34
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.
|
@@ -0,0 +1,60 @@
|
|
|
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
|
+
|
|
20
|
+
.container {
|
|
21
|
+
width: 100px;
|
|
22
|
+
height: 100%;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.center-container {
|
|
26
|
+
width: 500px;
|
|
27
|
+
height: 300px;
|
|
28
|
+
}
|
|
29
|
+
</style>
|
|
30
|
+
</head>
|
|
31
|
+
|
|
32
|
+
<body>
|
|
33
|
+
|
|
34
|
+
<div class="container">
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div class="demo">
|
|
38
|
+
<h2>剖切工具演示</h2>
|
|
39
|
+
<button onclick="changPos()">移动位置</button>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<script type="module">
|
|
43
|
+
|
|
44
|
+
import { Viewer, HUDLabelTool } from '../../index.ts'
|
|
45
|
+
|
|
46
|
+
const container = document.getElementsByClassName('container')[0]
|
|
47
|
+
|
|
48
|
+
const viewer = new Viewer(container)
|
|
49
|
+
|
|
50
|
+
await viewer.loadZipAsync('./test.dgz')
|
|
51
|
+
|
|
52
|
+
window.changPos = () => {
|
|
53
|
+
container.classList.add('center-container')
|
|
54
|
+
viewer.resize()
|
|
55
|
+
}
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
</body>
|
|
59
|
+
|
|
60
|
+
</html>
|