bc-model-viewer 1.6.84 → 1.6.86

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,68 @@
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="tool.activate()">激活工具</button>
29
+ <button onclick="tool.deactivate()">停用工具(Esc)</button>
30
+ <button onclick="tool.toggle()">切换工具状态</button>
31
+ <br>
32
+ <button onclick="tool.removeLast()">清除上一次</button>
33
+ <button onclick="tool.clear()">清除所有</button>
34
+ <br>
35
+ <button onclick="console.log(tool.getMeasurements())">打印数据</button>
36
+ </div>
37
+
38
+ <script type="module">
39
+
40
+ import { Viewer, AreaMeasureTool } from '../../index.ts'
41
+
42
+
43
+ const container = document.getElementById('container')
44
+
45
+ // 实例化 Viewer 对象
46
+ const viewer = new Viewer(container, {
47
+ load: {
48
+ cache: {
49
+ enabled: false
50
+ }
51
+ }
52
+ })
53
+
54
+ // 加载测试模型
55
+ await viewer.loadZipAsync('../../assets/dgz/建筑.dgz')
56
+ // await viewer.loadZipAsync('../../assets/new.dgz')
57
+
58
+ const tool = new AreaMeasureTool(viewer)
59
+
60
+ tool.activate(0)
61
+
62
+ window.tool = tool
63
+ window.viewer = viewer
64
+ </script>
65
+
66
+ </body>
67
+
68
+ </html>
@@ -23,7 +23,7 @@
23
23
  <div id="container">
24
24
  </div>
25
25
  <div class="demo">
26
- <h2>测量工具演示</h2>
26
+ <h2>距离测量工具演示</h2>
27
27
  <p>点击标签选中,变红按Delete删除</p>
28
28
  <button onclick="tool.activate()">激活工具</button>
29
29
  <button onclick="tool.deactivate()">停用工具(Esc)</button>
@@ -0,0 +1,68 @@
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="tool.activate()">激活工具</button>
29
+ <button onclick="tool.deactivate()">停用工具(Esc)</button>
30
+ <button onclick="tool.toggle()">切换工具状态</button>
31
+ <br>
32
+ <button onclick="tool.removeLast()">清除上一次</button>
33
+ <button onclick="tool.clear()">清除所有</button>
34
+ <br>
35
+ <button onclick="console.log(tool.getMeasurements())">打印数据</button>
36
+ </div>
37
+
38
+ <script type="module">
39
+
40
+ import { Viewer, FaceDistanceMeasureTool } from '../../index.ts'
41
+
42
+
43
+ const container = document.getElementById('container')
44
+
45
+ // 实例化 Viewer 对象
46
+ const viewer = new Viewer(container, {
47
+ load: {
48
+ cache: {
49
+ enabled: false
50
+ }
51
+ }
52
+ })
53
+
54
+ // 加载测试模型
55
+ await viewer.loadZipAsync('../../assets/dgz/建筑.dgz')
56
+ // await viewer.loadZipAsync('../../assets/new.dgz')
57
+
58
+ const tool = new FaceDistanceMeasureTool(viewer)
59
+
60
+ tool.activate(0)
61
+
62
+ window.tool = tool
63
+ window.viewer = viewer
64
+ </script>
65
+
66
+ </body>
67
+
68
+ </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bc-model-viewer",
3
- "version": "1.6.84",
3
+ "version": "1.6.86",
4
4
  "main": "./dist/bc-model-viewer.min.js",
5
5
  "module": "./dist/bc-model-viewer.min.js",
6
6
  "description": "A model viewer",