@realsee/dnalogel 4.0.0-webgpu.3 → 4.0.0-webgpu.4
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/floorplan.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +270 -35
- package/dist/index.js.map +1 -0
- package/dist/internal/{BasePlugin-CT5K8m36.js → BasePlugin-DC5m72La.js} +3 -3
- package/dist/internal/{BasePlugin-CT5K8m36.js.map → BasePlugin-DC5m72La.js.map} +1 -1
- package/dist/internal/BasePluginWithData-D_0W46_q.js +7 -0
- package/dist/internal/{BasePluginWithData-9z4tpAT4.js.map → BasePluginWithData-D_0W46_q.js.map} +1 -1
- package/dist/internal/{BetterTween-BX0aTvP1.js → BetterTween-DmptqE8m.js} +2 -2
- package/dist/internal/{BetterTween-BX0aTvP1.js.map → BetterTween-DmptqE8m.js.map} +1 -1
- package/dist/internal/{CSS3DRenderPlugin-ccSpcvwd.js → CSS3DRenderPlugin-CEatgl0m.js} +3 -3
- package/dist/internal/CSS3DRenderPlugin-CEatgl0m.js.map +1 -0
- package/dist/internal/{Controller-Csut_kcH.js → Controller-D6o4OGWJ.js} +8 -8
- package/dist/internal/{Controller-Csut_kcH.js.map → Controller-D6o4OGWJ.js.map} +1 -1
- package/dist/internal/{FiveDomEvents-3H9NvDOz.js → FiveDomEvents-BUBLFzti.js} +2 -2
- package/dist/internal/{FiveDomEvents-3H9NvDOz.js.map → FiveDomEvents-BUBLFzti.js.map} +1 -1
- package/dist/internal/FivePuppet-C6QmVY70.js +67 -0
- package/dist/internal/FivePuppet-C6QmVY70.js.map +1 -0
- package/dist/internal/{PointHelper-D565h9b_.js → PointHelper-DIhgdjY2.js} +48 -48
- package/dist/internal/{PointHelper-D565h9b_.js.map → PointHelper-DIhgdjY2.js.map} +1 -1
- package/dist/internal/{Polygon-CBGvYUfJ.js → Polygon-D3xIL1Pl.js} +30 -30
- package/dist/internal/{Polygon-CBGvYUfJ.js.map → Polygon-D3xIL1Pl.js.map} +1 -1
- package/dist/internal/{Prism-Dm5ESkgg.js → Prism-CJlyAEAU.js} +13 -13
- package/dist/internal/{Prism-Dm5ESkgg.js.map → Prism-CJlyAEAU.js.map} +1 -1
- package/dist/internal/{Rectangle-D-zkDycu.js → Rectangle-BpL9lNKU.js} +118 -129
- package/dist/internal/Rectangle-BpL9lNKU.js.map +1 -0
- package/dist/internal/{Work-DF8j5GnL.js → Work-BE4AgdwH.js} +9 -9
- package/dist/internal/{Work-DF8j5GnL.js.map → Work-BE4AgdwH.js.map} +1 -1
- package/dist/internal/{animationFrame-XGKHIeQK.js → animationFrame-CacKXN8l.js} +14 -3
- package/dist/internal/animationFrame-CacKXN8l.js.map +1 -0
- package/dist/internal/{area-maker-Bd9l2pIp.js → area-maker-Bnhx4SkH.js} +4 -4
- package/dist/internal/{area-maker-Bd9l2pIp.js.map → area-maker-Bnhx4SkH.js.map} +1 -1
- package/dist/internal/{boundingBox-DvCor5Hd.js → boundingBox-CIqXgNXW.js} +2 -2
- package/dist/internal/{boundingBox-DvCor5Hd.js.map → boundingBox-CIqXgNXW.js.map} +1 -1
- package/dist/internal/{camera-movement-CwI7UqUk.js → camera-movement-C1pwfMk_.js} +2 -2
- package/dist/internal/camera-movement-C1pwfMk_.js.map +1 -0
- package/dist/internal/{changeMode-BVGYCoqu.js → changeMode-D_I2AOjH.js} +2 -2
- package/dist/internal/{changeMode-BVGYCoqu.js.map → changeMode-D_I2AOjH.js.map} +1 -1
- package/dist/internal/{controller-BWkZT0l1.js → controller-DIDtFrBE.js} +1991 -2050
- package/dist/internal/controller-DIDtFrBE.js.map +1 -0
- package/dist/internal/{cruise-C3F0eNQ-.js → cruise-B50Tcq66.js} +2 -2
- package/dist/internal/{cruise-C3F0eNQ-.js.map → cruise-B50Tcq66.js.map} +1 -1
- package/dist/internal/{current-pano-image-DKUWluR-.js → current-pano-image-BCFr6njt.js} +4 -4
- package/dist/internal/{current-pano-image-DKUWluR-.js.map → current-pano-image-BCFr6njt.js.map} +1 -1
- package/dist/internal/{defaultUrls-CjKkS9k9.js → defaultUrls-CfMtGzqM.js} +14 -3
- package/dist/internal/defaultUrls-CfMtGzqM.js.map +1 -0
- package/dist/internal/{fire-scene-CczaBz2_.js → fire-scene-BzZGvyh_.js} +9 -4
- package/dist/internal/fire-scene-BzZGvyh_.js.map +1 -0
- package/dist/internal/{fiveModelLoad-mg-TnpnM.js → fiveModelLoad-BUIBYxzp.js} +2 -2
- package/dist/internal/{fiveModelLoad-mg-TnpnM.js.map → fiveModelLoad-BUIBYxzp.js.map} +1 -1
- package/dist/internal/{floorplan-KWlIsTvO.js → floorplan-C8BGw87S.js} +5 -5
- package/dist/internal/{floorplan-KWlIsTvO.js.map → floorplan-C8BGw87S.js.map} +1 -1
- package/dist/internal/{generatePolygonGeometry-B_5JFq8y.js → generatePolygonGeometry-BOnzdCaG.js} +181 -178
- package/dist/internal/generatePolygonGeometry-BOnzdCaG.js.map +1 -0
- package/dist/internal/{lookObject-wesf8xt6.js → lookObject-DuRab5wf.js} +2 -2
- package/dist/internal/{lookObject-wesf8xt6.js.map → lookObject-DuRab5wf.js.map} +1 -1
- package/dist/internal/{measure-BX6boAC7.js → measure-B4jFwdQ6.js} +5 -5
- package/dist/internal/{measure-BX6boAC7.js.map → measure-B4jFwdQ6.js.map} +1 -1
- package/dist/internal/{model-chassis-compass-InVNmOAQ.js → model-chassis-compass-C6NTVMLo.js} +2 -2
- package/dist/internal/{model-chassis-compass-InVNmOAQ.js.map → model-chassis-compass-C6NTVMLo.js.map} +1 -1
- package/dist/internal/{model-entry-door-guide-wZbyY77a.js → model-entry-door-guide-DnGTLY2s.js} +2 -2
- package/dist/internal/{model-entry-door-guide-wZbyY77a.js.map → model-entry-door-guide-DnGTLY2s.js.map} +1 -1
- package/dist/internal/{model-maker-uO8xlTuO.js → model-maker-B1mnDdKY.js} +15 -15
- package/dist/internal/{model-maker-uO8xlTuO.js.map → model-maker-B1mnDdKY.js.map} +1 -1
- package/dist/internal/{model-tv-video-DzXb2JRf.js → model-tv-video-BP-7HoDC.js} +2 -2
- package/dist/internal/{model-tv-video-DzXb2JRf.js.map → model-tv-video-BP-7HoDC.js.map} +1 -1
- package/dist/internal/{model-view-CBeeMM98.js → model-view-BWUU0-uq.js} +2 -2
- package/dist/internal/{model-view-CBeeMM98.js.map → model-view-BWUU0-uq.js.map} +1 -1
- package/dist/internal/object3d-helper-CbRRhnLV.js +7 -0
- package/dist/internal/{object3d-helper-DDYsVPN6.js.map → object3d-helper-CbRRhnLV.js.map} +1 -1
- package/dist/internal/{pano-compass-jSr629BP.js → pano-compass-BRTM0dCc.js} +7 -7
- package/dist/internal/{pano-compass-jSr629BP.js.map → pano-compass-BRTM0dCc.js.map} +1 -1
- package/dist/internal/{pano-door-label-DKoYIKLa.js → pano-door-label-BLjYGZrr.js} +3 -3
- package/dist/internal/{pano-door-label-DKoYIKLa.js.map → pano-door-label-BLjYGZrr.js.map} +1 -1
- package/dist/internal/{pano-measure-DW9mdx1O.js → pano-measure-BIgCWkVJ.js} +14 -14
- package/dist/internal/{pano-measure-DW9mdx1O.js.map → pano-measure-BIgCWkVJ.js.map} +1 -1
- package/dist/internal/{pano-ruler-pro-D7q0Ob21.js → pano-ruler-pro-D9yTbHJz.js} +2 -2
- package/dist/internal/{pano-ruler-pro-D7q0Ob21.js.map → pano-ruler-pro-D9yTbHJz.js.map} +1 -1
- package/dist/internal/{pano-spatial-tag-D0qn-__S.js → pano-spatial-tag-B7Gxn3BS.js} +3 -3
- package/dist/internal/{pano-spatial-tag-D0qn-__S.js.map → pano-spatial-tag-B7Gxn3BS.js.map} +1 -1
- package/dist/internal/{pano-tag-BW5MXXws.js → pano-tag-Bchz-jED.js} +2 -2
- package/dist/internal/{pano-tag-BW5MXXws.js.map → pano-tag-Bchz-jED.js.map} +1 -1
- package/dist/internal/{pano-video-Bmud_CAn.js → pano-video-BufYQMqo.js} +3 -3
- package/dist/internal/{pano-video-Bmud_CAn.js.map → pano-video-BufYQMqo.js.map} +1 -1
- package/dist/internal/{pipeline-DDqgb1gw.js → pipeline-t_3IMXKB.js} +4 -4
- package/dist/internal/{pipeline-DDqgb1gw.js.map → pipeline-t_3IMXKB.js.map} +1 -1
- package/dist/internal/{sculpt-BNkLJR6p.js → sculpt-BCK4PMwL.js} +64 -63
- package/dist/internal/{sculpt-BNkLJR6p.js.map → sculpt-BCK4PMwL.js.map} +1 -1
- package/dist/internal/tagPosition-DA9YguT8.js +176 -0
- package/dist/internal/tagPosition-DA9YguT8.js.map +1 -0
- package/dist/internal/withResolvers-DVr4bnnk.js +15 -0
- package/dist/internal/withResolvers-DVr4bnnk.js.map +1 -0
- package/dist/plugins/area-maker.js +1 -1
- package/dist/plugins/camera-movement.js +1 -1
- package/dist/plugins/cruise.js +2 -2
- package/dist/plugins/css3d-render.js +1 -1
- package/dist/plugins/current-pano-image.js +1 -1
- package/dist/plugins/digital-performance.d.ts +1 -1
- package/dist/plugins/digital-performance.js +1 -1
- package/dist/plugins/fire-scene.d.ts +1 -1
- package/dist/plugins/fire-scene.js +1 -1
- package/dist/plugins/guide-line.js +1 -1
- package/dist/plugins/measure.js +1 -1
- package/dist/plugins/model-chassis-compass.js +1 -1
- package/dist/plugins/model-entry-door-guide.js +1 -1
- package/dist/plugins/model-maker.d.ts +1 -1
- package/dist/plugins/model-maker.js +1 -1
- package/dist/plugins/model-tv-video.js +1 -1
- package/dist/plugins/model-view.js +1 -1
- package/dist/plugins/object3d-helper.d.ts +1 -1
- package/dist/plugins/object3d-helper.js +3 -1
- package/dist/plugins/pano-compass.js +1 -1
- package/dist/plugins/pano-door-label.js +1 -1
- package/dist/plugins/pano-measure.js +1 -1
- package/dist/plugins/pano-ruler-pro.js +1 -1
- package/dist/plugins/pano-spatial-tag.js +1 -1
- package/dist/plugins/pano-tag.d.ts +1 -1
- package/dist/plugins/pano-tag.js +4 -1
- package/dist/plugins/pano-video.js +1 -1
- package/dist/plugins/pipeline.js +1 -1
- package/dist/plugins/sculpt.d.ts +1 -1
- package/dist/plugins/sculpt.js +7 -1
- package/dist/types/public/index.d.ts +2 -0
- package/dist/types/public/plugins/digital-performance.d.ts +1 -0
- package/dist/types/public/plugins/fire-scene.d.ts +1 -0
- package/dist/types/public/plugins/model-maker.d.ts +1 -0
- package/dist/types/public/plugins/object3d-helper.d.ts +1 -0
- package/dist/types/public/plugins/pano-tag.d.ts +2 -0
- package/dist/types/public/plugins/sculpt.d.ts +8 -0
- package/dist/types/public/utils.d.ts +5 -0
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +16 -50
- package/package.json +1 -1
- package/dist/internal/BasePluginWithData-9z4tpAT4.js +0 -7
- package/dist/internal/CSS3DRenderPlugin-ccSpcvwd.js.map +0 -1
- package/dist/internal/Rectangle-D-zkDycu.js.map +0 -1
- package/dist/internal/animationFrame-XGKHIeQK.js.map +0 -1
- package/dist/internal/blink-DD_0mH-m.js +0 -113
- package/dist/internal/blink-DD_0mH-m.js.map +0 -1
- package/dist/internal/camera-movement-CwI7UqUk.js.map +0 -1
- package/dist/internal/controller-BWkZT0l1.js.map +0 -1
- package/dist/internal/defaultUrls-CjKkS9k9.js.map +0 -1
- package/dist/internal/fire-scene-CczaBz2_.js.map +0 -1
- package/dist/internal/generatePolygonGeometry-B_5JFq8y.js.map +0 -1
- package/dist/internal/object3d-helper-DDYsVPN6.js +0 -7
- package/dist/utils.js.map +0 -1
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { t as e } from "./Subscribe-DLlAl88n.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { i as t, r as n } from "./PointHelper-DIhgdjY2.js";
|
|
3
|
+
import { C as r, _ as i, c as a, m as o, p as s } from "./generatePolygonGeometry-BOnzdCaG.js";
|
|
4
4
|
import { i as c, n as l } from "./util-vGeVT4oo.js";
|
|
5
5
|
import { n as u, t as d } from "./getNormal-BatLuzsS.js";
|
|
6
6
|
import { n as f } from "./isNil-CQNA0Sbe.js";
|
|
7
|
-
import { t as p } from "./FiveDomEvents-
|
|
7
|
+
import { t as p } from "./FiveDomEvents-BUBLFzti.js";
|
|
8
8
|
import { t as m } from "./rayOnLine-CrCXTByv.js";
|
|
9
9
|
import { t as h } from "./Cursor-3AwKvViZ.js";
|
|
10
|
-
import { t as g } from "./Controller-
|
|
11
|
-
import {
|
|
12
|
-
import { i as
|
|
13
|
-
import
|
|
10
|
+
import { t as g } from "./Controller-D6o4OGWJ.js";
|
|
11
|
+
import { t as _ } from "./withResolvers-DVr4bnnk.js";
|
|
12
|
+
import { i as v, t as y } from "./Polygon-D3xIL1Pl.js";
|
|
13
|
+
import { i as b, n as x, r as S, t as C } from "./Prism-CJlyAEAU.js";
|
|
14
|
+
import * as w from "three/webgpu";
|
|
14
15
|
//#region src/Sculpt/utils/Modules/Global.ts
|
|
15
|
-
var
|
|
16
|
+
var T = class {
|
|
16
17
|
five;
|
|
17
18
|
config;
|
|
18
19
|
constructor(e, t) {
|
|
@@ -27,13 +28,13 @@ var w = class {
|
|
|
27
28
|
}
|
|
28
29
|
get pointSelector() {
|
|
29
30
|
if (this._pointSelector) return this._pointSelector;
|
|
30
|
-
let e = this.config?.magnifier,
|
|
31
|
-
return this.config?.hideCursorCircle && (
|
|
32
|
-
...
|
|
31
|
+
let e = this.config?.magnifier, t = e === null || e === !1 ? { magnifier: null } : { magnifierParams: e };
|
|
32
|
+
return this.config?.hideCursorCircle && (t = {
|
|
33
|
+
...t,
|
|
33
34
|
pointHelper: null
|
|
34
|
-
}), this._pointSelector = new
|
|
35
|
+
}), this._pointSelector = new n(this.five, {
|
|
35
36
|
mode: "cursor",
|
|
36
|
-
helper:
|
|
37
|
+
helper: t,
|
|
37
38
|
hitFilter: this.config?.hitFilter
|
|
38
39
|
}), this._pointSelector;
|
|
39
40
|
}
|
|
@@ -46,38 +47,26 @@ var w = class {
|
|
|
46
47
|
dispose() {
|
|
47
48
|
this._pointSelector?.dispose(), this._fiveDomEvents?.dispose(), this._object3DHelper?.dispose(), this._cursor?.removeDeleteButton(), this._cursor?.reset();
|
|
48
49
|
}
|
|
49
|
-
},
|
|
50
|
-
function
|
|
51
|
-
|
|
50
|
+
}, E = /* @__PURE__ */ new WeakMap();
|
|
51
|
+
function D(e, t) {
|
|
52
|
+
E.set(e, t), r(e, t.five);
|
|
52
53
|
}
|
|
53
|
-
function
|
|
54
|
-
let t =
|
|
54
|
+
function O(e) {
|
|
55
|
+
let t = E.get(e);
|
|
55
56
|
if (t) return t;
|
|
56
|
-
if (e.parent) return
|
|
57
|
+
if (e.parent) return O(e.parent);
|
|
57
58
|
throw Error("Sculpt object has no owning instance");
|
|
58
59
|
}
|
|
59
60
|
//#endregion
|
|
60
|
-
//#region src/shared-utils/promise/withResolvers.ts
|
|
61
|
-
function O() {
|
|
62
|
-
let e, t;
|
|
63
|
-
return {
|
|
64
|
-
promise: new Promise((n, r) => {
|
|
65
|
-
e = n, t = r;
|
|
66
|
-
}),
|
|
67
|
-
resolve: e,
|
|
68
|
-
reject: t
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
//#endregion
|
|
72
61
|
//#region src/Sculpt/utils/removeAllTag.ts
|
|
73
62
|
function k(e) {
|
|
74
63
|
A(e), e.traverse((e) => A(e));
|
|
75
64
|
}
|
|
76
65
|
function A(e) {
|
|
77
66
|
let t = e;
|
|
78
|
-
Array.isArray(t.doms) && t.doms[0] instanceof
|
|
67
|
+
Array.isArray(t.doms) && t.doms[0] instanceof i && t.doms.forEach((e) => e.destroy());
|
|
79
68
|
let n = e;
|
|
80
|
-
n.dom && n.dom instanceof
|
|
69
|
+
n.dom && n.dom instanceof i && n.dom.destroy(), e.areaDom instanceof i && e.areaDom.destroy();
|
|
81
70
|
}
|
|
82
71
|
//#endregion
|
|
83
72
|
//#region src/Sculpt/Objects/Base/index.ts
|
|
@@ -101,7 +90,7 @@ var j = /* @__PURE__ */ new WeakMap(), M = class e extends u {
|
|
|
101
90
|
return this.modules.pointSelector;
|
|
102
91
|
}
|
|
103
92
|
constructor(t, n, r) {
|
|
104
|
-
super(), this.modules = t,
|
|
93
|
+
super(), this.modules = t, D(this, t), n?.id && (this.uuid = n.id), this.config = {
|
|
105
94
|
defaultAction: !0,
|
|
106
95
|
occlusionVisibility: !0,
|
|
107
96
|
occlusionMode: "translucence",
|
|
@@ -172,7 +161,7 @@ var j = /* @__PURE__ */ new WeakMap(), M = class e extends u {
|
|
|
172
161
|
}
|
|
173
162
|
applyObjectMatrixWorld = (e, t) => {
|
|
174
163
|
let n = t ?? this;
|
|
175
|
-
return n.updateMatrixWorld(),
|
|
164
|
+
return n.updateMatrixWorld(), s(n, e);
|
|
176
165
|
};
|
|
177
166
|
applyObjectReversalMatrixWorld = (e, t) => {
|
|
178
167
|
let n = t ?? this;
|
|
@@ -181,7 +170,7 @@ var j = /* @__PURE__ */ new WeakMap(), M = class e extends u {
|
|
|
181
170
|
}, N = class extends u {
|
|
182
171
|
hooks = new e();
|
|
183
172
|
get modules() {
|
|
184
|
-
return
|
|
173
|
+
return O(this.originObject);
|
|
185
174
|
}
|
|
186
175
|
originObject;
|
|
187
176
|
constructor(e) {
|
|
@@ -368,11 +357,11 @@ var j = /* @__PURE__ */ new WeakMap(), M = class e extends u {
|
|
|
368
357
|
}
|
|
369
358
|
}));
|
|
370
359
|
}
|
|
371
|
-
}, I = class extends
|
|
360
|
+
}, I = class extends w.BufferGeometry {
|
|
372
361
|
name = "RectangleGeometry";
|
|
373
362
|
points;
|
|
374
363
|
constructor(e) {
|
|
375
|
-
super(), e.length === 4 ? (this.points = e.slice(0, 4), this.setAttribute("position", new
|
|
364
|
+
super(), e.length === 4 ? (this.points = e.slice(0, 4), this.setAttribute("position", new w.BufferAttribute(new Float32Array(this.points.flatMap((e) => e.toArray())), 3)), this.setIndex(new w.BufferAttribute(new Uint16Array([
|
|
376
365
|
0,
|
|
377
366
|
1,
|
|
378
367
|
2,
|
|
@@ -381,7 +370,7 @@ var j = /* @__PURE__ */ new WeakMap(), M = class e extends u {
|
|
|
381
370
|
3
|
|
382
371
|
]), 1))) : console.error("Invalid number of points, it's not a rectangle");
|
|
383
372
|
}
|
|
384
|
-
}, L = class extends
|
|
373
|
+
}, L = class extends y {
|
|
385
374
|
name = "RectangleMesh";
|
|
386
375
|
get color() {
|
|
387
376
|
return this.meshFont.material.color;
|
|
@@ -414,7 +403,7 @@ var j = /* @__PURE__ */ new WeakMap(), M = class e extends u {
|
|
|
414
403
|
get lineColor() {
|
|
415
404
|
return this.line.lineColor;
|
|
416
405
|
}
|
|
417
|
-
line = new
|
|
406
|
+
line = new S();
|
|
418
407
|
constructor(e) {
|
|
419
408
|
let { points: t, ...n } = e ?? {};
|
|
420
409
|
super(), t && this.setPoints(t), n && this.setStyle(n);
|
|
@@ -449,7 +438,7 @@ function z(e, t) {
|
|
|
449
438
|
var B = class extends N {
|
|
450
439
|
draggingPoints = [];
|
|
451
440
|
get pointMeshes() {
|
|
452
|
-
return this.children.filter((e) => e instanceof
|
|
441
|
+
return this.children.filter((e) => e instanceof v);
|
|
453
442
|
}
|
|
454
443
|
get pointHandles() {
|
|
455
444
|
return this.children;
|
|
@@ -459,7 +448,7 @@ var B = class extends N {
|
|
|
459
448
|
}
|
|
460
449
|
enable() {
|
|
461
450
|
super.enable(), this.points.filter(f).forEach((e) => {
|
|
462
|
-
let t = new
|
|
451
|
+
let t = new v();
|
|
463
452
|
t.visible = !1, t.position.copy(e), t.draggable = !0, this.modules.fiveDomEvents.addEventListener(t, "drag", this.onDrag), this.modules.fiveDomEvents.addEventListener(t, "dragstart", this.onDragstart), this.modules.fiveDomEvents.addEventListener(t, "dragend", this.onDragend), this.add(t);
|
|
464
453
|
});
|
|
465
454
|
}
|
|
@@ -482,8 +471,8 @@ var B = class extends N {
|
|
|
482
471
|
}
|
|
483
472
|
onDrag = (e) => {
|
|
484
473
|
if (!this.draggingPoints || this.draggingPoints.length === 0) return;
|
|
485
|
-
let
|
|
486
|
-
this.draggingPoints.forEach((e) => e.position.copy(
|
|
474
|
+
let n = t(this.modules.five, e.raycaster);
|
|
475
|
+
this.draggingPoints.forEach((e) => e.position.copy(n.point)), this.originObject.lineMesh.setPoints(this.pointMeshes.map((e) => e.position));
|
|
487
476
|
};
|
|
488
477
|
};
|
|
489
478
|
//#endregion
|
|
@@ -501,7 +490,7 @@ function V(e) {
|
|
|
501
490
|
}
|
|
502
491
|
//#endregion
|
|
503
492
|
//#region src/Sculpt/Meshes/Area.ts
|
|
504
|
-
var H = class extends
|
|
493
|
+
var H = class extends x {
|
|
505
494
|
name = "AreaMesh";
|
|
506
495
|
}, U = class extends B {
|
|
507
496
|
get points() {
|
|
@@ -533,9 +522,9 @@ var H = class extends b {
|
|
|
533
522
|
};
|
|
534
523
|
onDrag = (e) => {
|
|
535
524
|
if (!this.draggingPoints || this.draggingPoints.length === 0) return;
|
|
536
|
-
let
|
|
537
|
-
if (!
|
|
538
|
-
let r = this.originObject.areaMesh.projectPoint(
|
|
525
|
+
let n = t(this.modules.five, e.raycaster);
|
|
526
|
+
if (!n) return;
|
|
527
|
+
let r = this.originObject.areaMesh.projectPoint(n.point);
|
|
539
528
|
this.draggingPoints.forEach((e) => e.position.copy(r)), this.originObject.areaMesh.setPoints(this.pointMeshes.map((e) => e.position)), this.hooks.emit("objectUpdate"), this.modules.five && (this.modules.five.needsRender = !0);
|
|
540
529
|
let i = this.originObject.areaMesh?.userData?.syncCreationPointMeshes;
|
|
541
530
|
typeof i == "function" && i();
|
|
@@ -561,7 +550,7 @@ var H = class extends b {
|
|
|
561
550
|
});
|
|
562
551
|
}
|
|
563
552
|
createPointMesh(e) {
|
|
564
|
-
let { dragSelectPixelDistance: t, pointColor: n, pointOpacity: r } = e, i = new
|
|
553
|
+
let { dragSelectPixelDistance: t, pointColor: n, pointOpacity: r } = e, i = new v();
|
|
565
554
|
return i.visible = !0, i.userData = i.userData ?? {}, i.userData.dragSelectPixelDistance = t, i.draggable = !0, i.setStyle({
|
|
566
555
|
color: n,
|
|
567
556
|
opacity: r
|
|
@@ -746,7 +735,7 @@ var re = class extends M {
|
|
|
746
735
|
}
|
|
747
736
|
};
|
|
748
737
|
function Z(e, t, n) {
|
|
749
|
-
let { promise: r, resolve: i, reject: a } =
|
|
738
|
+
let { promise: r, resolve: i, reject: a } = _(), o = e.parent;
|
|
750
739
|
if (!o) {
|
|
751
740
|
a(/* @__PURE__ */ Error("No container"));
|
|
752
741
|
return;
|
|
@@ -755,15 +744,15 @@ function Z(e, t, n) {
|
|
|
755
744
|
e.userData = e.userData ?? {}, e.userData.dragSelectPixelDistance = u;
|
|
756
745
|
let d = 0;
|
|
757
746
|
c && l && l.model && l.model.bounding && typeof l.model.bounding.max?.y == "number" && (d = l.model.bounding.max.y + 1);
|
|
758
|
-
let f = new
|
|
747
|
+
let f = new S(e.style);
|
|
759
748
|
o?.add(f);
|
|
760
|
-
let p = new
|
|
749
|
+
let p = new S({
|
|
761
750
|
...e.style,
|
|
762
751
|
dashed: !0,
|
|
763
752
|
lengthEnable: !1
|
|
764
753
|
});
|
|
765
754
|
o?.add(p);
|
|
766
|
-
let m = [], h = (e =
|
|
755
|
+
let m = [], h = (e = b) => {
|
|
767
756
|
m.forEach((t, n) => {
|
|
768
757
|
let r = e[n];
|
|
769
758
|
r && t.position.copy(r);
|
|
@@ -772,8 +761,8 @@ function Z(e, t, n) {
|
|
|
772
761
|
function g() {
|
|
773
762
|
m.forEach((e) => e.parent?.remove(e));
|
|
774
763
|
let t = e.line?.style ?? e.style;
|
|
775
|
-
m =
|
|
776
|
-
let r = new
|
|
764
|
+
m = b.map((e, n) => {
|
|
765
|
+
let r = new v({
|
|
777
766
|
...t,
|
|
778
767
|
color: t.pointColor ?? t.lineColor,
|
|
779
768
|
tip: void 0,
|
|
@@ -782,36 +771,36 @@ function Z(e, t, n) {
|
|
|
782
771
|
return r.name = `PolygonPointMesh_${n}`, r.userData = r.userData ?? {}, r.userData.dragSelectPixelDistance = u, o?.add(r), r;
|
|
783
772
|
}), h();
|
|
784
773
|
}
|
|
785
|
-
function
|
|
774
|
+
function y() {
|
|
786
775
|
m.forEach((e) => e.parent?.remove(e)), m = [], e.userData && (delete e.userData.creationPointMeshes, delete e.userData.syncCreationPointMeshes, delete e.userData.disposeCreationPointMeshes);
|
|
787
776
|
}
|
|
788
777
|
t.enable(), c && t.setAdherePoints([]);
|
|
789
|
-
let
|
|
790
|
-
|
|
778
|
+
let b = [], x, C, T = !1, E, D = [], O = () => b.length > 0, k = () => D.length > 0, A = () => {
|
|
779
|
+
O() && (D.push(b.pop()), N(E), g(), n?.onUndo?.(), t.pointSelectorHelper && t.pointSelectorHelper.magnifier && t.pointSelectorHelper.magnifier.render());
|
|
791
780
|
}, j = () => {
|
|
792
|
-
k() && (
|
|
781
|
+
k() && (b.push(D.pop()), N(E), g(), n?.onRedo?.(), t.pointSelectorHelper && t.pointSelectorHelper.magnifier && t.pointSelectorHelper.magnifier.render());
|
|
793
782
|
}, M = (t) => {
|
|
794
|
-
|
|
795
|
-
let r =
|
|
796
|
-
if (c && (r = r.clone().setY(d)), n.__onWillAddPoint(r,
|
|
797
|
-
if (
|
|
798
|
-
let t =
|
|
799
|
-
e.setPoints(
|
|
800
|
-
} else g(), n?.onPointPlaced?.(
|
|
783
|
+
D.length = 0;
|
|
784
|
+
let r = b.length === 0 ? t.point : x.clone();
|
|
785
|
+
if (c && (r = r.clone().setY(d)), n.__onWillAddPoint(r, b), n?.experimental_max_point_count == null || b.length !== n.experimental_max_point_count) {
|
|
786
|
+
if (b.push(r), e.setPoints(b, { closed: !1 }), n?.experimental_self_intersect_check && K(b)) {
|
|
787
|
+
let t = b.pop();
|
|
788
|
+
e.setPoints(b, { closed: !1 }), g(), console.warn("[Polygon] 检测到自相交,无法添加该点"), n?.__onSelfIntersect?.(t);
|
|
789
|
+
} else g(), n?.onPointPlaced?.(b), T && (P(), i());
|
|
801
790
|
}
|
|
802
791
|
}, N = (r) => {
|
|
803
792
|
let i = () => {
|
|
804
|
-
f.setPoints([]), p.setPoints([]), e.setPoints(
|
|
793
|
+
f.setPoints([]), p.setPoints([]), e.setPoints(b), t.pointSelectorHelper && t.pointSelectorHelper.magnifier && t.pointSelectorHelper.magnifier.render();
|
|
805
794
|
};
|
|
806
795
|
if (!r) {
|
|
807
796
|
i(), g();
|
|
808
797
|
return;
|
|
809
798
|
}
|
|
810
|
-
if (
|
|
811
|
-
let a =
|
|
812
|
-
if (
|
|
813
|
-
|
|
814
|
-
let i =
|
|
799
|
+
if (E = r, !b?.length) return i();
|
|
800
|
+
let a = b.at(-1).clone();
|
|
801
|
+
if (b.length < 3 && (c ? (x = r.point.clone().setY(d), f.setPoints([a, x]), p.setPoints([])) : s === "none" ? (x = r.point, f.setPoints([a, x]), p.setPoints([])) : s === "xoz" ? (C ??= new w.Plane().setFromNormalAndCoplanarPoint(new w.Vector3(0, 1, 0), b[0]), t.plane = C, x = C.projectPoint(r.point, new w.Vector3()), f.setPoints([a, x]), p.setPoints([x, r.point])) : s === "y" && (b.length === 1 ? (x = r.point, f.setPoints([a, x]), p.setPoints([])) : (C ??= new w.Plane().setFromCoplanarPoints(b[0], b[1], new w.Vector3(0, 1, 0).add(b[0])), t.plane = C, x = C.projectPoint(r.point, new w.Vector3()), f.setPoints([a, x]), p.setPoints([x, r.point])))), b.length >= 3) {
|
|
802
|
+
x = c ? r.point.clone().setY(d) : e.projectPoint(r.point);
|
|
803
|
+
let i = b[0], o = !1;
|
|
815
804
|
if (typeof n?.autoClosePixelDistance == "number") {
|
|
816
805
|
if (l && l.camera && l.getElement) {
|
|
817
806
|
let e = l.getElement(), t = e.clientWidth, a = e.clientHeight, s = (e) => {
|
|
@@ -820,21 +809,21 @@ function Z(e, t, n) {
|
|
|
820
809
|
x: (n.x * .5 + .5) * t,
|
|
821
810
|
y: (1 - (n.y * .5 + .5)) * a
|
|
822
811
|
};
|
|
823
|
-
}, c = s(i), u = s(
|
|
812
|
+
}, c = s(i), u = s(x), d = s(r.point), f = Math.sqrt((c.x - u.x) ** 2 + (c.y - u.y) ** 2), p = Math.sqrt((c.x - d.x) ** 2 + (c.y - d.y) ** 2);
|
|
824
813
|
(f < n.autoClosePixelDistance || p < n.autoClosePixelDistance) && (o = !0);
|
|
825
814
|
}
|
|
826
|
-
} else (i.distanceTo(
|
|
827
|
-
o ? (
|
|
815
|
+
} else (i.distanceTo(x) < .2 || i.distanceTo(r.point) < .2) && (o = !0);
|
|
816
|
+
o ? (x = i, r.point.copy(i), t.pointSelectorHelper.updateWithIntersect(r, { emitEvent: !1 }), T = !0) : T = !1, f.setPoints([a, x]), p.setPoints([x, r.point]);
|
|
828
817
|
}
|
|
829
|
-
|
|
818
|
+
b.length >= 2 ? (e.setPoints([...b, x], { closed: !1 }), e.line.setPoints(e.points.slice(0, -1)), n?.experimental_self_intersect_check && K([...b, x]) ? (t.cursorError = !0, f.setStyle({ lineColor: 16734553 }), p.setStyle({ lineColor: 16734553 })) : (t.cursorError = !1, f.setStyle({ lineColor: e.lineColor }), p.setStyle({ lineColor: e.lineColor }))) : e.setPoints([]), g();
|
|
830
819
|
}, P = () => {
|
|
831
|
-
t.off("select", M), t.off("intersectionUpdate", N), t.off("disable", F), t.plane = null, t.disable(), o?.remove(f, p),
|
|
820
|
+
t.off("select", M), t.off("intersectionUpdate", N), t.off("disable", F), t.plane = null, t.disable(), o?.remove(f, p), y();
|
|
832
821
|
}, F = () => {
|
|
833
|
-
P(), o?.remove(e, p, f),
|
|
822
|
+
P(), o?.remove(e, p, f), y(), a(/* @__PURE__ */ Error("Cancelled"));
|
|
834
823
|
};
|
|
835
824
|
return t.on("select", M), t.on("intersectionUpdate", N), t.on("disable", F), {
|
|
836
825
|
finished: r,
|
|
837
|
-
canUndo:
|
|
826
|
+
canUndo: O,
|
|
838
827
|
canRedo: k,
|
|
839
828
|
undo: A,
|
|
840
829
|
redo: j
|
|
@@ -846,12 +835,12 @@ var ie = class extends P {
|
|
|
846
835
|
constructor(e) {
|
|
847
836
|
super(e, () => ({
|
|
848
837
|
positionFrom: () => e.worldCenter,
|
|
849
|
-
yAxis: () => new
|
|
850
|
-
zAxis: () => new
|
|
838
|
+
yAxis: () => new w.Vector3().subVectors(e.topPosition, e.bottomPositions[0]).normalize(),
|
|
839
|
+
zAxis: () => new w.Vector3().subVectors(e.bottomPositions[0], e.bottomPositions[1]).normalize(),
|
|
851
840
|
scaleHelper: {
|
|
852
841
|
enable: !0,
|
|
853
842
|
positions: () => {
|
|
854
|
-
let t = e.bottomPositions, n = e.topPosition, r = new
|
|
843
|
+
let t = e.bottomPositions, n = e.topPosition, r = new w.Vector3().subVectors(n, t[0]), i = new w.Vector3().subVectors(t[1], t[0]), a = new w.Vector3().subVectors(t[2], t[1]), o = e.geometryInfo.center, s = o.clone().sub(r.clone().divideScalar(2)), c = o.clone().add(r.clone().divideScalar(2)), l = o.clone().sub(i.clone().divideScalar(2)), u = o.clone().add(i.clone().divideScalar(2)), d = o.clone().sub(a.clone().divideScalar(2)), f = o.clone().add(a.clone().divideScalar(2));
|
|
855
844
|
return [
|
|
856
845
|
{
|
|
857
846
|
id: "top",
|
|
@@ -886,7 +875,7 @@ var ie = class extends P {
|
|
|
886
875
|
];
|
|
887
876
|
},
|
|
888
877
|
scaleCallback: (t) => {
|
|
889
|
-
let { intersectPoint: n, scalePosition: r } = t, { id: i, basePosition: a } = r, o = e.bottomPositions, s = e.topPositions, c = new
|
|
878
|
+
let { intersectPoint: n, scalePosition: r } = t, { id: i, basePosition: a } = r, o = e.bottomPositions, s = e.topPositions, c = new w.Vector3().subVectors(e.topPosition, o[0]), l;
|
|
890
879
|
if (i === "top") c = n.clone().sub(a), l = o;
|
|
891
880
|
else if (i === "bottom") {
|
|
892
881
|
let e = n.clone().sub(a);
|
|
@@ -932,7 +921,7 @@ var ie = class extends P {
|
|
|
932
921
|
}
|
|
933
922
|
}));
|
|
934
923
|
}
|
|
935
|
-
}, Q = class extends
|
|
924
|
+
}, Q = class extends C {
|
|
936
925
|
name = "BoxMesh";
|
|
937
926
|
get geometryInfo() {
|
|
938
927
|
if (this.geometryInfoNeedUpdate) {
|
|
@@ -993,7 +982,7 @@ var ie = class extends P {
|
|
|
993
982
|
let e = this.applyObjectMatrixWorld(this.boxMesh.bottomPositions, this.boxMesh), t = this.applyObjectMatrixWorld(this.boxMesh.topPositions, this.boxMesh);
|
|
994
983
|
if (!e || !t || e.length !== 4 || t.length !== 4) return [];
|
|
995
984
|
let n = [], r = (e, t) => {
|
|
996
|
-
let r = new
|
|
985
|
+
let r = new w.Triangle(t[0], t[1], t[2]).getNormal(new w.Vector3()), i = l(...t);
|
|
997
986
|
n.push({
|
|
998
987
|
name: e,
|
|
999
988
|
vertices: t,
|
|
@@ -1026,36 +1015,36 @@ var ie = class extends P {
|
|
|
1026
1015
|
};
|
|
1027
1016
|
async function oe(e, t, n) {
|
|
1028
1017
|
return new Promise(async (r, i) => {
|
|
1029
|
-
let
|
|
1030
|
-
if (!
|
|
1018
|
+
let o = e.parent;
|
|
1019
|
+
if (!o) {
|
|
1031
1020
|
i(/* @__PURE__ */ Error("No container"));
|
|
1032
1021
|
return;
|
|
1033
1022
|
}
|
|
1034
|
-
let
|
|
1035
|
-
|
|
1023
|
+
let s = new R(e.style);
|
|
1024
|
+
o.add(s), await $(s, t, {
|
|
1036
1025
|
...n,
|
|
1037
1026
|
onPointPlaced: () => {
|
|
1038
1027
|
n?.onPointPlaced?.();
|
|
1039
1028
|
}
|
|
1040
|
-
}),
|
|
1041
|
-
let c = new
|
|
1042
|
-
c.setPoints([p, h]),
|
|
1029
|
+
}), o.remove(s), e.setPoints({ points: s.points });
|
|
1030
|
+
let c = new a(), u = d(e.bottomPositions), f = l(...e.bottomPositions), p = f.clone().add(u.clone().multiplyScalar(100)), h = f.clone().sub(u.clone().multiplyScalar(100));
|
|
1031
|
+
c.setPoints([p, h]), o.add(c), t.enable();
|
|
1043
1032
|
let g = (e) => {
|
|
1044
1033
|
n?.onPointPlaced?.(), v(), r();
|
|
1045
1034
|
}, _ = (t) => {
|
|
1046
1035
|
if (!t?.raycaster) return;
|
|
1047
1036
|
let n = m({
|
|
1048
1037
|
raycaster: t.raycaster,
|
|
1049
|
-
line: new
|
|
1038
|
+
line: new w.Line3(p, h)
|
|
1050
1039
|
});
|
|
1051
1040
|
if (n) {
|
|
1052
1041
|
let t = n.clone().sub(f);
|
|
1053
1042
|
e.setPoints({ heightPoint: e.bottomPositions[0].clone().add(t) });
|
|
1054
1043
|
}
|
|
1055
1044
|
}, v = () => {
|
|
1056
|
-
t.off("select", g), t.off("intersectionUpdate", _), t.off("disable", y), t.disable(),
|
|
1045
|
+
t.off("select", g), t.off("intersectionUpdate", _), t.off("disable", y), t.disable(), o?.remove(c);
|
|
1057
1046
|
}, y = () => {
|
|
1058
|
-
v(),
|
|
1047
|
+
v(), o?.remove(e), i(/* @__PURE__ */ Error("Cancelled"));
|
|
1059
1048
|
};
|
|
1060
1049
|
t.on("select", g), t.on("intersectionUpdate", _), t.on("disable", y);
|
|
1061
1050
|
});
|
|
@@ -1108,7 +1097,7 @@ function $(e, t, n) {
|
|
|
1108
1097
|
function ce(e, t) {
|
|
1109
1098
|
let n = [];
|
|
1110
1099
|
return e.scene.traverse((e) => {
|
|
1111
|
-
if (e.visible && !t?.excludes?.includes(e) && (e instanceof L || e instanceof
|
|
1100
|
+
if (e.visible && !t?.excludes?.includes(e) && (e instanceof L || e instanceof y)) {
|
|
1112
1101
|
let t = e.points.map((t) => {
|
|
1113
1102
|
let n = t.clone();
|
|
1114
1103
|
return n.normal = e.normal.clone(), e.style.occlusionVisibility && (n.IsAlwaysVisible = !0), n;
|
|
@@ -1118,46 +1107,46 @@ function ce(e, t) {
|
|
|
1118
1107
|
}), n;
|
|
1119
1108
|
}
|
|
1120
1109
|
function le(e, t, n) {
|
|
1121
|
-
let { promise: r, reject: i, resolve: a } =
|
|
1110
|
+
let { promise: r, reject: i, resolve: a } = _(), o = e.parent;
|
|
1122
1111
|
if (!o) return i(/* @__PURE__ */ Error("No container"));
|
|
1123
|
-
let s = n?.limit ?? "none", c = new
|
|
1112
|
+
let s = n?.limit ?? "none", c = new b({
|
|
1124
1113
|
...e.style,
|
|
1125
1114
|
dashed: !0
|
|
1126
|
-
}), l = new
|
|
1115
|
+
}), l = new b({
|
|
1127
1116
|
...e.style,
|
|
1128
1117
|
dashed: !0,
|
|
1129
1118
|
lengthEnable: !1
|
|
1130
|
-
}), u = new
|
|
1119
|
+
}), u = new b({
|
|
1131
1120
|
...e.style,
|
|
1132
1121
|
dashed: !1,
|
|
1133
1122
|
lengthEnable: !1
|
|
1134
1123
|
});
|
|
1135
1124
|
o.add(c, u, l), t.enable();
|
|
1136
|
-
let d = [], f = new
|
|
1137
|
-
d.push(f.clone()), n?.onPointPlaced?.(), d.length === 1 ? (s === "xoz" && m.setFromNormalAndCoplanarPoint(new
|
|
1125
|
+
let d = [], f = new w.Vector3(), p = new w.Vector3(), m = new w.Plane(), h = () => {
|
|
1126
|
+
d.push(f.clone()), n?.onPointPlaced?.(), d.length === 1 ? (s === "xoz" && m.setFromNormalAndCoplanarPoint(new w.Vector3(0, 1, 0), d[0]), s === "none" && m.setFromNormalAndCoplanarPoint(p, d[0])) : d.length === 2 ? s === "y" || s === "xoz" ? (v(), a()) : u.setPoints([d[0], d[1]]) : d.length === 3 && (v(), a());
|
|
1138
1127
|
}, g = (n) => {
|
|
1139
1128
|
if (!n?.raycaster) return;
|
|
1140
1129
|
let r = d.at(-1)?.clone();
|
|
1141
1130
|
if (d.length === 0) f = n.point.clone(), p = n.face?.normal;
|
|
1142
1131
|
else if (d.length === 1 && s === "y") {
|
|
1143
|
-
let t = new
|
|
1132
|
+
let t = new w.Line3(new w.Vector3(0, 1, 0).add(d[0]), new w.Vector3(0, -1, 0).add(d[0])).closestPointToPoint(n.point, !1, new w.Vector3());
|
|
1144
1133
|
e.setPoints([
|
|
1145
1134
|
d[0],
|
|
1146
1135
|
t,
|
|
1147
1136
|
n.point
|
|
1148
1137
|
]);
|
|
1149
1138
|
} else if (d.length === 1 && s === "xoz") {
|
|
1150
|
-
let t = new
|
|
1139
|
+
let t = new w.Line3(new w.Vector3(1, 0, 0).add(d[0]), new w.Vector3(-1, 0, 0).add(d[0])), r = n.raycaster.ray.intersectPlane(m, new w.Vector3()), i = t.closestPointToPoint(r, !1, new w.Vector3());
|
|
1151
1140
|
e.setPoints([
|
|
1152
1141
|
d[0],
|
|
1153
1142
|
i,
|
|
1154
1143
|
r
|
|
1155
1144
|
]);
|
|
1156
|
-
} else if (d.length === 1 && s === "none") m ? (f = n.raycaster.ray.intersectPlane(m, new
|
|
1145
|
+
} else if (d.length === 1 && s === "none") m ? (f = n.raycaster.ray.intersectPlane(m, new w.Vector3()), l.setPoints([f, n.point])) : f = n.point.clone(), c.setPoints([r, f]);
|
|
1157
1146
|
else if (d.length === 2 && s === "none") {
|
|
1158
1147
|
o.remove(c);
|
|
1159
|
-
let r = n.raycaster.ray.intersectPlane(m, new
|
|
1160
|
-
f = new
|
|
1148
|
+
let r = n.raycaster.ray.intersectPlane(m, new w.Vector3()), i = d[0].distanceTo(d[1]) / 2, a = new w.Vector3().lerpVectors(d[0], d[1], .5), s = new w.Vector3().subVectors(r, a).normalize();
|
|
1149
|
+
f = new w.Vector3().addVectors(a, s.multiplyScalar(i));
|
|
1161
1150
|
let l = z([
|
|
1162
1151
|
d[0],
|
|
1163
1152
|
f,
|
|
@@ -1165,37 +1154,37 @@ function le(e, t, n) {
|
|
|
1165
1154
|
], t.five.camera.position);
|
|
1166
1155
|
e.setPoints(l);
|
|
1167
1156
|
}
|
|
1168
|
-
}, _ = () => {
|
|
1169
|
-
t.off("select", h), t.off("intersectionUpdate", g), t.off("disable", v), t.disable(), o?.remove(c, u, l);
|
|
1170
1157
|
}, v = () => {
|
|
1171
|
-
|
|
1158
|
+
t.off("select", h), t.off("intersectionUpdate", g), t.off("disable", y), t.disable(), o?.remove(c, u, l);
|
|
1159
|
+
}, y = () => {
|
|
1160
|
+
v(), o?.remove(e), i(/* @__PURE__ */ Error("Cancelled"));
|
|
1172
1161
|
};
|
|
1173
|
-
return t.on("select", h), t.on("intersectionUpdate", g), t.on("disable",
|
|
1162
|
+
return t.on("select", h), t.on("intersectionUpdate", g), t.on("disable", y), r;
|
|
1174
1163
|
}
|
|
1175
1164
|
function ue(e, t, n) {
|
|
1176
|
-
let { promise: r, reject: i, resolve: a } =
|
|
1165
|
+
let { promise: r, reject: i, resolve: a } = _(), o = e.parent;
|
|
1177
1166
|
if (!o) return i(/* @__PURE__ */ Error("No container"));
|
|
1178
|
-
let s = n?.limit ?? "none", c = new
|
|
1167
|
+
let s = n?.limit ?? "none", c = new b({
|
|
1179
1168
|
...e.style,
|
|
1180
1169
|
dashed: !0
|
|
1181
|
-
}), l = new
|
|
1170
|
+
}), l = new b({
|
|
1182
1171
|
...e.style,
|
|
1183
1172
|
dashed: !0,
|
|
1184
1173
|
lengthEnable: !1
|
|
1185
|
-
}), u = new
|
|
1174
|
+
}), u = new b({
|
|
1186
1175
|
...e.style,
|
|
1187
1176
|
dashed: !1,
|
|
1188
1177
|
lengthEnable: !1
|
|
1189
1178
|
});
|
|
1190
1179
|
o.add(c, u, l), t.enable(), t.setAdherePoints(ce(t.five, { excludes: [e] }));
|
|
1191
|
-
let f = [], p = new
|
|
1192
|
-
if (f.push(p.clone()), n?.onPointPlaced?.(), f.length === 1) t.planeMode = "onlyPlane", s === "y" && (t.adhereLine = [new
|
|
1180
|
+
let f = [], p = new w.Vector3(), m = new w.Vector3(), h = new w.Plane(), g = () => {
|
|
1181
|
+
if (f.push(p.clone()), n?.onPointPlaced?.(), f.length === 1) t.planeMode = "onlyPlane", s === "y" && (t.adhereLine = [new w.Line3(f[0], new w.Vector3(0, 1, 0).add(f[0]))]), s === "xoz" && (h.setFromNormalAndCoplanarPoint(new w.Vector3(0, 1, 0), f[0]), t.plane = h), s === "none" && (h.setFromNormalAndCoplanarPoint(m, f[0]), t.plane = h);
|
|
1193
1182
|
else if (f.length === 2) {
|
|
1194
1183
|
t.planeMode = "vertical", s === "y" && (t.adhereLine = []);
|
|
1195
1184
|
let e = !1;
|
|
1196
|
-
f[0].x === f[1].x && f[0].z === f[1].z && (e = !0), s === "y" && !e && (h.setFromCoplanarPoints(f[0], f[1], new
|
|
1197
|
-
} else f.length === 3 && (
|
|
1198
|
-
},
|
|
1185
|
+
f[0].x === f[1].x && f[0].z === f[1].z && (e = !0), s === "y" && !e && (h.setFromCoplanarPoints(f[0], f[1], new w.Vector3(0, 1, 0).add(f[0])), t.plane = h), u.setPoints([f[0], f[1]]);
|
|
1186
|
+
} else f.length === 3 && (y(), a());
|
|
1187
|
+
}, v = (n) => {
|
|
1199
1188
|
if (!n || !n?.raycaster) return;
|
|
1200
1189
|
let r = f.at(-1)?.clone();
|
|
1201
1190
|
if (f.length === 0) p = n.point.clone(), m = n.face?.normal;
|
|
@@ -1210,8 +1199,8 @@ function ue(e, t, n) {
|
|
|
1210
1199
|
h.setFromNormalAndCoplanarPoint(e, f[0]);
|
|
1211
1200
|
}
|
|
1212
1201
|
l.setPoints([n.originalPoint ?? n.point, n.point]);
|
|
1213
|
-
let r = new
|
|
1214
|
-
p = new
|
|
1202
|
+
let r = new w.Vector3().crossVectors(f[0].clone().sub(f[1]), h.normal).normalize();
|
|
1203
|
+
p = new w.Line3(f[1].clone().add(r), f[1].clone().sub(r)).closestPointToPoint(n.point, !1, new w.Vector3());
|
|
1215
1204
|
let i = z([
|
|
1216
1205
|
f[0],
|
|
1217
1206
|
f[1],
|
|
@@ -1219,14 +1208,14 @@ function ue(e, t, n) {
|
|
|
1219
1208
|
], t.five.camera.position);
|
|
1220
1209
|
e.setPoints(i);
|
|
1221
1210
|
}
|
|
1222
|
-
},
|
|
1223
|
-
t.setAdherePoints([]), t.adhereLine = [], t.adherePlane = [], t.plane = void 0, t.off("select", g), t.off("intersectionUpdate",
|
|
1224
|
-
},
|
|
1225
|
-
|
|
1211
|
+
}, y = () => {
|
|
1212
|
+
t.setAdherePoints([]), t.adhereLine = [], t.adherePlane = [], t.plane = void 0, t.off("select", g), t.off("intersectionUpdate", v), t.off("disable", x), t.disable(), o?.remove(c, u, l);
|
|
1213
|
+
}, x = () => {
|
|
1214
|
+
y(), o?.remove(e), i(/* @__PURE__ */ Error("Cancelled"));
|
|
1226
1215
|
};
|
|
1227
|
-
return t.on("select", g), t.on("intersectionUpdate",
|
|
1216
|
+
return t.on("select", g), t.on("intersectionUpdate", v), t.on("disable", x), r;
|
|
1228
1217
|
}
|
|
1229
1218
|
//#endregion
|
|
1230
|
-
export { H as a, B as c, M as d,
|
|
1219
|
+
export { H as a, B as c, M as d, T as f, Z as i, N as l, ae as n, V as o, D as p, re as r, ee as s, se as t, P as u };
|
|
1231
1220
|
|
|
1232
|
-
//# sourceMappingURL=Rectangle-
|
|
1221
|
+
//# sourceMappingURL=Rectangle-BpL9lNKU.js.map
|