@realsee/dnalogel 3.44.4 → 3.45.0
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/CHANGELOG.md +6 -0
- package/dist/PanoTagPlugin/controller/TagRender.d.ts +1 -1
- package/dist/PanoTagPlugin/utils/DebugUtil.d.ts +5 -0
- package/dist/Sculpt/Meshes/Area.d.ts +1 -1
- package/dist/Sculpt/Meshes/Box.d.ts +1 -1
- package/dist/Sculpt/Meshes/Circle.d.ts +1 -1
- package/dist/Sculpt/Meshes/CircleWithEdge.d.ts +1 -1
- package/dist/Sculpt/Meshes/Line.d.ts +2 -1
- package/dist/Sculpt/Meshes/LineWithDots.d.ts +1 -1
- package/dist/Sculpt/Meshes/Point.d.ts +1 -1
- package/dist/Sculpt/Meshes/PolygonWithEdge.d.ts +1 -1
- package/dist/Sculpt/Meshes/Prism.d.ts +1 -1
- package/dist/Sculpt/Meshes/RectangleWithEdge.d.ts +3 -4
- package/dist/Sculpt/Objects/Line/Editor.d.ts +22 -0
- package/dist/Sculpt/Objects/Line/index.d.ts +33 -0
- package/dist/Sculpt/Objects/Point/index.d.ts +1 -1
- package/dist/Sculpt/Objects/Polygon/Editor.d.ts +2 -2
- package/dist/Sculpt/Objects/Polygon/index.d.ts +3 -2
- package/dist/Sculpt/Objects/Polyline/Editor.d.ts +3 -17
- package/dist/Sculpt/Objects/Polyline/index.d.ts +7 -6
- package/dist/Sculpt/index.d.ts +5 -0
- package/dist/Sculpt/typings/index.d.ts +11 -6
- package/dist/Sculpt/{utils/color.d.ts → typings/style.d.ts} +7 -0
- package/dist/Sculpt/typings/utils.type.d.ts +2 -0
- package/dist/Sculpt/utils/three/ColoredMesh.d.ts +1 -1
- package/dist/Sculpt/utils/three/rayOnLine.d.ts +3 -5
- package/dist/index.cjs.js +56 -56
- package/dist/index.js +4373 -4242
- package/dist/index.umd.js +45 -45
- package/dist/shared-utils/Utils/WorkUtil.d.ts +6 -6
- package/libs/CruisePlugin/Move.js +1 -1
- package/libs/CruisePlugin/Work.js +1 -1
- package/libs/CruisePlugin/index.js +1 -1
- package/libs/GuideLinePlugin/Controller.js +1 -1
- package/libs/GuideLinePlugin/GuideLineItem.js +1 -1
- package/libs/GuideLinePlugin/GuideLineModeItem.js +1 -1
- package/libs/GuideLinePlugin/index.js +1 -1
- package/libs/ModelMakerPlugin/Controller.js +1 -1
- package/libs/ModelMakerPlugin/index.js +1 -1
- package/libs/PanoMeasurePlugin/Components/Controller0.js +1 -1
- package/libs/PanoMeasurePlugin/Components/Controller1.js +1 -1
- package/libs/PanoMeasurePlugin/Controller/EditController.js +1 -1
- package/libs/PanoMeasurePlugin/Controller/index.js +1 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +1 -1
- package/libs/PanoMeasurePlugin/index.js +1 -1
- package/libs/PanoTagPlugin/controller/TagRender.d.ts +1 -1
- package/libs/PanoTagPlugin/controller/TagRender.js +68 -68
- package/libs/PanoTagPlugin/controller/index.js +38 -44
- package/libs/PanoTagPlugin/index.js +1 -1
- package/libs/PanoTagPlugin/utils/DebugUtil.d.ts +5 -0
- package/libs/PanoTagPlugin/utils/DebugUtil.js +47 -8
- package/libs/Sculpt/Meshes/Area.d.ts +1 -1
- package/libs/Sculpt/Meshes/Box.d.ts +1 -1
- package/libs/Sculpt/Meshes/Box.js +10 -10
- package/libs/Sculpt/Meshes/Circle.d.ts +1 -1
- package/libs/Sculpt/Meshes/Circle.js +1 -1
- package/libs/Sculpt/Meshes/CircleWithEdge.d.ts +1 -1
- package/libs/Sculpt/Meshes/Cylinder.js +1 -1
- package/libs/Sculpt/Meshes/Line.d.ts +2 -1
- package/libs/Sculpt/Meshes/Line.js +55 -47
- package/libs/Sculpt/Meshes/LineWithDots.d.ts +1 -1
- package/libs/Sculpt/Meshes/LineWithDots.js +26 -26
- package/libs/Sculpt/Meshes/Point.d.ts +1 -1
- package/libs/Sculpt/Meshes/Point.js +1 -1
- package/libs/Sculpt/Meshes/Polygon.js +1 -1
- package/libs/Sculpt/Meshes/PolygonWithEdge.d.ts +1 -1
- package/libs/Sculpt/Meshes/Prism.d.ts +1 -1
- package/libs/Sculpt/Meshes/RectangleWithEdge.d.ts +3 -4
- package/libs/Sculpt/Objects/Box/index.js +41 -43
- package/libs/Sculpt/Objects/Cylinder/index.js +35 -37
- package/libs/Sculpt/Objects/Line/Editor.d.ts +22 -0
- package/libs/Sculpt/Objects/Line/Editor.js +61 -0
- package/libs/Sculpt/Objects/Line/index.d.ts +33 -0
- package/libs/Sculpt/Objects/Line/index.js +107 -0
- package/libs/Sculpt/Objects/Point/index.d.ts +1 -1
- package/libs/Sculpt/Objects/Polygon/Editor.d.ts +2 -2
- package/libs/Sculpt/Objects/Polygon/Editor.js +5 -5
- package/libs/Sculpt/Objects/Polygon/index.d.ts +3 -2
- package/libs/Sculpt/Objects/Polygon/index.js +80 -80
- package/libs/Sculpt/Objects/Polyline/Editor.d.ts +3 -17
- package/libs/Sculpt/Objects/Polyline/Editor.js +10 -48
- package/libs/Sculpt/Objects/Polyline/index.d.ts +7 -6
- package/libs/Sculpt/Objects/Polyline/index.js +63 -58
- package/libs/Sculpt/Objects/Prism/index.js +56 -58
- package/libs/Sculpt/index.d.ts +5 -0
- package/libs/Sculpt/index.js +58 -48
- package/libs/Sculpt/typings/index.d.ts +11 -6
- package/libs/Sculpt/{utils/color.d.ts → typings/style.d.ts} +7 -0
- package/libs/Sculpt/typings/utils.type.d.ts +2 -0
- package/libs/Sculpt/utils/three/ColoredMesh.d.ts +1 -1
- package/libs/Sculpt/utils/three/ColoredMesh.js +1 -1
- package/libs/Sculpt/utils/three/rayOnLine.d.ts +3 -5
- package/libs/Sculpt/utils/three/rayOnLine.js +15 -14
- package/libs/base/BasePlugin.js +1 -1
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +3 -2
- package/libs/index.js +129 -127
- package/libs/shared-utils/Object3DHelper/Controller/MoveController.js +1 -1
- package/libs/shared-utils/Object3DHelper/Controller/ScaleController.js +23 -23
- package/libs/shared-utils/Utils/WorkUtil.d.ts +6 -6
- package/libs/shared-utils/Utils/WorkUtil.js +8 -7
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/three/PointSelector/utils/PointSelectorHelper.js +15 -15
- package/package.json +1 -1
- package/dist/Sculpt/typings/SimplifyDeep.d.ts +0 -3
- package/libs/Sculpt/typings/SimplifyDeep.d.ts +0 -3
- /package/libs/Sculpt/{utils/color.js → typings/style.js} +0 -0
package/libs/Sculpt/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { Circle } from './Objects/Circle';
|
|
|
12
12
|
import { Cylinder } from './Objects/Cylinder';
|
|
13
13
|
import { Box } from './Objects/Box';
|
|
14
14
|
import type { BuiltInData, BuiltInItem, Theme } from './typings';
|
|
15
|
+
import { Line } from './Objects/Line';
|
|
15
16
|
export type { SculptData } from './typings';
|
|
16
17
|
interface Data {
|
|
17
18
|
items: Array<BuiltInData>;
|
|
@@ -125,6 +126,10 @@ export declare class Sculpt extends Subscribe<Event> {
|
|
|
125
126
|
* @description: 开始绘制点
|
|
126
127
|
*/
|
|
127
128
|
createPoint(params?: Parameters<Point['create']>[0]): Promise<Point>;
|
|
129
|
+
/**
|
|
130
|
+
* @description: 开始绘制线段
|
|
131
|
+
*/
|
|
132
|
+
createline(params?: Parameters<Line['create']>[0]): Promise<Line>;
|
|
128
133
|
/**
|
|
129
134
|
* @description: 开始绘制空间折线
|
|
130
135
|
*/
|
package/libs/Sculpt/index.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var _ = Object.defineProperty, x = Object.defineProperties;
|
|
2
|
+
var E = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var f = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var d = (
|
|
4
|
+
var L = Object.prototype.hasOwnProperty, O = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var d = (m, i, e) => i in m ? _(m, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : m[i] = e, r = (m, i) => {
|
|
6
6
|
for (var e in i || (i = {}))
|
|
7
|
-
|
|
7
|
+
L.call(i, e) && d(m, e, i[e]);
|
|
8
8
|
if (f)
|
|
9
9
|
for (var e of f(i))
|
|
10
|
-
O.call(i, e) && d(
|
|
11
|
-
return
|
|
12
|
-
}, w = (
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var l = (
|
|
10
|
+
O.call(i, e) && d(m, e, i[e]);
|
|
11
|
+
return m;
|
|
12
|
+
}, w = (m, i) => x(m, E(i));
|
|
13
|
+
var h = (m, i, e) => (d(m, typeof i != "symbol" ? i + "" : i, e), e);
|
|
14
|
+
var c = (m, i, e) => new Promise((t, o) => {
|
|
15
|
+
var l = (u) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
17
|
+
n(e.next(u));
|
|
18
18
|
} catch (y) {
|
|
19
19
|
o(y);
|
|
20
20
|
}
|
|
21
|
-
}, s = (
|
|
21
|
+
}, s = (u) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
23
|
+
n(e.throw(u));
|
|
24
24
|
} catch (y) {
|
|
25
25
|
o(y);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, n = (u) => u.done ? t(u.value) : Promise.resolve(u.value).then(l, s);
|
|
28
|
+
n((e = e.apply(m, i)).next());
|
|
29
29
|
});
|
|
30
30
|
import { globalModules as R } from "./utils/Modules/Global.js";
|
|
31
31
|
import { Subscribe as S } from "../shared-utils/Subscribe.js";
|
|
32
|
-
import { IObject3D as
|
|
32
|
+
import { IObject3D as U } from "../shared-utils/three/IObject3D.js";
|
|
33
33
|
import "three";
|
|
34
34
|
import "hammerjs";
|
|
35
35
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
36
36
|
import "@realsee/five/line";
|
|
37
37
|
import "../shared-utils/three/THREESphere.js";
|
|
38
38
|
import "animejs";
|
|
39
|
-
import { notNil as
|
|
39
|
+
import { notNil as H } from "../shared-utils/isNil.js";
|
|
40
40
|
import "../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
41
|
-
import { recurveFindObject as
|
|
41
|
+
import { recurveFindObject as M } from "../shared-utils/three/recurveFindObject.js";
|
|
42
42
|
import { Polyline as g } from "./Objects/Polyline/index.js";
|
|
43
43
|
import { Point as P } from "./Objects/Point/index.js";
|
|
44
44
|
import { Polygon as I } from "./Objects/Polygon/index.js";
|
|
@@ -47,18 +47,19 @@ import { Rectangle as v } from "./Objects/Rectangle/index.js";
|
|
|
47
47
|
import { Circle as C } from "./Objects/Circle/index.js";
|
|
48
48
|
import { Cylinder as D } from "./Objects/Cylinder/index.js";
|
|
49
49
|
import { Box as j } from "./Objects/Box/index.js";
|
|
50
|
-
import { forReverseEach as
|
|
51
|
-
|
|
50
|
+
import { forReverseEach as k } from "../shared-utils/forReverseEach.js";
|
|
51
|
+
import { Line as B } from "./Objects/Line/index.js";
|
|
52
|
+
const a = class extends S {
|
|
52
53
|
constructor(e, t) {
|
|
53
54
|
super();
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
this.five = e, this.theme = t, this.group = new
|
|
55
|
+
h(this, "group");
|
|
56
|
+
h(this, "five");
|
|
57
|
+
h(this, "theme");
|
|
58
|
+
this.five = e, this.theme = t, this.group = new U(), this.group.name = "Sculpt", e.scene.add(this.group), a.modules.init(e), a.modules.fiveDomEvents.addEventListener(this.group, "click", ({ intersects: o }) => {
|
|
58
59
|
var s;
|
|
59
|
-
const l =
|
|
60
|
+
const l = M((s = o == null ? void 0 : o[0]) == null ? void 0 : s.object, (n) => n.isSculptObject);
|
|
60
61
|
return l ? this.emit("click", l) : !1;
|
|
61
|
-
}), window.__SCLUPT_DEBUG__ = this, window.__SCLUPT_MODULES_DEBUG__ =
|
|
62
|
+
}), window.__SCLUPT_DEBUG__ = this, window.__SCLUPT_MODULES_DEBUG__ = a.modules;
|
|
62
63
|
}
|
|
63
64
|
get data() {
|
|
64
65
|
return {
|
|
@@ -68,7 +69,7 @@ const p = class extends S {
|
|
|
68
69
|
} catch (t) {
|
|
69
70
|
return console.error(t), null;
|
|
70
71
|
}
|
|
71
|
-
}).filter(
|
|
72
|
+
}).filter(H)
|
|
72
73
|
};
|
|
73
74
|
}
|
|
74
75
|
get items() {
|
|
@@ -81,11 +82,11 @@ const p = class extends S {
|
|
|
81
82
|
var l;
|
|
82
83
|
this.clear();
|
|
83
84
|
const o = (l = e == null ? void 0 : e.items) == null ? void 0 : l.map((s) => {
|
|
84
|
-
var
|
|
85
|
-
const
|
|
86
|
-
style: r(r({}, (
|
|
85
|
+
var u;
|
|
86
|
+
const n = w(r({}, s), {
|
|
87
|
+
style: r(r({}, (u = this.theme) == null ? void 0 : u[s.type.toLowerCase()]), s.style)
|
|
87
88
|
});
|
|
88
|
-
return s.type === "Point" ? new P(
|
|
89
|
+
return s.type === "Point" ? new P(n, t) : s.type === "line" ? new B(n, t) : s.type === "Polyline" ? new g(n, t) : s.type === "Polygon" ? new I(n, t) : s.type === "Prism" ? new b(n, t) : s.type === "Rectangle" ? new v(n, t) : s.type === "Circle" ? new C(n, t) : s.type === "Cylinder" ? new D(n, t) : s.type === "Box" ? new j(n, t) : null;
|
|
89
90
|
});
|
|
90
91
|
this.group.add(...o), this.five.needsRender = !0;
|
|
91
92
|
}
|
|
@@ -101,23 +102,32 @@ const p = class extends S {
|
|
|
101
102
|
putObject(e) {
|
|
102
103
|
var l;
|
|
103
104
|
this.group.add(e);
|
|
104
|
-
const t =
|
|
105
|
+
const t = a.modules.object3DHelper, o = t.addObject3DHelper(e);
|
|
105
106
|
return (l = o == null ? void 0 : o.moveController) == null || l.moveByMouse(), t;
|
|
106
107
|
}
|
|
107
108
|
/**
|
|
108
109
|
* @description: 开始绘制点
|
|
109
110
|
*/
|
|
110
111
|
createPoint(e) {
|
|
111
|
-
return
|
|
112
|
+
return c(this, null, function* () {
|
|
112
113
|
var t;
|
|
113
114
|
return this.createItem(P, r(r({}, (t = this.theme) == null ? void 0 : t.point), e));
|
|
114
115
|
});
|
|
115
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* @description: 开始绘制线段
|
|
119
|
+
*/
|
|
120
|
+
createline(e) {
|
|
121
|
+
return c(this, null, function* () {
|
|
122
|
+
var t;
|
|
123
|
+
return this.createItem(B, r(r({}, (t = this.theme) == null ? void 0 : t.line), e));
|
|
124
|
+
});
|
|
125
|
+
}
|
|
116
126
|
/**
|
|
117
127
|
* @description: 开始绘制空间折线
|
|
118
128
|
*/
|
|
119
129
|
createPolyline(e) {
|
|
120
|
-
return
|
|
130
|
+
return c(this, null, function* () {
|
|
121
131
|
var t;
|
|
122
132
|
return this.createItem(g, r(r({}, (t = this.theme) == null ? void 0 : t.polyline), e));
|
|
123
133
|
});
|
|
@@ -126,7 +136,7 @@ const p = class extends S {
|
|
|
126
136
|
* @description: 开始绘制平面多边形
|
|
127
137
|
*/
|
|
128
138
|
createPolygon(e) {
|
|
129
|
-
return
|
|
139
|
+
return c(this, null, function* () {
|
|
130
140
|
var t;
|
|
131
141
|
return this.createItem(I, r(r({}, (t = this.theme) == null ? void 0 : t.polygon), e));
|
|
132
142
|
});
|
|
@@ -135,7 +145,7 @@ const p = class extends S {
|
|
|
135
145
|
* @description: 开始绘制多棱柱
|
|
136
146
|
*/
|
|
137
147
|
createPrism(e) {
|
|
138
|
-
return
|
|
148
|
+
return c(this, null, function* () {
|
|
139
149
|
var t;
|
|
140
150
|
return this.createItem(b, r(r({}, (t = this.theme) == null ? void 0 : t.prism), e));
|
|
141
151
|
});
|
|
@@ -144,7 +154,7 @@ const p = class extends S {
|
|
|
144
154
|
* @description: 开始绘制矩形
|
|
145
155
|
*/
|
|
146
156
|
createRectangle(e) {
|
|
147
|
-
return
|
|
157
|
+
return c(this, null, function* () {
|
|
148
158
|
var t;
|
|
149
159
|
return this.createItem(v, r(r({}, (t = this.theme) == null ? void 0 : t.rectangle), e));
|
|
150
160
|
});
|
|
@@ -153,7 +163,7 @@ const p = class extends S {
|
|
|
153
163
|
* @description: 开始绘制圆形
|
|
154
164
|
*/
|
|
155
165
|
createCircle(e) {
|
|
156
|
-
return
|
|
166
|
+
return c(this, null, function* () {
|
|
157
167
|
var t;
|
|
158
168
|
return this.createItem(C, r(r({}, (t = this.theme) == null ? void 0 : t.circle), e));
|
|
159
169
|
});
|
|
@@ -162,7 +172,7 @@ const p = class extends S {
|
|
|
162
172
|
* @description: 开始绘制圆柱
|
|
163
173
|
*/
|
|
164
174
|
createCylinder(e) {
|
|
165
|
-
return
|
|
175
|
+
return c(this, null, function* () {
|
|
166
176
|
var t;
|
|
167
177
|
return this.createItem(D, r(r({}, (t = this.theme) == null ? void 0 : t.cylinder), e));
|
|
168
178
|
});
|
|
@@ -171,7 +181,7 @@ const p = class extends S {
|
|
|
171
181
|
* @description: 开始绘制 Box
|
|
172
182
|
*/
|
|
173
183
|
createBox(e) {
|
|
174
|
-
return
|
|
184
|
+
return c(this, null, function* () {
|
|
175
185
|
var t;
|
|
176
186
|
return this.createItem(j, r(r({}, (t = this.theme) == null ? void 0 : t.box), e));
|
|
177
187
|
});
|
|
@@ -190,10 +200,10 @@ const p = class extends S {
|
|
|
190
200
|
* @description: 清空数据
|
|
191
201
|
*/
|
|
192
202
|
clear() {
|
|
193
|
-
|
|
203
|
+
k(this.items, (e) => e.delete()), this.five.needsRender = !0;
|
|
194
204
|
}
|
|
195
205
|
createItem(e, ...t) {
|
|
196
|
-
return
|
|
206
|
+
return c(this, null, function* () {
|
|
197
207
|
const o = new e();
|
|
198
208
|
return this.group.add(o), yield o.create(...t).catch((l) => {
|
|
199
209
|
console.error(l), this.group.remove(o);
|
|
@@ -201,10 +211,10 @@ const p = class extends S {
|
|
|
201
211
|
});
|
|
202
212
|
}
|
|
203
213
|
};
|
|
204
|
-
let
|
|
205
|
-
|
|
206
|
-
const
|
|
214
|
+
let p = a;
|
|
215
|
+
h(p, "modules", R);
|
|
216
|
+
const me = (m) => new p(m);
|
|
207
217
|
export {
|
|
208
|
-
|
|
209
|
-
|
|
218
|
+
p as Sculpt,
|
|
219
|
+
me as SculptPlugin
|
|
210
220
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { SimplifyDeep } from './SimplifyDeep';
|
|
2
1
|
import type { PartialDeep } from 'type-fest';
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import type { SimplifyDeep } from './utils.type';
|
|
3
|
+
export type { SimplifyDeep };
|
|
5
4
|
import type { Point, PointImportData } from '../Objects/Point';
|
|
5
|
+
import type { Line, LineImportData } from '../Objects/Line';
|
|
6
|
+
import type { Polyline, PolylineImportData } from '../Objects/Polyline';
|
|
6
7
|
import type { Polygon, PolygonImportData } from '../Objects/Polygon';
|
|
7
8
|
import type { Prism, PrismImportData } from '../Objects/Prism';
|
|
8
9
|
import type { Rectangle, RectangleImportData } from '../Objects/Rectangle';
|
|
@@ -10,6 +11,7 @@ import type { Circle, CircleImportData } from '../Objects/Circle';
|
|
|
10
11
|
import type { Cylinder, CylinderImportData } from '../Objects/Cylinder';
|
|
11
12
|
import type { Box, BoxImportData } from '../Objects/Box';
|
|
12
13
|
import type { PointStyle } from '../Meshes/Point';
|
|
14
|
+
import type { LineMeshStyle } from '../Meshes/Line';
|
|
13
15
|
import type { PolylineStyle } from '../Meshes/Polyline';
|
|
14
16
|
import type { PrismStyle } from '../Meshes/Prism';
|
|
15
17
|
import type { RectangleWithEdgeMeshStyle as RectangleStyle } from '../Meshes/RectangleWithEdge';
|
|
@@ -27,8 +29,9 @@ export declare namespace SculptData {
|
|
|
27
29
|
type CylinderData = SimplifyDeep<CylinderImportData>;
|
|
28
30
|
type BoxData = SimplifyDeep<BoxImportData>;
|
|
29
31
|
}
|
|
30
|
-
export type { Polyline, PolylineImportData };
|
|
31
32
|
export type { Point, PointImportData };
|
|
33
|
+
export type { Line, LineImportData };
|
|
34
|
+
export type { Polyline, PolylineImportData };
|
|
32
35
|
export type { Polygon, PolygonImportData };
|
|
33
36
|
export type { Prism, PrismImportData };
|
|
34
37
|
export type { Rectangle, RectangleImportData };
|
|
@@ -36,6 +39,7 @@ export type { Circle, CircleImportData };
|
|
|
36
39
|
export type { Cylinder, CylinderImportData };
|
|
37
40
|
export type { Box, BoxImportData };
|
|
38
41
|
export type { PointStyle };
|
|
42
|
+
export type { LineMeshStyle };
|
|
39
43
|
export type { PolylineStyle };
|
|
40
44
|
export type { PrismStyle };
|
|
41
45
|
export type { RectangleStyle };
|
|
@@ -43,10 +47,11 @@ export type { CircleStyle };
|
|
|
43
47
|
export type { CylinderStyle };
|
|
44
48
|
export type { BoxStyle };
|
|
45
49
|
export type { AreaStyle };
|
|
46
|
-
export type BuiltInData = PolylineImportData | PointImportData | PolygonImportData | PrismImportData | RectangleImportData | CircleImportData | CylinderImportData | BoxImportData;
|
|
47
|
-
export type BuiltInItem = Polyline | Point | Polygon | Prism | Rectangle | Circle | Cylinder | Box;
|
|
50
|
+
export type BuiltInData = PolylineImportData | PointImportData | PolygonImportData | PrismImportData | RectangleImportData | CircleImportData | CylinderImportData | BoxImportData | LineImportData;
|
|
51
|
+
export type BuiltInItem = Polyline | Point | Polygon | Prism | Rectangle | Circle | Cylinder | Box | Line;
|
|
48
52
|
export type Theme = PartialDeep<{
|
|
49
53
|
point: PointStyle;
|
|
54
|
+
line: LineMeshStyle;
|
|
50
55
|
polyline: PolylineStyle;
|
|
51
56
|
polygon: AreaStyle;
|
|
52
57
|
prism: PrismStyle;
|
|
@@ -31,6 +31,13 @@ export type LineWidthStyle = {
|
|
|
31
31
|
*/
|
|
32
32
|
lineWidth?: number;
|
|
33
33
|
};
|
|
34
|
+
export type LimitPlaneConfig = {
|
|
35
|
+
/**
|
|
36
|
+
* @description 限制折线绘制的平面; `xoz` 限制在水平面; `y` 限制垂直面; `none` 不限制
|
|
37
|
+
* @default `none`
|
|
38
|
+
*/
|
|
39
|
+
limit: 'xoz' | 'y' | 'none';
|
|
40
|
+
};
|
|
34
41
|
export type OcclusionStyle = {
|
|
35
42
|
/**
|
|
36
43
|
* @description 是否以一种半透明的方式显示遮挡的部分
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type * as THREE from 'three';
|
|
2
2
|
import type { Merge, UnknownArray } from 'type-fest';
|
|
3
|
+
import type { ConditionalSimplifyDeep } from 'type-fest/source/conditional-simplify';
|
|
3
4
|
import type { IsNull, NonRecursiveType } from 'type-fest/source/internal';
|
|
5
|
+
export type SimplifyDeep<T> = ConditionalSimplifyDeep<T, THREE.Color | THREE.Vector3 | Function | Iterable<unknown>, object>;
|
|
4
6
|
export type ImportDataToExportData<T> = Merge<JsonData<T>, {
|
|
5
7
|
id: string | number;
|
|
6
8
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
-
import { type ColorStyle, type OpacityStyle, type OcclusionStyle } from '
|
|
2
|
+
import { type ColorStyle, type OpacityStyle, type OcclusionStyle } from '../../typings/style';
|
|
3
3
|
import { IObject3D } from '../../../shared-utils/three/IObject3D';
|
|
4
4
|
export type ColoredMeshStyle = OpacityStyle & ColorStyle & OcclusionStyle;
|
|
5
5
|
export default class ColoredMesh<TGeometry extends THREE.Geometry | THREE.BufferGeometry = THREE.Geometry | THREE.BufferGeometry> extends IObject3D {
|
|
@@ -11,7 +11,7 @@ var d = (i, t, e) => t in i ? g(i, t, { enumerable: !0, configurable: !0, writab
|
|
|
11
11
|
};
|
|
12
12
|
var c = (i, t, e) => (d(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
13
13
|
import * as s from "three";
|
|
14
|
-
import { DEFAULT_COLOR as M } from "
|
|
14
|
+
import { DEFAULT_COLOR as M } from "../../typings/style.js";
|
|
15
15
|
import { IObject3D as B } from "../../../shared-utils/three/IObject3D.js";
|
|
16
16
|
import "hammerjs";
|
|
17
17
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
2
|
/**
|
|
3
3
|
* @description: 求射线与线段的交点(交点在线段上)
|
|
4
|
-
* @param {THREE.
|
|
5
|
-
* @param {THREE.
|
|
6
|
-
* @param {
|
|
7
|
-
* @param {boolean} clampToLine 是否限制交点在线段上,默认为true,不限制则可以相交在线段的延长线上
|
|
4
|
+
* @param {THREE.Raycaster} params.ray 射线
|
|
5
|
+
* @param {THREE.Line3} params.line 线段
|
|
6
|
+
* @param {boolean} params.clampToLine `true` 限制交点在线段上, `false` 可以相交在线段的延长线上;默认为`true`
|
|
8
7
|
*/
|
|
9
8
|
export declare function rayOnLine(params: {
|
|
10
|
-
cameraPosition: THREE.Vector3;
|
|
11
9
|
raycaster: THREE.Raycaster;
|
|
12
10
|
line: THREE.Line3;
|
|
13
11
|
clampToLine?: boolean;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import * as t from "three";
|
|
2
|
+
const y = new t.Vector3();
|
|
3
|
+
function O(p) {
|
|
4
|
+
var d;
|
|
5
|
+
const { raycaster: e, line: n, clampToLine: m = !0 } = p;
|
|
6
|
+
if (((d = e.camera) == null ? void 0 : d.type) === "OrthographicCamera") {
|
|
7
|
+
const o = e.ray.origin.clone();
|
|
8
|
+
return n.closestPointToPoint(o, !1, new t.Vector3());
|
|
8
9
|
}
|
|
9
|
-
const
|
|
10
|
-
if (
|
|
11
|
-
const
|
|
12
|
-
return n.start.sub(
|
|
10
|
+
const a = new t.Plane().setFromNormalAndCoplanarPoint(e.ray.direction.clone().normalize(), e.ray.origin), r = a.projectPoint(n.start, new t.Vector3()), s = a.projectPoint(n.end, new t.Vector3()), l = new t.Line3(r, s), c = l.closestPointToPoint(e.ray.origin, m, y), P = c.distanceTo(s), T = c.distanceTo(r), i = l.distance();
|
|
11
|
+
if (P > T && P > i) {
|
|
12
|
+
const o = -c.distanceTo(r) / i, u = n.start.clone().sub(n.end).normalize();
|
|
13
|
+
return n.start.sub(u.clone().multiplyScalar(o * n.distance()));
|
|
13
14
|
} else {
|
|
14
|
-
const
|
|
15
|
-
return new
|
|
15
|
+
const o = c.distanceTo(r) / i;
|
|
16
|
+
return new t.Vector3().lerpVectors(n.start, n.end, o);
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
19
|
export {
|
|
19
|
-
|
|
20
|
+
O as rayOnLine
|
|
20
21
|
};
|
package/libs/base/BasePlugin.js
CHANGED
|
@@ -282,10 +282,11 @@ class Jt extends O {
|
|
|
282
282
|
});
|
|
283
283
|
/** 模型楼层高亮改变时,自动进行楼层切换 */
|
|
284
284
|
o(this, "onModelShownFloorChange", (t) => {
|
|
285
|
+
var e;
|
|
285
286
|
if (this.floorIndex !== t) {
|
|
286
287
|
if (t === null) {
|
|
287
|
-
const
|
|
288
|
-
this.floorIndex = this.five.work.observers[
|
|
288
|
+
const i = this.five.getCurrentState().panoIndex;
|
|
289
|
+
this.floorIndex = (e = this.five.work) == null ? void 0 : e.observers[i].floorIndex;
|
|
289
290
|
return;
|
|
290
291
|
}
|
|
291
292
|
this.floorIndex = t, this.updateSize(), this.render();
|