@soonspacejs/plugin-cps-soonmanager 2.15.7 → 2.15.8
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/index.esm.js +20 -10
- package/dist/semantic.types.d.ts +6 -21
- package/package.json +9 -9
package/dist/index.esm.js
CHANGED
|
@@ -42693,7 +42693,11 @@ class UpdatePoi {
|
|
|
42693
42693
|
});
|
|
42694
42694
|
}
|
|
42695
42695
|
}
|
|
42696
|
-
const randomColor = () => `hsl(${Math.random() * 360}, 100%, 50%)`;
|
|
42696
|
+
const { warn: warn$1 } = SoonSpace.utils, randomColor = () => `hsl(${Math.random() * 360}, 100%, 50%)`;
|
|
42697
|
+
function getValidPolygonShape(v, e, _) {
|
|
42698
|
+
const A = v?.shape;
|
|
42699
|
+
return !Array.isArray(A) || A.length < 4 || A.length % 2 !== 0 ? (warn$1(`语义对象 ${e}(${_}) 缺少有效 Polygon.shape,已跳过`), null) : A;
|
|
42700
|
+
}
|
|
42697
42701
|
function convertToPlaneIVector2(v) {
|
|
42698
42702
|
const e = [];
|
|
42699
42703
|
for (let _ = 0; _ < v.length; _ += 2)
|
|
@@ -42709,12 +42713,14 @@ function loadSemanticObjects(v, e) {
|
|
|
42709
42713
|
E && (R.Walls?.forEach((T) => {
|
|
42710
42714
|
const q = e.Walls?.[T];
|
|
42711
42715
|
if (!q) return;
|
|
42712
|
-
const P =
|
|
42716
|
+
const P = getValidPolygonShape(q.Polygon, "WALL", q.ID);
|
|
42717
|
+
if (!P) return;
|
|
42718
|
+
const B = v.createCanvas3D({
|
|
42713
42719
|
id: q.ID,
|
|
42714
42720
|
polygons: [
|
|
42715
42721
|
{
|
|
42716
42722
|
id: `${q.ID}/polygon`,
|
|
42717
|
-
points: convertToPlaneIVector2(
|
|
42723
|
+
points: convertToPlaneIVector2(P),
|
|
42718
42724
|
yHeight: q.Elevation,
|
|
42719
42725
|
depth: q.Height,
|
|
42720
42726
|
color: randomColor(),
|
|
@@ -42725,16 +42731,18 @@ function loadSemanticObjects(v, e) {
|
|
|
42725
42731
|
renderType: "WALL"
|
|
42726
42732
|
}
|
|
42727
42733
|
});
|
|
42728
|
-
E.attach(
|
|
42734
|
+
E.attach(B);
|
|
42729
42735
|
}), R.Windows?.forEach((T) => {
|
|
42730
42736
|
const q = e.Windows?.[T];
|
|
42731
42737
|
if (!q) return;
|
|
42732
|
-
const P =
|
|
42738
|
+
const P = getValidPolygonShape(q.Polygon, "WINDOW", q.ID);
|
|
42739
|
+
if (!P) return;
|
|
42740
|
+
const B = v.createCanvas3D({
|
|
42733
42741
|
id: q.ID,
|
|
42734
42742
|
polygons: [
|
|
42735
42743
|
{
|
|
42736
42744
|
id: `${q.ID}/polygon`,
|
|
42737
|
-
points: convertToPlaneIVector2(
|
|
42745
|
+
points: convertToPlaneIVector2(P),
|
|
42738
42746
|
yHeight: q.Elevation,
|
|
42739
42747
|
depth: q.Height,
|
|
42740
42748
|
color: randomColor(),
|
|
@@ -42745,16 +42753,18 @@ function loadSemanticObjects(v, e) {
|
|
|
42745
42753
|
renderType: "WINDOW"
|
|
42746
42754
|
}
|
|
42747
42755
|
});
|
|
42748
|
-
E.attach(
|
|
42756
|
+
E.attach(B);
|
|
42749
42757
|
}), R.Columns?.forEach((T) => {
|
|
42750
42758
|
const q = e.Columns?.[T];
|
|
42751
42759
|
if (!q) return;
|
|
42752
|
-
const P =
|
|
42760
|
+
const P = getValidPolygonShape(q.Polygon, "COLUMN", q.ID);
|
|
42761
|
+
if (!P) return;
|
|
42762
|
+
const B = v.createCanvas3D({
|
|
42753
42763
|
id: q.ID,
|
|
42754
42764
|
polygons: [
|
|
42755
42765
|
{
|
|
42756
42766
|
id: `${q.ID}/polygon`,
|
|
42757
|
-
points: convertToPlaneIVector2(
|
|
42767
|
+
points: convertToPlaneIVector2(P),
|
|
42758
42768
|
yHeight: q.Elevation,
|
|
42759
42769
|
depth: q.Height,
|
|
42760
42770
|
color: randomColor(),
|
|
@@ -42765,7 +42775,7 @@ function loadSemanticObjects(v, e) {
|
|
|
42765
42775
|
renderType: "COLUMN"
|
|
42766
42776
|
}
|
|
42767
42777
|
});
|
|
42768
|
-
E.attach(
|
|
42778
|
+
E.attach(B);
|
|
42769
42779
|
}));
|
|
42770
42780
|
}
|
|
42771
42781
|
});
|
package/dist/semantic.types.d.ts
CHANGED
|
@@ -4,34 +4,28 @@ export interface Building {
|
|
|
4
4
|
Stories: number[];
|
|
5
5
|
}
|
|
6
6
|
export interface Polygon {
|
|
7
|
-
shape
|
|
7
|
+
shape?: number[];
|
|
8
8
|
}
|
|
9
9
|
export interface Door {
|
|
10
10
|
Elevation: number;
|
|
11
11
|
Height: number;
|
|
12
12
|
ID: string;
|
|
13
13
|
Open: boolean;
|
|
14
|
-
Polygon
|
|
14
|
+
Polygon?: Polygon;
|
|
15
15
|
Width: number;
|
|
16
16
|
}
|
|
17
|
-
export interface Polygon {
|
|
18
|
-
shape: number[];
|
|
19
|
-
}
|
|
20
17
|
export interface Column {
|
|
21
18
|
ID: string;
|
|
22
19
|
Elevation: number;
|
|
23
20
|
Height: number;
|
|
24
|
-
Polygon
|
|
25
|
-
}
|
|
26
|
-
export interface Polygon {
|
|
27
|
-
shape: number[];
|
|
21
|
+
Polygon?: Polygon;
|
|
28
22
|
}
|
|
29
23
|
export interface Space {
|
|
30
24
|
CeilingHeight: number;
|
|
31
25
|
GroundHeight: number;
|
|
32
26
|
ID: string;
|
|
33
27
|
Name: string;
|
|
34
|
-
Polygon
|
|
28
|
+
Polygon?: Polygon;
|
|
35
29
|
}
|
|
36
30
|
export interface Staircase {
|
|
37
31
|
Elevation: number;
|
|
@@ -39,9 +33,6 @@ export interface Staircase {
|
|
|
39
33
|
Polyline: number[];
|
|
40
34
|
Spaces: number[];
|
|
41
35
|
}
|
|
42
|
-
export interface Polygon {
|
|
43
|
-
shape: number[];
|
|
44
|
-
}
|
|
45
36
|
export interface Story {
|
|
46
37
|
Columns?: any[];
|
|
47
38
|
Doors?: number[];
|
|
@@ -57,29 +48,23 @@ export interface Story {
|
|
|
57
48
|
Walls?: number[];
|
|
58
49
|
Windows?: number[];
|
|
59
50
|
}
|
|
60
|
-
export interface Polygon {
|
|
61
|
-
shape: number[];
|
|
62
|
-
}
|
|
63
51
|
export interface Wall {
|
|
64
52
|
Doors: any[];
|
|
65
53
|
Elevation: number;
|
|
66
54
|
Height: number;
|
|
67
55
|
ID: string;
|
|
68
|
-
Polygon
|
|
56
|
+
Polygon?: Polygon;
|
|
69
57
|
Spaces: number[];
|
|
70
58
|
SubPolygons?: any;
|
|
71
59
|
VirtualWall: boolean;
|
|
72
60
|
Windows: any[];
|
|
73
61
|
}
|
|
74
|
-
export interface Polygon {
|
|
75
|
-
shape: number[];
|
|
76
|
-
}
|
|
77
62
|
export interface Window {
|
|
78
63
|
Elevation: number;
|
|
79
64
|
Height: number;
|
|
80
65
|
ID: string;
|
|
81
66
|
Open: boolean;
|
|
82
|
-
Polygon
|
|
67
|
+
Polygon?: Polygon;
|
|
83
68
|
Width: number;
|
|
84
69
|
}
|
|
85
70
|
export interface Asset {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soonspacejs/plugin-cps-soonmanager",
|
|
3
3
|
"pluginName": "CpsSoonmanagerPlugin",
|
|
4
|
-
"version": "2.15.
|
|
4
|
+
"version": "2.15.8",
|
|
5
5
|
"description": "Sync cps soonmanager data plugin for SoonSpace.js",
|
|
6
6
|
"main": "dist/index.esm.js",
|
|
7
7
|
"module": "dist/index.esm.js",
|
|
@@ -37,14 +37,14 @@
|
|
|
37
37
|
"socket.io-client": "^4.7.2"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@soonspacejs/plugin-atmosphere": "2.15.
|
|
41
|
-
"@soonspacejs/plugin-effect": "2.15.
|
|
42
|
-
"@soonspacejs/plugin-flow": "2.15.
|
|
43
|
-
"@soonspacejs/plugin-gs3d-loader": "2.15.
|
|
44
|
-
"@soonspacejs/plugin-poi-renderer": "2.15.
|
|
45
|
-
"@soonspacejs/plugin-tiles": "2.15.
|
|
46
|
-
"soonspacejs": "2.15.
|
|
40
|
+
"@soonspacejs/plugin-atmosphere": "2.15.8",
|
|
41
|
+
"@soonspacejs/plugin-effect": "2.15.8",
|
|
42
|
+
"@soonspacejs/plugin-flow": "2.15.8",
|
|
43
|
+
"@soonspacejs/plugin-gs3d-loader": "2.15.8",
|
|
44
|
+
"@soonspacejs/plugin-poi-renderer": "2.15.8",
|
|
45
|
+
"@soonspacejs/plugin-tiles": "2.15.8",
|
|
46
|
+
"soonspacejs": "2.15.8",
|
|
47
47
|
"umanager-animation-parser": "^0.0.6",
|
|
48
|
-
"@soonspacejs/plugin-fds": "2.15.
|
|
48
|
+
"@soonspacejs/plugin-fds": "2.15.8"
|
|
49
49
|
}
|
|
50
50
|
}
|