gs-bim-air 1.6.1-beta.69 → 1.6.1-beta.70

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/README.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## BIMAir 更新日志
2
2
 
3
+ ### 1.6.1-beta.70
4
+
5
+ - fix: 更新 wasm 修复透明和隔离关系错乱问题
6
+ - feat: 漫游的重力和障碍模式限制最高速度为 8
7
+ - feat: 保证最坏情况下是 50 帧/秒进行重力和障碍检测,防止检测时由于系统帧率过低,物体出现穿透从而检测结果不正确的问题;
8
+ - fix: 修复高程值变化后轴翻转复位问题
9
+ - fix: 修复 cae 剖切后颜色不起效问题
10
+
3
11
  ### 1.6.1-beta.69
4
12
 
5
13
  - feat: 隐藏第三人称漫游功能
@@ -0,0 +1,123 @@
1
+ <head>
2
+ <meta charset="UTF-8">
3
+ <title>动态创建电子围栏操作</title>
4
+ <link rel="stylesheet" href="https://static.graphicstone.com/bimAir/BimAir.css">
5
+ <script src="https://static.graphicstone.com/vue.min.js"></script>
6
+ <script src="https://static.graphicstone.com/bimAir/BimAir.umd.min.js"></script>
7
+ </link>
8
+
9
+ </head>
10
+
11
+ <body>
12
+ <style>
13
+ body {
14
+ margin: 0;
15
+ padding: 0;
16
+ height: 100vh;
17
+ }
18
+
19
+ #app {
20
+ height: 100vh;
21
+ position: relative;
22
+ }
23
+ </style>
24
+ <div id="app">
25
+ <!-- <div id="viewer">
26
+ </div> -->
27
+ <div class="button-group">
28
+ <button onclick="createWallCommandBrgin()">开启创建围栏</button>
29
+ <button onclick="createWallCommandEnd()">结束创建围栏</button>
30
+ <button onclick="saveWall()">保存围栏</button>
31
+ <button onclick="deleteWall()">删除围栏</button>
32
+ <button onclick="isExistWall()">判断是否存在围栏</button>
33
+ <button onclick="isInside()">判断点是否在围栏内</button>
34
+ </div>
35
+ <viewer-wrapper elementId="viewer" style="height: 100%; width: 100%" />
36
+
37
+ </div>
38
+
39
+ <script type="text/javascript">
40
+ new Vue({
41
+ el: '#app',
42
+ });
43
+
44
+ let options = {
45
+ // viewerType: "model",
46
+ elementId: "viewer",
47
+ id: "6253e9d6b0545a0a6e49bf85",
48
+ modelService: "https://static.graphicstone.com/modelApi",
49
+ fileService: "https://static.graphicstone.com/fileApi",
50
+ background: "linear-gradient(#e3fcfc, #f6ffff)",
51
+ }
52
+ let viewer
53
+ let createWallCommand
54
+ BimAir.Loader({ url: "https://static.graphicstone.com/bimAir" }).then(() => {
55
+ viewer = new BimAir.Viewer(options)
56
+ viewer.loadModels(["626b4d1ebfe39e58ae7b66a2"]).then((lightModels) => {
57
+ let lightModel = lightModels[0];
58
+
59
+ BimAir.Command.CommandCreateWall.addWallObject = (path) => {
60
+ let src = "https://static.graphicstone.com/images/wall/wall.png"
61
+ let wallEffectConfig = new BimAir.Animation.WallEffectConfig(viewer, "围栏1", path, 10, src);
62
+ let wallEffect = new BimAir.Animation.WallEffect(wallEffectConfig);
63
+ wallEffect.createWall().then(() => {
64
+ console.log("-----updateDisplay")
65
+ viewer.updateDisplay()
66
+ })
67
+ }
68
+ });
69
+ })
70
+
71
+ function createWallCommandBrgin() {
72
+ // 开始绘制围墙
73
+ viewer.process.commandManager.execute(new BimAir.Command.CommandCreateWall())
74
+ }
75
+
76
+ function createWallCommandEnd() {
77
+ // 结束绘制围墙,恢复默认命令
78
+ viewer.process.commandManager.execute(new BimAir.Command.CommandSelect())
79
+
80
+ }
81
+
82
+ function saveWall() {
83
+ viewer.save();
84
+ }
85
+
86
+ function deleteWall() {
87
+ let wall = viewer.getWallEffect("围栏1")
88
+ if (wall) {
89
+ wall.deleteWall()
90
+ }
91
+ }
92
+
93
+ function isExistWall() {
94
+ let wall = viewer.getWallEffect("围栏1")
95
+ if (wall) {
96
+ wall.hide()
97
+ wall.deleteWall()
98
+
99
+ }
100
+ else {
101
+ console.log("不存在")
102
+ }
103
+ }
104
+
105
+ function isInside() {
106
+ let walls = viewer.getAllWallEffects();
107
+ let point = [25, 25, 0];
108
+ for (let i = 0; i < walls.length; i++) {
109
+ if (walls[i].isInside(point)) {
110
+ //设置颜色
111
+ wallEffect.setColor(255, 0, 0);
112
+ }
113
+ else {
114
+ //取消设置
115
+ wallEffect.unSetColor();
116
+ }
117
+ }
118
+ }
119
+ </script>
120
+
121
+ </body>
122
+
123
+ </html>