@realsee/dnalogel 4.0.0-webgpu.10 → 4.0.0-webgpu.12
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 +12 -0
- package/README.md +16 -0
- package/dist/floorplan.js +1 -1
- package/dist/index.js +15 -15
- package/dist/internal/{BasePlugin-Bcnwb_Wp.js → BasePlugin-BW_ljJJD.js} +2 -2
- package/dist/internal/{BasePlugin-Bcnwb_Wp.js.map → BasePlugin-BW_ljJJD.js.map} +1 -1
- package/dist/internal/BasePluginWithData-D0fXwQd_.js +7 -0
- package/dist/internal/{BasePluginWithData-veD_f0Qf.js.map → BasePluginWithData-D0fXwQd_.js.map} +1 -1
- package/dist/internal/{Controller-DMHTzGm7.js → Controller-DG3aerF4.js} +2 -2
- package/dist/internal/{Controller-DMHTzGm7.js.map → Controller-DG3aerF4.js.map} +1 -1
- package/dist/internal/{Polygon-D3xIL1Pl.js → Polygon-BXajWnCj.js} +57 -40
- package/dist/internal/Polygon-BXajWnCj.js.map +1 -0
- package/dist/internal/{Prism-CJlyAEAU.js → Prism-BwjQPOyR.js} +2 -2
- package/dist/internal/{Prism-CJlyAEAU.js.map → Prism-BwjQPOyR.js.map} +1 -1
- package/dist/internal/{Rectangle-CC2WYvov.js → Rectangle-DkXDREEe.js} +4 -4
- package/dist/internal/{Rectangle-CC2WYvov.js.map → Rectangle-DkXDREEe.js.map} +1 -1
- package/dist/internal/{Work-BqpiX1z5.js → Work-BhhN7u0F.js} +4 -4
- package/dist/internal/{Work-BqpiX1z5.js.map → Work-BhhN7u0F.js.map} +1 -1
- package/dist/internal/{area-maker-B8zUUhVk.js → area-maker-BeBn65zc.js} +2 -2
- package/dist/internal/{area-maker-B8zUUhVk.js.map → area-maker-BeBn65zc.js.map} +1 -1
- package/dist/internal/{controller-BBHxJoEH.js → controller-BPXvtI5O.js} +3 -3
- package/dist/internal/{controller-BBHxJoEH.js.map → controller-BPXvtI5O.js.map} +1 -1
- package/dist/internal/{cruise-DeRGFGQ7.js → cruise-D473G5eR.js} +2 -2
- package/dist/internal/{cruise-DeRGFGQ7.js.map → cruise-D473G5eR.js.map} +1 -1
- package/dist/internal/{current-pano-image-sc2LFrya.js → current-pano-image-CVkGFOqe.js} +2 -2
- package/dist/internal/{current-pano-image-sc2LFrya.js.map → current-pano-image-CVkGFOqe.js.map} +1 -1
- package/dist/internal/{floorplan-BOdqCcAc.js → floorplan-Bi8r_6Gk.js} +2 -2
- package/dist/internal/{floorplan-BOdqCcAc.js.map → floorplan-Bi8r_6Gk.js.map} +1 -1
- package/dist/internal/{measure-D6kvLcMk.js → measure-y2GbIzBe.js} +285 -349
- package/dist/internal/measure-y2GbIzBe.js.map +1 -0
- package/dist/internal/{model-maker-p7IecfuB.js → model-maker-CwyCnEOs.js} +3 -3
- package/dist/internal/{model-maker-p7IecfuB.js.map → model-maker-CwyCnEOs.js.map} +1 -1
- package/dist/internal/object3d-helper-CpTwFvfA.js +7 -0
- package/dist/internal/{object3d-helper-DHPCLk5D.js.map → object3d-helper-CpTwFvfA.js.map} +1 -1
- package/dist/internal/{pano-compass-B_gNSkDR.js → pano-compass-AD-jrS_J.js} +2 -2
- package/dist/internal/{pano-compass-B_gNSkDR.js.map → pano-compass-AD-jrS_J.js.map} +1 -1
- package/dist/internal/{pano-door-label-BllgT6o-.js → pano-door-label-yE2L5n-c.js} +2 -2
- package/dist/internal/{pano-door-label-BllgT6o-.js.map → pano-door-label-yE2L5n-c.js.map} +1 -1
- package/dist/internal/{pano-measure-CoyU2j3g.js → pano-measure-COBz9Fp1.js} +2 -2
- package/dist/internal/{pano-measure-CoyU2j3g.js.map → pano-measure-COBz9Fp1.js.map} +1 -1
- package/dist/internal/{pano-tag-NjpQygy3.js → pano-tag-BJ4_t4J4.js} +2 -2
- package/dist/internal/{pano-tag-NjpQygy3.js.map → pano-tag-BJ4_t4J4.js.map} +1 -1
- package/dist/internal/{pano-video-DGQi5GPp.js → pano-video-D7q3cxv8.js} +2 -2
- package/dist/internal/{pano-video-DGQi5GPp.js.map → pano-video-D7q3cxv8.js.map} +1 -1
- package/dist/internal/{pipeline-D3S3Qt7T.js → pipeline-BRRIQUds.js} +2 -2
- package/dist/internal/{pipeline-D3S3Qt7T.js.map → pipeline-BRRIQUds.js.map} +1 -1
- package/dist/internal/{sculpt-Cqspd_4E.js → sculpt-9Mn330l3.js} +4 -4
- package/dist/internal/{sculpt-Cqspd_4E.js.map → sculpt-9Mn330l3.js.map} +1 -1
- package/dist/plugins/area-maker.js +1 -1
- package/dist/plugins/cruise.js +2 -2
- package/dist/plugins/current-pano-image.js +1 -1
- package/dist/plugins/guide-line.js +1 -1
- package/dist/plugins/measure.d.ts +1 -1
- package/dist/plugins/measure.js +1 -1
- package/dist/plugins/model-maker.js +1 -1
- package/dist/plugins/object3d-helper.js +2 -2
- 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-tag.js +2 -2
- package/dist/plugins/pano-video.js +1 -1
- package/dist/plugins/pipeline.js +1 -1
- package/dist/plugins/sculpt.js +4 -4
- package/dist/types/MeasurePlugin/Controller.d.ts +20 -12
- package/dist/types/MeasurePlugin/index.d.ts +1 -1
- package/dist/types/public/plugins/measure.d.ts +1 -1
- package/dist/types/shared-utils/three/PointSprite.d.ts +2 -1
- package/package.json +1 -1
- package/dist/internal/BasePluginWithData-veD_f0Qf.js +0 -7
- package/dist/internal/Polygon-D3xIL1Pl.js.map +0 -1
- package/dist/internal/measure-D6kvLcMk.js.map +0 -1
- package/dist/internal/object3d-helper-DHPCLk5D.js +0 -7
|
@@ -1,16 +1,33 @@
|
|
|
1
1
|
import { _ as e, a as t, c as n, f as r, h as i, p as a, t as o, u as s, w as c, x as l } from "./generatePolygonGeometry-BOnzdCaG.js";
|
|
2
|
-
import { i as u } from "./util-vGeVT4oo.js";
|
|
3
|
-
import { n as
|
|
4
|
-
import { n as
|
|
5
|
-
import * as
|
|
6
|
-
import { Sprite as
|
|
2
|
+
import { i as u, r as d } from "./util-vGeVT4oo.js";
|
|
3
|
+
import { n as f } from "./getNormal-BatLuzsS.js";
|
|
4
|
+
import { n as p } from "./isNil-CQNA0Sbe.js";
|
|
5
|
+
import * as m from "three/webgpu";
|
|
6
|
+
import { Plane as h, Sprite as g, Vector2 as _, Vector3 as v } from "three/webgpu";
|
|
7
7
|
//#region src/shared-utils/three/PointSprite.ts
|
|
8
|
-
var h = class extends
|
|
8
|
+
var y = new v(), b = new v(), x = new v(), S = new v(), C = new v(), w = new h(), T = class extends g {
|
|
9
9
|
pointMaterial;
|
|
10
10
|
constructor(e) {
|
|
11
11
|
super(e), this.pointMaterial = e;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
raycast(e, t) {
|
|
14
|
+
let n = e.camera, r = c(this)?.getElement();
|
|
15
|
+
if (!n || !r || !d(this)) return;
|
|
16
|
+
let { width: i, height: a } = r.getBoundingClientRect();
|
|
17
|
+
if (!i || !a || (this.getWorldPosition(y), b.copy(y).applyMatrix4(n.matrixWorldInverse), b.z >= 0) || (n.getWorldDirection(C), w.setFromNormalAndCoplanarPoint(C, y), !e.ray.intersectPlane(w, x))) return;
|
|
18
|
+
let o = e.ray.origin.distanceTo(x);
|
|
19
|
+
if (o < e.near || o > e.far) return;
|
|
20
|
+
let s = this.pointMaterial.size;
|
|
21
|
+
"isPerspectiveCamera" in n && this.pointMaterial.sizeAttenuation && (s *= a / (2 * -b.z)), y.project(n), S.copy(x).project(n);
|
|
22
|
+
let l = (S.x - y.x) * i / 2, u = (S.y - y.y) * a / 2;
|
|
23
|
+
l * l + u * u > s * s / 4 || t.push({
|
|
24
|
+
distance: o,
|
|
25
|
+
point: x.clone(),
|
|
26
|
+
object: this,
|
|
27
|
+
uv: new _(l / s + .5, u / s + .5)
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}, E = null, D = class extends f {
|
|
14
31
|
name = "PointMesh";
|
|
15
32
|
get color() {
|
|
16
33
|
return this.fontMesh.pointMaterial.color;
|
|
@@ -43,25 +60,25 @@ var h = class extends m {
|
|
|
43
60
|
let { point: t, ...n } = e ?? {};
|
|
44
61
|
this.paramsStyle = n ?? {};
|
|
45
62
|
let r = {
|
|
46
|
-
positionNode:
|
|
63
|
+
positionNode: m.TSL.vec3(0),
|
|
47
64
|
transparent: !0,
|
|
48
|
-
side:
|
|
65
|
+
side: m.DoubleSide,
|
|
49
66
|
size: e?.size ?? 8,
|
|
50
|
-
map:
|
|
67
|
+
map: E ||= new m.TextureLoader().load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBw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vQAAAABJRU5ErkJggg=="),
|
|
51
68
|
sizeAttenuation: !1
|
|
52
|
-
}, i = new
|
|
69
|
+
}, i = new m.PointsNodeMaterial({
|
|
53
70
|
...r,
|
|
54
71
|
color: e?.color ?? 16777215,
|
|
55
72
|
depthTest: !0,
|
|
56
73
|
opacity: e?.opacity ?? 1
|
|
57
|
-
}), a = new
|
|
74
|
+
}), a = new m.PointsNodeMaterial({
|
|
58
75
|
...r,
|
|
59
76
|
size: i.size,
|
|
60
77
|
color: i.color,
|
|
61
78
|
depthWrite: !1,
|
|
62
79
|
depthTest: !1,
|
|
63
80
|
opacity: i.opacity * .5
|
|
64
|
-
}), o = new
|
|
81
|
+
}), o = new T(i), c = new T(a);
|
|
65
82
|
this.fontMesh = o, this.backgroundMesh = c, o.name = "FontMesh", c.name = "BackgroundMesh", o.renderOrder = 10, c.renderOrder = 0, this.add(o, c), e?.point && this.position.copy(u(e.point)), e && this.setStyle(e), this.addEventListener("removed", () => {
|
|
66
83
|
s.cacheObject.delete(this), s.checkDom(this);
|
|
67
84
|
}), this.addEventListener("added", () => {
|
|
@@ -69,7 +86,7 @@ var h = class extends m {
|
|
|
69
86
|
}), s.checkDomEveryFrame();
|
|
70
87
|
}
|
|
71
88
|
setStyle(e) {
|
|
72
|
-
|
|
89
|
+
p(e.color) && (this.fontMesh.pointMaterial.setValues({ color: e.color }), this.backgroundMesh.pointMaterial.setValues({ color: e.color })), p(e.size) && (this.fontMesh.pointMaterial.setValues({ size: e.size }), this.backgroundMesh.pointMaterial.setValues({ size: e.size })), p(e.occlusionVisibility) && (e.occlusionVisibility ? e.occlusionMode === "depthTest" ? (this.fontMesh.pointMaterial.depthTest = !1, this.backgroundMesh.visible = !1) : (this.fontMesh.pointMaterial.depthTest = !0, this.backgroundMesh.visible = !0) : (this.fontMesh.pointMaterial.depthTest = !0, this.backgroundMesh.visible = !1));
|
|
73
90
|
}
|
|
74
91
|
highlight() {
|
|
75
92
|
this.highlighted || (this.highlighted = !0, this.opacityBeforeHighlight = this.fontMesh.pointMaterial.opacity, this.fontMesh.pointMaterial.setValues({ opacity: this.opacityBeforeHighlight * l }));
|
|
@@ -105,9 +122,9 @@ var h = class extends m {
|
|
|
105
122
|
};
|
|
106
123
|
t ? (n(t), this.dom.setPosition(this.position.clone())) : n(null);
|
|
107
124
|
}
|
|
108
|
-
},
|
|
125
|
+
}, O = class extends n {
|
|
109
126
|
name = "LineWithDotsMesh";
|
|
110
|
-
pointGroup = new
|
|
127
|
+
pointGroup = new f();
|
|
111
128
|
_paramsStyle;
|
|
112
129
|
get startPoint() {
|
|
113
130
|
return this.pointMeshes[0];
|
|
@@ -126,9 +143,9 @@ var h = class extends m {
|
|
|
126
143
|
}
|
|
127
144
|
setPoints(e) {
|
|
128
145
|
super.setPoints(e);
|
|
129
|
-
let t = e.map(u).filter(
|
|
146
|
+
let t = e.map(u).filter(p);
|
|
130
147
|
this.pointGroup.removeChildren(), this.addIfNotExists(this.pointGroup), t.forEach((e) => {
|
|
131
|
-
let t = new
|
|
148
|
+
let t = new D({
|
|
132
149
|
...this.style,
|
|
133
150
|
color: this._paramsStyle?.pointColor ?? this._paramsStyle?.lineColor,
|
|
134
151
|
tip: void 0
|
|
@@ -153,9 +170,9 @@ var h = class extends m {
|
|
|
153
170
|
super.unhighlight(), this.pointMeshes.forEach((e) => e.unhighlight());
|
|
154
171
|
};
|
|
155
172
|
updateEdgePointsVisibility = () => {
|
|
156
|
-
|
|
173
|
+
p(this._paramsStyle?.pointVisibility) && (this.startPoint && (this.startPoint.visible = typeof this._paramsStyle.pointVisibility == "object" ? this._paramsStyle.pointVisibility.startPoint : this._paramsStyle.pointVisibility), this.endPoint && (this.endPoint.visible = typeof this._paramsStyle.pointVisibility == "object" ? this._paramsStyle.pointVisibility.endPoint : this._paramsStyle.pointVisibility));
|
|
157
174
|
};
|
|
158
|
-
},
|
|
175
|
+
}, k = class extends f {
|
|
159
176
|
name = "ColoredMesh";
|
|
160
177
|
meshFont;
|
|
161
178
|
meshBackground;
|
|
@@ -186,27 +203,27 @@ var h = class extends m {
|
|
|
186
203
|
return this._geometry;
|
|
187
204
|
}
|
|
188
205
|
paramsStyle = {};
|
|
189
|
-
_geometry = new
|
|
206
|
+
_geometry = new m.BufferGeometry();
|
|
190
207
|
highlighted = !1;
|
|
191
208
|
opacityBeforeHighlight;
|
|
192
209
|
colorBeforeHighlight;
|
|
193
210
|
constructor(e) {
|
|
194
211
|
super(), this.paramsStyle = e ?? {};
|
|
195
|
-
let t = new
|
|
196
|
-
color: new
|
|
212
|
+
let t = new m.MeshBasicMaterial({
|
|
213
|
+
color: new m.Color(e?.color ?? 16777215),
|
|
197
214
|
transparent: !0,
|
|
198
|
-
side:
|
|
215
|
+
side: m.DoubleSide,
|
|
199
216
|
depthTest: !0,
|
|
200
217
|
depthWrite: !1,
|
|
201
218
|
opacity: e?.opacity ?? .4
|
|
202
|
-
}), n = new
|
|
219
|
+
}), n = new m.MeshBasicMaterial({
|
|
203
220
|
color: 16777215,
|
|
204
221
|
transparent: !0,
|
|
205
|
-
side:
|
|
222
|
+
side: m.DoubleSide,
|
|
206
223
|
depthTest: !1,
|
|
207
224
|
depthWrite: !1,
|
|
208
225
|
opacity: .3 / .5 * t.opacity
|
|
209
|
-
}), r = new
|
|
226
|
+
}), r = new m.Mesh(this.geometry, t), i = new m.Mesh(this.geometry, n);
|
|
210
227
|
r.name = "MeshFront", i.name = "MeshBackground", r.renderOrder = 1, i.renderOrder = 0, this.meshFont = r, this.meshBackground = i, this.add(r), this.setOcclusionVisibility({
|
|
211
228
|
occlusionVisibility: e?.occlusionVisibility,
|
|
212
229
|
occlusionMode: e?.occlusionMode
|
|
@@ -216,24 +233,24 @@ var h = class extends m {
|
|
|
216
233
|
this.paramsStyle = {
|
|
217
234
|
...this.paramsStyle,
|
|
218
235
|
...e
|
|
219
|
-
},
|
|
236
|
+
}, p(e.color) && (this.meshFont.material.color.set(new m.Color(e.color)), this.needsRender = !0), p(e.opacity) && (this.meshFont.material.opacity = e.opacity, this.meshBackground.material.opacity = .3 / .5 * this.meshFont.material.opacity, this.needsRender = !0), this.setOcclusionVisibility(e);
|
|
220
237
|
}
|
|
221
238
|
highlight(e) {
|
|
222
|
-
this.highlighted = !0,
|
|
239
|
+
this.highlighted = !0, p(e?.color) ? (this.colorBeforeHighlight = this.colorBeforeHighlight ?? this.meshFont.material.color.clone(), this.meshFont.material.color.set(new m.Color(e.color))) : (this.opacityBeforeHighlight = this.opacityBeforeHighlight ?? this.opacity, this.meshFont.material.opacity = this.opacity * l, this.meshBackground.material.opacity = .3 / .5 * this.meshFont.material.opacity), this.needsRender = !0;
|
|
223
240
|
}
|
|
224
241
|
unhighlight() {
|
|
225
|
-
this.highlighted = !1,
|
|
242
|
+
this.highlighted = !1, p(this.opacityBeforeHighlight) && (this.meshFont.material.opacity = this.opacityBeforeHighlight, this.meshBackground.material.opacity = .3 / .5 * this.meshFont.material.opacity, this.opacityBeforeHighlight = void 0), p(this.colorBeforeHighlight) && (this.meshFont.material.color = new m.Color(this.colorBeforeHighlight), this.colorBeforeHighlight = void 0), this.needsRender = !0;
|
|
226
243
|
}
|
|
227
244
|
setOcclusionVisibility(e) {
|
|
228
245
|
let t = e.occlusionMode ?? this.paramsStyle.occlusionMode ?? "translucence", n = e.occlusionVisibility ?? this.paramsStyle.occlusionVisibility;
|
|
229
|
-
|
|
246
|
+
p(n) && (n ? t === "depthTest" ? (this.meshFont.material.depthTest = !1, this.remove(this.meshBackground)) : t === "translucence" && (this.meshFont.material.depthTest = !0, this.addIfNotExists(this.meshBackground)) : (this.meshFont.material.depthTest = !0, this.remove(this.meshBackground)));
|
|
230
247
|
}
|
|
231
|
-
},
|
|
232
|
-
|
|
233
|
-
var
|
|
248
|
+
}, A = new m.BufferGeometry();
|
|
249
|
+
A.name = "blankGeometry", A.isBlank = !0;
|
|
250
|
+
var j = class extends k {
|
|
234
251
|
name = "PolygonMesh";
|
|
235
252
|
get normal() {
|
|
236
|
-
return this.points.length >= 3 ? new
|
|
253
|
+
return this.points.length >= 3 ? new m.Vector3().crossVectors(this.points[1].clone().sub(this.points[0]), this.points[2].clone().sub(this.points[0])).normalize() : new m.Vector3(0, 0, 1);
|
|
237
254
|
}
|
|
238
255
|
get style() {
|
|
239
256
|
return {
|
|
@@ -284,10 +301,10 @@ var x = class extends y {
|
|
|
284
301
|
}
|
|
285
302
|
setPoints(e, t) {
|
|
286
303
|
let n = e.map(u);
|
|
287
|
-
this.points = n, this.geometry = o(this.points, { checkLinesIntersect: t?.checkLinesIntersect ?? !0 }) ??
|
|
304
|
+
this.points = n, this.geometry = o(this.points, { checkLinesIntersect: t?.checkLinesIntersect ?? !0 }) ?? A, this.planeHelperNeedUpdate = !0, this.geometryInfoNeedUpdate = !0, this.updateAreaItems();
|
|
288
305
|
}
|
|
289
306
|
projectPoint(e) {
|
|
290
|
-
return e && (this.planeHelperNeedUpdate && this.updatePlaneHelper(), this.planeHelper ? this.planeHelper.projectPoint(e, new
|
|
307
|
+
return e && (this.planeHelperNeedUpdate && this.updatePlaneHelper(), this.planeHelper ? this.planeHelper.projectPoint(e, new m.Vector3()) : e);
|
|
291
308
|
}
|
|
292
309
|
_onAdded = () => {
|
|
293
310
|
this.areaDom || this.updateAreaItems();
|
|
@@ -302,7 +319,7 @@ var x = class extends y {
|
|
|
302
319
|
this.areaDom && (this.areaDom.container.style.display = "none");
|
|
303
320
|
};
|
|
304
321
|
updatePlaneHelper() {
|
|
305
|
-
this.planeHelper = this.points.length >= 3 ? new
|
|
322
|
+
this.planeHelper = this.points.length >= 3 ? new m.Plane().setFromCoplanarPoints(this.points[0], this.points[1], this.points[2]) : null, this.planeHelperNeedUpdate = !1;
|
|
306
323
|
}
|
|
307
324
|
updateAreaItems() {
|
|
308
325
|
let t = () => {
|
|
@@ -319,6 +336,6 @@ var x = class extends y {
|
|
|
319
336
|
}
|
|
320
337
|
};
|
|
321
338
|
//#endregion
|
|
322
|
-
export {
|
|
339
|
+
export { D as i, k as n, O as r, j as t };
|
|
323
340
|
|
|
324
|
-
//# sourceMappingURL=Polygon-
|
|
341
|
+
//# sourceMappingURL=Polygon-BXajWnCj.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Polygon-BXajWnCj.js","names":["LightTag","getGeometryInfo","LineMesh","transformUnitSquare","getLengthHTML","localToWorld","generatePolygonGeometry","RenderDom","getFiveFromParentChain","DEFAULT_HIGHLIGHT_OPACITY","anyPositionToVector3","getObjectVisible","IObject3D","notNil","THREE","center","Vector3","viewCenter","hit","projectedHit","normal","plane","Plane","PointSprite","Sprite","pointMaterial","camera","raycaster","element","width","height","distance","size","dx","dy","intersects","Vector2","sharedCircleTexture","PointMesh","paramsStyle","params","materialParams","materialFront","materialBackground","fontMesh","backgroundMesh","force","lastRenderDomItem","tip","render","str","LineWithDotsMesh","p","points","vectors","pointMesh","vector","style","ColoredMesh","geometry","meshFront","meshBackground","occlusionMode","occlusionVisibility","blankGeometry","PolygonMesh","lastRenderAreaItem","config","point","clear","tag","areaString"],"sources":["../../src/shared-utils/three/PointSprite.ts","../../src/Sculpt/Meshes/Point.ts","../../src/Sculpt/Meshes/LineWithDots.ts","../../src/Sculpt/utils/three/ColoredMesh.ts","../../src/Sculpt/Meshes/Polygon.ts"],"sourcesContent":["import { Plane, Sprite, Vector2, Vector3, type Intersection, type PointsNodeMaterial, type Raycaster, type SpriteMaterial } from 'three/webgpu'\nimport { getFiveFromParentChain } from '../five/getFiveFromParentChain'\nimport { getObjectVisible } from './getObjectVisible'\n\nconst center = new Vector3()\nconst viewCenter = new Vector3()\nconst hit = new Vector3()\nconst projectedHit = new Vector3()\nconst normal = new Vector3()\nconst plane = new Plane()\n\n/** Sprite geometry supplies UVs; PointsNodeMaterial supplies pixel-sized billboards on WebGPU. */\nexport class PointSprite extends Sprite {\n public constructor(public readonly pointMaterial: PointsNodeMaterial) {\n // Three supports node materials here; the Sprite constructor type still names SpriteMaterial.\n super(pointMaterial as unknown as SpriteMaterial)\n }\n\n public override raycast(raycaster: Raycaster, intersects: Intersection[]) {\n const camera = raycaster.camera\n const element = getFiveFromParentChain(this)?.getElement()\n if (!camera || !element || !getObjectVisible(this)) return\n const { width, height } = element.getBoundingClientRect()\n if (!width || !height) return\n\n this.getWorldPosition(center)\n viewCenter.copy(center).applyMatrix4(camera.matrixWorldInverse)\n if (viewCenter.z >= 0) return\n camera.getWorldDirection(normal)\n plane.setFromNormalAndCoplanarPoint(normal, center)\n if (!raycaster.ray.intersectPlane(plane, hit)) return\n const distance = raycaster.ray.origin.distanceTo(hit)\n if (distance < raycaster.near || distance > raycaster.far) return\n\n // PointsNodeMaterial sizes its billboard in logical pixels, independently of\n // Sprite.scale. Sprite.raycast instead tests a world-sized quad.\n let size = this.pointMaterial.size\n if ('isPerspectiveCamera' in camera && this.pointMaterial.sizeAttenuation) {\n size *= height / (2 * -viewCenter.z)\n }\n center.project(camera)\n projectedHit.copy(hit).project(camera)\n const dx = (projectedHit.x - center.x) * width / 2\n const dy = (projectedHit.y - center.y) * height / 2\n if (dx * dx + dy * dy > size * size / 4) return\n intersects.push({ distance, point: hit.clone(), object: this, uv: new Vector2(dx / size + 0.5, dy / size + 0.5) })\n }\n}\n","import * as THREE from 'three/webgpu'\nimport {\n DEFAULT_HIGHLIGHT_OPACITY,\n type ColorStyle,\n type DisplayInfoConfig,\n type OcclusionStyle,\n type OpacityStyle,\n} from '../typings/style'\nimport { IObject3D } from '../../shared-utils/three/IObject3D'\nimport { anyPositionToVector3 } from '../../shared-utils/positionToVector3'\nimport type { PointData } from '../utils/data'\nimport { notNil } from '../../shared-utils'\nimport { LightTag } from '../../shared-utils/tag'\nimport { localToWorld } from '../../shared-utils/three/applyObjectMatrixWorld'\nimport { getFiveFromParentChain } from '../../shared-utils/five/getFiveFromParentChain'\nimport type { Five } from '@realsee/five-webgpu'\nimport { getLengthHTML } from '../utils/Meshes/getLengthHTML'\nimport { RenderDom } from '../utils/renderDom'\nexport type { PointData } from '../utils/data'\n\nexport const circleImageURL =\n 'data:image/png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NDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg=='\n\nlet sharedCircleTexture: THREE.Texture | null = null\n\nimport { PointSprite } from '../../shared-utils/three/PointSprite'\n\nexport type PointStyle = ColorStyle & { size: number } & OcclusionStyle & Partial<DisplayInfoConfig> & OpacityStyle\n\nexport class PointMesh extends IObject3D {\n public name = 'PointMesh'\n\n public get color() {\n return this.fontMesh.pointMaterial.color\n }\n\n public get size() {\n return this.fontMesh.pointMaterial.size\n }\n\n public get style() {\n return {\n color: this.color,\n size: this.size,\n opacity: this.fontMesh.pointMaterial.opacity,\n occlusionVisibility: this.fontMesh.pointMaterial.depthTest,\n occlusionMode: this.backgroundMesh.visible ? 'depthWrite' : 'depthTest',\n }\n }\n\n public dom: LightTag\n\n private opacityBeforeHighlight: number\n private highlighted = false\n\n private fontMesh: PointSprite\n private backgroundMesh: PointSprite\n\n private lastRenderDomItem: string\n\n private paramsStyle: Partial<PointStyle>\n\n private _visible = true\n\n private get five(): Five | undefined {\n return getFiveFromParentChain(this)\n }\n\n public constructor(params?: Partial<PointStyle & PointData>) {\n super()\n\n const { point, ...paramsStyle } = params ?? {}\n\n this.paramsStyle = paramsStyle ?? {}\n\n\n const materialParams = {\n positionNode: THREE.TSL.vec3(0),\n transparent: true,\n side: THREE.DoubleSide,\n size: params?.size ?? 8,\n map: sharedCircleTexture || (sharedCircleTexture = new THREE.TextureLoader().load(circleImageURL)),\n sizeAttenuation: false,\n }\n\n // 上层\n const materialFront = new THREE.PointsNodeMaterial({\n ...materialParams,\n color: params?.color ?? 0xffffff,\n depthTest: true,\n opacity: params?.opacity ?? 1,\n })\n\n // 下层\n const materialBackground = new THREE.PointsNodeMaterial({\n ...materialParams,\n size: materialFront.size,\n color: materialFront.color,\n depthWrite: false,\n depthTest: false,\n opacity: materialFront.opacity * 0.5,\n })\n\n const fontMesh = new PointSprite(materialFront)\n const backgroundMesh = new PointSprite(materialBackground)\n\n this.fontMesh = fontMesh\n this.backgroundMesh = backgroundMesh\n\n fontMesh.name = 'FontMesh'\n backgroundMesh.name = 'BackgroundMesh'\n\n fontMesh.renderOrder = 10\n backgroundMesh.renderOrder = 0\n\n this.add(fontMesh, backgroundMesh)\n\n if (params?.point) {\n this.position.copy(anyPositionToVector3(params.point))\n }\n\n if (params) this.setStyle(params)\n\n this.addEventListener('removed', () => {\n RenderDom.cacheObject.delete(this)\n RenderDom.checkDom(this)\n })\n this.addEventListener('added', () => {\n RenderDom.cacheObject.add(this)\n })\n\n RenderDom.checkDomEveryFrame()\n }\n\n public setStyle(params: Partial<PointStyle>) {\n if (notNil(params.color)) {\n this.fontMesh.pointMaterial.setValues({ color: params.color })\n this.backgroundMesh.pointMaterial.setValues({ color: params.color })\n }\n if (notNil(params.size)) {\n this.fontMesh.pointMaterial.setValues({ size: params.size })\n this.backgroundMesh.pointMaterial.setValues({ size: params.size })\n }\n if (notNil(params.occlusionVisibility)) {\n if (params.occlusionVisibility) {\n if (params.occlusionMode === 'depthTest') {\n this.fontMesh.pointMaterial.depthTest = false\n this.backgroundMesh.visible = false\n } else {\n this.fontMesh.pointMaterial.depthTest = true\n this.backgroundMesh.visible = true\n }\n } else {\n this.fontMesh.pointMaterial.depthTest = true\n this.backgroundMesh.visible = false\n }\n }\n }\n\n public highlight() {\n if (this.highlighted) return\n this.highlighted = true\n this.opacityBeforeHighlight = this.fontMesh.pointMaterial.opacity\n this.fontMesh.pointMaterial.setValues({ opacity: this.opacityBeforeHighlight * DEFAULT_HIGHLIGHT_OPACITY })\n }\n\n public unhighlight() {\n if (!this.highlighted) return\n this.highlighted = false\n this.fontMesh.pointMaterial.setValues({ opacity: this.opacityBeforeHighlight })\n }\n\n public updateMatrixWorld(force?: boolean) {\n super.updateMatrixWorld(force)\n const lastRenderDomItem = localToWorld(this, this.position).toArray().join(',')\n if (lastRenderDomItem !== this.lastRenderDomItem) {\n this.updateDom()\n this.lastRenderDomItem = lastRenderDomItem\n }\n }\n\n public _onAdded = () => {\n if (!this.dom) this.updateDom()\n }\n\n public _onRemoved = () => {\n this.dom?.destroy()\n this.dom = undefined\n }\n\n public _onShowed = () => {\n if (this.dom) this.dom.container.style.display = 'block'\n }\n\n public _onHidden = () => {\n if (this.dom) this.dom.container.style.display = 'none'\n }\n\n private updateDom() {\n const tip = this.paramsStyle.tip\n if (tip && !this.dom && this.five) {\n this.dom = new LightTag(this.five)\n this.dom.intersectCheck = false\n this.dom.simulate3D = true\n this.dom.container.style.display = this.visible ? 'block' : 'none'\n }\n\n const render = (str: string | HTMLElement | null) => {\n if (!this.dom) return\n\n if ((this.dom as any).__text === str) return\n ;(this.dom as any).__text = str\n\n if (str instanceof HTMLElement) {\n this.dom.container.innerHTML = ''\n this.dom.container.appendChild(str)\n } else if (str) {\n this.dom.container.innerHTML = getLengthHTML(str, {\n style: '',\n offsetY: -20, // 移动label到点的上方,否则会遮挡鼠标选点\n })\n } else {\n this.dom.container.innerHTML = ''\n }\n }\n\n if (!tip) {\n render(null)\n } else {\n render(tip)\n this.dom.setPosition(this.position.clone())\n }\n }\n}\n","import { anyPositionToVector3, type AnyPositions } from '../../shared-utils/positionToVector3'\nimport { PointMesh } from './Point'\nimport { notNil } from '../../shared-utils'\nimport { LineMesh, type LineMeshStyle } from './Line'\nimport { IObject3D } from '../../shared-utils/three/IObject3D'\nimport type { PointsData } from '../utils/data'\nimport type { Color } from '../typings/style'\nimport type { Overwrite } from '../../typings/utils.type'\n\ntype Style = LineMeshStyle & {\n pointVisibility?: boolean | { startPoint?: boolean; endPoint?: boolean }\n /**\n * 点颜色\n */\n pointColor?: Color\n /**\n * 点透明度\n */\n pointOpacity?: number\n /**\n * 线颜色\n */\n lineColor?: Color\n /**\n * 线透明度\n */\n lineOpacity?: number\n}\n\n/**\n * Represents a mesh that consists of a line with dots at the start and end points.\n */\nexport class LineWithDotsMesh extends LineMesh {\n public name = 'LineWithDotsMesh'\n\n public pointGroup: Overwrite<IObject3D, { children: Array<PointMesh> }> = new IObject3D() as any\n private _paramsStyle: Style\n\n public get startPoint() {\n return this.pointMeshes[0]\n }\n public get endPoint() {\n if (this.pointMeshes.length < 2) return null\n return this.pointMeshes[this.pointMeshes.length - 1]\n }\n public get visiblePointMeshes() {\n return this.pointMeshes.filter((p) => p.visible)\n }\n public get pointMeshes() {\n return this.pointGroup.children as PointMesh[]\n }\n\n public constructor(params?: Partial<Style & PointsData>) {\n super()\n this.add(this.pointGroup)\n\n if (params) this.setStyle(params)\n if (params?.points) {\n this.setPoints(params.points)\n }\n }\n\n public setPoints(points: AnyPositions) {\n super.setPoints(points)\n const vectors = points.map(anyPositionToVector3).filter(notNil)\n\n this.pointGroup.removeChildren()\n this.addIfNotExists(this.pointGroup)\n\n vectors.forEach((vector) => {\n const pointMesh = new PointMesh({\n ...this.style,\n color: this._paramsStyle?.pointColor ?? this._paramsStyle?.lineColor,\n tip: undefined,\n })\n pointMesh.position.copy(vector)\n this.pointGroup.add(pointMesh)\n })\n\n this.updateEdgePointsVisibility()\n\n this.needsRender = true\n }\n\n public setStyle = (style: Partial<Style>) => {\n super.setStyle(style)\n this._paramsStyle = { ...this._paramsStyle, ...style }\n this.pointMeshes.forEach((pointMesh) =>\n pointMesh.setStyle({ ...this._paramsStyle, color: this._paramsStyle?.pointColor ?? this._paramsStyle?.lineColor, tip: undefined }),\n )\n this.updateEdgePointsVisibility()\n this.needsRender = true\n }\n\n public highlight = (params?: { color?: Color }) => {\n super.highlight(params)\n this.pointMeshes.forEach((pointMesh) => pointMesh.highlight())\n }\n\n public unhighlight = () => {\n super.unhighlight()\n this.pointMeshes.forEach((pointMesh) => pointMesh.unhighlight())\n }\n\n private updateEdgePointsVisibility = () => {\n if (notNil(this._paramsStyle?.pointVisibility)) {\n if (this.startPoint)\n this.startPoint.visible =\n typeof this._paramsStyle.pointVisibility === 'object'\n ? this._paramsStyle.pointVisibility.startPoint\n : this._paramsStyle.pointVisibility\n if (this.endPoint)\n this.endPoint.visible =\n typeof this._paramsStyle.pointVisibility === 'object'\n ? this._paramsStyle.pointVisibility.endPoint\n : this._paramsStyle.pointVisibility\n }\n }\n}\n","import * as THREE from 'three/webgpu'\nimport {\n DEFAULT_COLOR,\n type ColorStyle,\n type OpacityStyle,\n type OcclusionStyle,\n DEFAULT_HIGHLIGHT_OPACITY,\n DEFAULT_OPACITY,\n type Color,\n} from '../../typings/style'\nimport { IObject3D } from '../../../shared-utils/three/IObject3D'\nimport { notNil } from '../../../shared-utils'\n\nexport type ColoredMeshStyle = OpacityStyle & ColorStyle & OcclusionStyle\n\nexport default class ColoredMesh<\n TGeometry extends THREE.BufferGeometry = THREE.BufferGeometry,\n> extends IObject3D {\n public name = 'ColoredMesh'\n\n public meshFont: THREE.Mesh<TGeometry, THREE.MeshBasicMaterial>\n public meshBackground: THREE.Mesh<TGeometry, THREE.MeshBasicMaterial>\n\n public get style() {\n return {\n color: this.color,\n opacity: this.opacity,\n occlusionVisibility: this.occlusionVisibility,\n occlusionMode: this.occlusionMode,\n }\n }\n\n public get color() {\n return this.meshFont.material.color\n }\n\n public get opacity() {\n return this.meshFont.material.opacity\n }\n\n public get occlusionVisibility() {\n return Boolean(this.meshBackground.parent) || this.meshFont.material.depthTest === false\n }\n\n public get occlusionMode(): 'depthTest' | 'translucence' {\n return this.meshFont.material.depthTest === false ? 'depthTest' : 'translucence'\n }\n\n public set geometry(geometry: TGeometry) {\n this._geometry = geometry\n this.meshFont.geometry = geometry\n this.meshBackground.geometry = geometry\n }\n\n public get geometry() {\n return this._geometry\n }\n\n private paramsStyle: Partial<ColoredMeshStyle> = {}\n\n private _geometry: TGeometry = new THREE.BufferGeometry() as TGeometry\n\n private highlighted = false\n private opacityBeforeHighlight: number\n private colorBeforeHighlight: Color\n\n public constructor(params?: Partial<ColoredMeshStyle>) {\n super()\n\n this.paramsStyle = params ?? {}\n // 蓝的\n const materialFront = new THREE.MeshBasicMaterial({\n color: new THREE.Color(params?.color ?? DEFAULT_COLOR), // Three converts sRGB literals to its linear working space.\n transparent: true,\n side: THREE.DoubleSide,\n depthTest: true,\n depthWrite: false,\n opacity: params?.opacity ?? DEFAULT_OPACITY,\n })\n // 白的\n const materialBackground = new THREE.MeshBasicMaterial({\n color: 0xffffff,\n transparent: true,\n side: THREE.DoubleSide,\n depthTest: false,\n depthWrite: false,\n opacity: (0.3 / 0.5) * materialFront.opacity,\n })\n\n const meshFront = new THREE.Mesh(this.geometry, materialFront)\n const meshBackground = new THREE.Mesh(this.geometry, materialBackground)\n\n meshFront.name = 'MeshFront'\n meshBackground.name = 'MeshBackground'\n\n // 让蓝色的在白色的上面\n meshFront.renderOrder = 1\n meshBackground.renderOrder = 0\n\n this.meshFont = meshFront\n this.meshBackground = meshBackground\n\n this.add(meshFront)\n\n this.setOcclusionVisibility({ occlusionVisibility: params?.occlusionVisibility, occlusionMode: params?.occlusionMode })\n }\n\n public setStyle(params: Partial<ColoredMeshStyle>) {\n this.paramsStyle = { ...this.paramsStyle, ...params }\n if (notNil(params.color)) {\n this.meshFont.material.color.set(new THREE.Color(params.color))\n this.needsRender = true\n }\n if (notNil(params.opacity)) {\n this.meshFont.material.opacity = params.opacity\n this.meshBackground.material.opacity = (0.3 / 0.5) * this.meshFont.material.opacity\n this.needsRender = true\n }\n this.setOcclusionVisibility(params)\n }\n\n public highlight(params?: { color?: Color }) {\n this.highlighted = true\n\n if (notNil(params?.color)) {\n this.colorBeforeHighlight = this.colorBeforeHighlight ?? this.meshFont.material.color.clone()\n this.meshFont.material.color.set(new THREE.Color(params.color))\n } else {\n this.opacityBeforeHighlight = this.opacityBeforeHighlight ?? this.opacity\n this.meshFont.material.opacity = this.opacity * DEFAULT_HIGHLIGHT_OPACITY\n this.meshBackground.material.opacity = (0.3 / 0.5) * this.meshFont.material.opacity\n }\n\n this.needsRender = true\n }\n\n public unhighlight() {\n this.highlighted = false\n\n if (notNil(this.opacityBeforeHighlight)) {\n this.meshFont.material.opacity = this.opacityBeforeHighlight\n this.meshBackground.material.opacity = (0.3 / 0.5) * this.meshFont.material.opacity\n this.opacityBeforeHighlight = undefined\n }\n\n if (notNil(this.colorBeforeHighlight)) {\n this.meshFont.material.color = new THREE.Color(this.colorBeforeHighlight)\n this.colorBeforeHighlight = undefined\n }\n\n this.needsRender = true\n }\n\n private setOcclusionVisibility(params: Partial<OcclusionStyle>) {\n const occlusionMode = params.occlusionMode ?? this.paramsStyle.occlusionMode ?? 'translucence'\n const occlusionVisibility = params.occlusionVisibility ?? this.paramsStyle.occlusionVisibility\n if (notNil(occlusionVisibility)) {\n if (occlusionVisibility) {\n if (occlusionMode === 'depthTest') {\n this.meshFont.material.depthTest = false\n this.remove(this.meshBackground)\n } else if (occlusionMode === 'translucence') {\n this.meshFont.material.depthTest = true\n this.addIfNotExists(this.meshBackground)\n }\n } else {\n this.meshFont.material.depthTest = true\n this.remove(this.meshBackground)\n }\n }\n }\n}\n","import * as THREE from 'three/webgpu'\nimport generatePolygonGeometry from '../../shared-utils/three/generatePolygonGeometry'\nimport { anyPositionToVector3, type AnyPositions } from '../../shared-utils/positionToVector3'\nimport ColoredMesh, { type ColoredMeshStyle } from '../utils/three/ColoredMesh'\nimport { getGeometryInfo } from '../../shared-utils/three/geometryUtil'\nimport type { PointsData } from '../utils/data'\nimport { LightTag } from '../../shared-utils/tag'\nimport { getLengthHTML } from '../utils/Meshes/getLengthHTML'\nimport { localToWorld } from '../../shared-utils/three/applyObjectMatrixWorld'\nimport { getFiveFromParentChain } from '../../shared-utils/five/getFiveFromParentChain'\nimport type { Five } from '@realsee/five-webgpu'\nimport { notNil } from '../../shared-utils'\nimport type { LengthConfig } from '../typings/style'\nimport { transformUnitSquare } from '../utils/unit'\nimport { RenderDom } from '../utils/renderDom'\n\nexport const blankGeometry: THREE.BufferGeometry & { isBlank: true } = new THREE.BufferGeometry() as any\nblankGeometry.name = 'blankGeometry'\nblankGeometry.isBlank = true\n\nexport type PolygonStyle = ColoredMeshStyle & LengthConfig\n\nexport type PolygonData = PointsData\n\nexport class PolygonMesh extends ColoredMesh<THREE.BufferGeometry> {\n public name = 'PolygonMesh'\n\n public get normal() {\n if (this.points.length >= 3) {\n return new THREE.Vector3()\n .crossVectors(this.points[1].clone().sub(this.points[0]), this.points[2].clone().sub(this.points[0]))\n .normalize()\n } else {\n return new THREE.Vector3(0, 0, 1)\n }\n }\n\n public get style() {\n return { ...super.style, lengthEnable: this._paramsStyle.lengthEnable }\n }\n\n public get isBlank() {\n return Boolean((this.geometry as any).isBlank)\n }\n\n public get center() {\n return this.geometryInfo?.center.clone()\n }\n\n public get geometryInfo() {\n if (this.geometryInfoNeedUpdate) {\n if (this.isBlank) {\n this._geometryInfo = null\n } else {\n this._geometryInfo = getGeometryInfo(this.geometry)\n }\n this.geometryInfoNeedUpdate = false\n }\n return this._geometryInfo\n }\n\n public points: THREE.Vector3[] = []\n\n public planeHelperNeedUpdate = true\n public geometryInfoNeedUpdate = true\n\n public _paramsStyle: Partial<PolygonStyle>\n\n public areaDom?: LightTag\n\n private get five(): Five | undefined {\n return getFiveFromParentChain(this)\n }\n\n private planeHelper: THREE.Plane | null = null\n private _geometryInfo: { area: number; center: THREE.Vector3 } | null = null\n\n private lastRenderAreaItem: string\n\n public constructor(params?: Partial<PolygonStyle & PolygonData>) {\n super(params)\n\n if (params?.points) this.setPoints(params.points)\n this._paramsStyle = params ?? {}\n this.updateAreaItems()\n\n this.addEventListener('removed', () => {\n RenderDom.cacheObject.delete(this)\n RenderDom.checkDom(this)\n })\n this.addEventListener('added', () => {\n RenderDom.cacheObject.add(this)\n })\n\n RenderDom.checkDomEveryFrame()\n }\n\n public updateMatrixWorld(force?: boolean) {\n super.updateMatrixWorld(force)\n if (this.center) {\n const lastRenderAreaItem = localToWorld(this, this.center).toArray().join(',')\n if (lastRenderAreaItem !== this.lastRenderAreaItem) {\n this.updateAreaItems()\n this.lastRenderAreaItem = lastRenderAreaItem\n }\n }\n }\n\n public setStyle(params: Partial<ColoredMeshStyle>): void {\n this._paramsStyle = { ...this._paramsStyle, ...params }\n super.setStyle(this._paramsStyle)\n\n const occlusionVisibility = this._paramsStyle.occlusionVisibility ?? true\n if (this.areaDom) this.areaDom.intersectCheck = !occlusionVisibility\n\n this.updateAreaItems()\n }\n\n public setPoints(points: AnyPositions, config?: { checkLinesIntersect?: boolean }): void {\n const vectors = points.map(anyPositionToVector3)\n this.points = vectors\n\n this.geometry = generatePolygonGeometry(this.points, { checkLinesIntersect: config?.checkLinesIntersect ?? true }) ?? blankGeometry\n\n this.planeHelperNeedUpdate = true\n this.geometryInfoNeedUpdate = true\n\n this.updateAreaItems()\n }\n\n /**\n * @description: 获取一个点投影在当前平面上的点\n */\n public projectPoint(point: THREE.Vector3) {\n if (!point) return point\n\n if (this.planeHelperNeedUpdate) this.updatePlaneHelper()\n\n return this.planeHelper ? this.planeHelper.projectPoint(point, new THREE.Vector3()) : point\n }\n\n public _onAdded = () => {\n if (!this.areaDom) this.updateAreaItems()\n }\n\n public _onRemoved = () => {\n this.areaDom?.destroy()\n this.areaDom = undefined\n }\n\n public _onShowed = () => {\n if (this.areaDom) this.areaDom.container.style.display = 'block'\n }\n\n public _onHidden = () => {\n if (this.areaDom) this.areaDom.container.style.display = 'none'\n }\n\n private updatePlaneHelper() {\n if (this.points.length >= 3) {\n this.planeHelper = new THREE.Plane().setFromCoplanarPoints(this.points[0], this.points[1], this.points[2])\n } else {\n this.planeHelper = null\n }\n this.planeHelperNeedUpdate = false\n }\n\n private updateAreaItems() {\n const clear = () => {\n this.areaDom?.destroy()\n this.areaDom = undefined\n }\n if (!this._paramsStyle.lengthEnable) return clear()\n if (!this.geometryInfo) return clear()\n\n if (!this.five) return console.error('Five not found')\n\n this.areaDom =\n this.areaDom ??\n (() => {\n const tag = new LightTag(this.five)\n const occlusionVisibility = this._paramsStyle.occlusionVisibility ?? true\n tag.intersectCheck = !occlusionVisibility\n tag.simulate3D = true\n return tag\n })()\n\n this.areaDom.setPosition(this.center)\n const areaString = transformUnitSquare(this.geometryInfo.area, this._paramsStyle.lengthUnit)\n\n if (!areaString) {\n this.areaDom.container.innerHTML = ''\n } else {\n this.areaDom.container.innerHTML = getLengthHTML(areaString, {\n style: `color: #FFFFFF; background: #3366FF`,\n })\n }\n }\n}\n"],"mappings":";;;;;;;AAIA,IAAMe,IAAS,IAAIC,EAAQ,GACrBC,IAAa,IAAID,EAAQ,GACzBE,IAAM,IAAIF,EAAQ,GAClBG,IAAe,IAAIH,EAAQ,GAC3BI,IAAS,IAAIJ,EAAQ,GACrBK,IAAQ,IAAIC,EAAM,GAGXC,IAAb,cAAiCC,EAAO;CACH;CAAnC,YAAmB,GAAmD;EAAnC,AAEjC,MAAMC,CAA0C,GAFf,KAAA,gBAAAA;CAGnC;CAEA,QAAwB,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,EADO,KAAK,aAAa,uBAAuB,KAErE,EAAI,aAAa,IACVsE;EACT,EAAA,CAAG,GAEL,KAAK,QAAQ,YAAY,KAAK,MAAM;EACpC,IAAMC,IAAapE,EAAoB,KAAK,aAAa,MAAM,KAAK,aAAa,UAAU;EAE3F,AAAKoE,IAGH,KAAK,QAAQ,UAAU,YAAYnE,EAAcmE,GAAY,EAC3D,OAAO,sCACT,CAAC,IAJD,KAAK,QAAQ,UAAU,YAAY;CAMvC;AACF"}
|
|
@@ -3,7 +3,7 @@ import { i } from "./util-vGeVT4oo.js";
|
|
|
3
3
|
import { n as a } from "./getNormal-BatLuzsS.js";
|
|
4
4
|
import { i as o } from "./resizeObserver-AY-35us4.js";
|
|
5
5
|
import { r as s } from "./Line2-CDxLMjGj.js";
|
|
6
|
-
import { n as c, r as l, t as u } from "./Polygon-
|
|
6
|
+
import { n as c, r as l, t as u } from "./Polygon-BXajWnCj.js";
|
|
7
7
|
import * as d from "three/webgpu";
|
|
8
8
|
import { AnimationFrameLoop as f } from "@realsee/five-webgpu";
|
|
9
9
|
//#region src/shared-utils/three/closeVectors.ts
|
|
@@ -481,4 +481,4 @@ var b = class extends d.BufferGeometry {
|
|
|
481
481
|
//#endregion
|
|
482
482
|
export { g as i, _ as n, h as r, C as t };
|
|
483
483
|
|
|
484
|
-
//# sourceMappingURL=Prism-
|
|
484
|
+
//# sourceMappingURL=Prism-BwjQPOyR.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Prism-CJlyAEAU.js","names":["LineMesh","triangleArea","earcut3D","triangleCenter","IObject3D","intersectWithoutLine","LineGeometry","ColoredMesh","LineWithDotsMesh","PolygonMesh","THREE","closeVectors","v","vectors","last","first","PolylineBaseMesh","line","style","params","withDots","points","anyPositionToVector3","nextPoint","index","mesh","point","PolylineMesh","PolylineWithDotsMesh","PolygonWithEdgeMesh","child","raycaster","intersects","convexPolygonVertexIndex","_vectors","i","concavePolygonVertexIndex","PrismGeometry","b","t","bottemIndex","o","topVectors","topIndex","PrismAnimationGeometry","bottomVectors","offset","positions","uvs","indices","groups","indexOffset","nextI","group","minX","maxX","minZ","maxZ","sizeX","sizeZ","vector","u","startIndex","faceIndices","bottom1","bottom2","top2","top1","PrismAnimationMaterial","color","sourceUv","radius","edge","edgeBoost","intensity","normalizedY","sweep","PrismMesh","p","bottomPositions","topPosition","triangles","area","bottomCenter","p1","p2","p3","triArea","triCenter","center","key","five","id","animatedBoxMesh","material","currentTime","remove","AnimationFrameLoop","deltaTime","progress","_progress","resolve","animation","targetId","easeInAnimation","edgeMeshCount","originalPrismMeshOpacity","interval","callback","min","max","pos","topPositions","originalGeometry","originalBottomPositions","originalTopPosition","animationGeometry","minWorld","maxWorld"],"sources":["../../src/shared-utils/three/closeVectors.ts","../../src/Sculpt/Meshes/Polyline.ts","../../src/Sculpt/Meshes/PolygonWithEdge.ts","../../src/shared-utils/three/core/polygonVertex.ts","../../src/shared-utils/three/core/PrismGeometry.ts","../../src/shared-utils/three/core/PrismAnimationGeometry.ts","../../src/Sculpt/Meshes/Prism.ts"],"sourcesContent":["import type * as THREE from 'three/webgpu'\n\nexport default function closeVectors(vectors: THREE.Vector3[]) {\n const v: THREE.Vector3[] = [...vectors]\n if (vectors.length < 3) return vectors\n const last = vectors[vectors.length - 1]\n const first = vectors[0]\n if (!last.equals(first)) v.push(first)\n return v\n}\n","import { anyPositionToVector3, type AnyPositions } from '../../shared-utils/positionToVector3'\nimport { IObject3D } from '../../shared-utils/three/IObject3D'\nimport { notNil } from '../../shared-utils'\nimport { LineWithDotsMesh } from './LineWithDots'\nimport type { LineMeshStyle } from './Line'\nimport type { PointsData } from '../utils/data'\nimport * as THREE from 'three/webgpu'\nimport closeVectors from '../../shared-utils/three/closeVectors'\nimport { removeAllTag } from '../utils/removeAllTag'\n\nexport type PolylineStyle = LineMeshStyle\n\nexport type PolylineData = PointsData\n\nexport abstract class PolylineBaseMesh extends IObject3D {\n public name = 'PolylineBaseMesh'\n\n public get style() {\n return {\n lineColor: this.lineColor,\n lineWidth: this.lineWidth,\n opacity: this.opacity,\n dashed: this.dashed,\n occlusionVisibility: this.occlusionVisibility,\n occlusionMode: this.occlusionMode,\n lengthEnable: this.paramsStyle?.lengthEnable,\n }\n }\n\n public get opacity() {\n return this.lines[0]?.lineOpacity ?? this.paramsStyle?.lineOpacity\n }\n\n public get lineColor() {\n return this.lines[0]?.color ?? (this.paramsStyle?.lineColor ? new THREE.Color(this.paramsStyle.lineColor) : undefined)\n }\n\n public get lineWidth() {\n return this.lines[0]?.lineWidth ?? this.paramsStyle?.lineWidth\n }\n\n public get dashed() {\n return this.lines[0]?.dashed ?? this.paramsStyle?.dashed\n }\n\n public get occlusionVisibility() {\n return this.lines[0]?.occlusionVisibility ?? this.paramsStyle?.occlusionVisibility\n }\n\n public get occlusionMode() {\n return this.lines[0]?.occlusionMode ?? this.paramsStyle?.occlusionMode\n }\n\n public get points() {\n return this.lines\n .map((line) => line.points[0])\n .concat(this.lines?.[this.lines?.length - 1]?.points[1])\n .filter(Boolean)\n }\n public lines: Array<LineWithDotsMesh> = []\n\n private withDots: boolean\n\n private paramsStyle: Partial<PolylineStyle>\n\n public constructor(params?: Partial<PolylineStyle & PolylineData & { withDots: boolean }>) {\n super()\n const { withDots, points, ...style } = params\n this.withDots = withDots ?? true\n if (points) this.setPoints(points)\n if (style) this.setStyle(style)\n }\n\n public setPoints(points: AnyPositions, params = { closed: false }) {\n let vectors = points.map(anyPositionToVector3)\n\n if (params.closed) vectors = closeVectors(vectors)\n\n vectors.forEach((point, index) => {\n const nextPoint = vectors[index + 1]\n if (index !== 0 && nextPoint === undefined) return\n const line =\n this.lines[index] ??\n (() => {\n const mesh = new LineWithDotsMesh({\n ...this.style,\n pointVisibility: this.withDots ? { startPoint: index === 0, endPoint: true } : false,\n })\n this.lines[index] = mesh\n this.add(mesh)\n return mesh\n })()\n\n line.setStyle(this.style)\n line.setPoints([point, nextPoint])\n })\n\n if (vectors.length === 0) {\n this.lines.forEach((line) => line.removeFromParent())\n this.lines = []\n } else if (vectors.length === 1) {\n // 跳过特殊情况:一个点,一条线\n } else {\n if (this.lines.length > vectors.length - 1) {\n this.lines.splice(vectors.length - 1).forEach((line) => line.removeFromParent())\n }\n }\n }\n\n public setStyle(style: Partial<PolylineStyle>) {\n this.paramsStyle = { ...this.paramsStyle, ...style }\n this.lines.forEach((line) => line.setStyle(this.paramsStyle))\n }\n\n public highlight() {\n this.lines.forEach((line) => line.highlight())\n }\n\n public unhighlight() {\n this.lines.forEach((line) => line.unhighlight())\n }\n}\n\nexport class PolylineMesh extends PolylineBaseMesh {\n public name = 'PolylineMesh'\n public constructor(...params: ConstructorParameters<typeof PolylineBaseMesh>) {\n super({ ...params[0], withDots: false })\n }\n}\n\nexport class PolylineWithDotsMesh extends PolylineBaseMesh {\n public name = 'PolylineWithDotsMesh'\n public constructor(...params: ConstructorParameters<typeof PolylineBaseMesh>) {\n super({ ...params[0], withDots: true })\n }\n}\n","import type * as THREE from 'three/webgpu'\nimport type { AnyPositions } from '../../shared-utils/positionToVector3'\nimport { PolylineMesh } from './Polyline'\nimport type { LineStyle } from '../typings/style'\nimport { PolygonMesh, type PolygonData, type PolygonStyle } from './Polygon'\nimport { intersectWithoutLine } from '../../shared-utils/three/core/Raycaster'\n\nexport type PolygonWithEdgeMeshStyle = PolygonStyle & LineStyle\n\n/**\n * @description: 带边线的多边形\n */\nexport class PolygonWithEdgeMesh extends PolygonMesh {\n public name = 'PolygonWithEdgeMesh'\n\n public get style() {\n return {\n ...super.style,\n lineWidth: this.lineWidth,\n lineColor: this.lineColor,\n }\n }\n\n public get lineWidth() {\n return this.line.lineWidth\n }\n\n public get lineColor() {\n return this.line.lineColor\n }\n\n public line: PolylineMesh = new PolylineMesh()\n\n public constructor(params?: Partial<PolygonWithEdgeMeshStyle & PolygonData>) {\n const { points, ...style } = params ?? {}\n super()\n\n if (points) this.setPoints(points)\n if (style) this.setStyle(style)\n }\n\n public raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection[]) {\n this.children.forEach((child) => {\n intersectWithoutLine(child, raycaster, intersects, true)\n })\n return false\n }\n\n public setPoints(points: AnyPositions, params?: { closed?: boolean; checkLinesIntersect?: boolean }) {\n super.setPoints(points, { closed: true, ...params })\n if (this.points) {\n this.line.setPoints(this.points, { closed: true, ...params })\n this.addIfNotExists(this.line)\n }\n }\n\n public setStyle(style: Partial<PolygonWithEdgeMeshStyle>) {\n super.setStyle(style)\n // 特别处理lineOpacity属性,确保传递给line\n if (style.lineOpacity !== undefined) {\n this.line.setStyle({\n ...style,\n // 强制设置line的lineOpacity\n lineOpacity: style.lineOpacity,\n })\n } else {\n this.line.setStyle(style)\n }\n // 确保更新渲染\n this.needsRender = true\n }\n\n public highlight() {\n super.highlight()\n this.line.highlight()\n }\n\n public unhighlight() {\n super.unhighlight()\n this.line.unhighlight()\n }\n}\n","import * as THREE from 'three/webgpu'\nimport earcut3D from '../earcut3D'\n\n/**\n * @description 凸多边形的顶点\n */\nexport function convexPolygonVertexIndex(_vectors: number[][]) {\n const vectors = [..._vectors]\n const index: number[] = []\n\n // 底面索引\n for (let i = 0; i < vectors.length - 2; i++) {\n index.push(0, i + 1, i + 2)\n }\n\n return index\n}\n\n/**\n * @description 凹多边形的顶点\n */\nexport function concavePolygonVertexIndex(vectors: number[][]) {\n const points = vectors.map((v) => new THREE.Vector3(v[0], v[1], v[2]))\n\n const index = earcut3D(points)\n\n return index\n}\n","import * as THREE from 'three/webgpu'\nimport { concavePolygonVertexIndex, convexPolygonVertexIndex } from './polygonVertex'\n\nexport class PrismGeometry extends THREE.BufferGeometry {\n public bottomPositions: number[][] = []\n public topPosition: number[] = []\n\n private _type: 'Concave' | 'Convex' = 'Concave'\n\n public constructor(params?: { bottomPositions?: number[][]; topPosition?: number[]; type?: 'Concave' | 'Convex' }) {\n super()\n if (params) this.setPosition(params)\n }\n\n /**\n * @description 设置底面和顶面的位置\n * @param params.bottomPositions 底面多边形的有序顶点,顺时针或逆时针均可\n * @param params.topPosition 底面多边形的第一个点对应的顶面的顶点\n * @param params.type 棱柱的类型,凹多边形(Concave)或凸多边形(Convex),默认为凹多边形。如果可以确定是凸多边形,建议设置为凸多边形,性能更好\n */\n public setPosition(params: { bottomPositions?: number[][]; topPosition?: number[]; type?: 'Concave' | 'Convex' }) {\n const b = params.bottomPositions ?? this.bottomPositions\n const t = params.topPosition ?? this.topPosition\n this._type = params.type ?? this._type\n\n this.bottomPositions = b\n this.topPosition = t\n\n if (!b || b.length < 3) {\n console.error('PrismGeometry: Invalid parameters', b, t, params)\n this.bottomPositions = []\n this.setAttribute('position', new THREE.BufferAttribute(new Float32Array([]), 3))\n return\n }\n\n const index: number[] = []\n const vectors: number[][] = []\n\n // 底面顶点\n vectors.push(...b)\n\n // 检查头尾点是否相等,相等则删除\n if (vectors[0][0] === vectors.at(-1)[0] && vectors[0][1] === vectors.at(-1)[1] && vectors[0][2] === vectors.at(-1)[2]) {\n vectors.length -= 1\n }\n\n const bottemIndex = this._type === 'Concave' ? concavePolygonVertexIndex(vectors) : convexPolygonVertexIndex(vectors)\n index.push(...bottemIndex)\n\n if (t && t.length === 3) {\n const o = [t[0] - b[0][0], t[1] - b[0][1], t[2] - b[0][2]] // offset\n\n // 顶面顶点\n const topVectors = vectors.map((v) => [v[0] + o[0], v[1] + o[1], v[2] + o[2]])\n vectors.push(...topVectors)\n\n // 顶面索引\n const topIndex = index.map((i) => i + vectors.length / 2)\n index.push(...topIndex)\n\n // 侧面索引\n for (let i = 0; i < vectors.length / 2 - 1; i++) {\n index.push(i, i + 1, i + vectors.length / 2)\n index.push(i + 1, i + vectors.length / 2 + 1, i + vectors.length / 2)\n }\n\n // 闭合侧面\n index.push(0, vectors.length / 2, vectors.length / 2 - 1)\n index.push(vectors.length / 2, vectors.length - 1, vectors.length / 2 - 1)\n }\n\n this.setAttribute('position', new THREE.Float32BufferAttribute(vectors.flat(), 3))\n this.setIndex(index)\n\n this.computeBoundingSphere()\n }\n}\n","import * as THREE from 'three/webgpu'\nimport { concavePolygonVertexIndex, convexPolygonVertexIndex } from './polygonVertex'\n\nexport class PrismAnimationGeometry extends THREE.BufferGeometry {\n public bottomPositions: number[][] = []\n public topPosition: number[] = []\n public faceCount: number = 0\n\n private _type: 'Concave' | 'Convex' = 'Concave'\n\n public constructor(params?: { bottomPositions?: number[][]; topPosition?: number[]; type?: 'Concave' | 'Convex' }) {\n super()\n if (params) this.setPosition(params)\n }\n\n /**\n * 设置底面和顶面的位置,创建类似BoxGeometry的多面结构\n */\n public setPosition(params: { bottomPositions?: number[][]; topPosition?: number[]; type?: 'Concave' | 'Convex' }) {\n const b = params.bottomPositions ?? this.bottomPositions\n const t = params.topPosition ?? this.topPosition\n this._type = params.type ?? this._type\n\n this.bottomPositions = b\n this.topPosition = t\n\n if (!b || b.length < 3 || !t || t.length !== 3) {\n console.error('PrismAnimationGeometry: Invalid parameters', b, t, params)\n return\n }\n\n // 检查头尾点是否相等,相等则删除\n const bottomVectors = [...b]\n if (bottomVectors[0][0] === bottomVectors.at(-1)[0] && \n bottomVectors[0][1] === bottomVectors.at(-1)[1] && \n bottomVectors[0][2] === bottomVectors.at(-1)[2]) {\n bottomVectors.length -= 1\n }\n\n const offset = [t[0] - b[0][0], t[1] - b[0][1], t[2] - b[0][2]]\n const topVectors = bottomVectors.map(v => [v[0] + offset[0], v[1] + offset[1], v[2] + offset[2]])\n\n // 计算面数:底面 + 顶面 + 侧面数\n this.faceCount = 2 + bottomVectors.length\n\n const positions: number[] = []\n const uvs: number[] = []\n const indices: number[] = []\n const groups: { start: number; count: number; materialIndex: number }[] = []\n\n let indexOffset = 0\n\n // 1. 底面\n this.addBottomFace(bottomVectors, positions, uvs, indices, indexOffset, groups, 0)\n indexOffset += this.getBottomFaceVertexCount(bottomVectors)\n\n // 2. 顶面\n this.addTopFace(topVectors, positions, uvs, indices, indexOffset, groups, 1)\n indexOffset += this.getTopFaceVertexCount(topVectors)\n\n // 3. 侧面\n for (let i = 0; i < bottomVectors.length; i++) {\n const nextI = (i + 1) % bottomVectors.length\n this.addSideFace(\n bottomVectors[i], bottomVectors[nextI], \n topVectors[i], topVectors[nextI],\n positions, uvs, indices, indexOffset, groups, 2 + i\n )\n indexOffset += 4 // 每个侧面4个顶点\n }\n\n this.setAttribute('position', new THREE.Float32BufferAttribute(positions, 3))\n this.setAttribute('uv', new THREE.Float32BufferAttribute(uvs, 2))\n this.setIndex(indices)\n\n // 设置材质组\n this.clearGroups()\n groups.forEach(group => {\n this.addGroup(group.start, group.count, group.materialIndex)\n })\n\n this.computeBoundingSphere()\n\n console.log('PrismAnimationGeometry UV debug:', {\n totalUVs: uvs.length / 2,\n totalPositions: positions.length / 3,\n faceCount: this.faceCount,\n uvSample: uvs.slice(0, 20)\n })\n }\n\n private addBottomFace(\n vectors: number[][], \n positions: number[], \n uvs: number[], \n indices: number[], \n indexOffset: number,\n groups: { start: number; count: number; materialIndex: number }[],\n materialIndex: number\n ) {\n // 计算底面边界框用于UV映射\n const minX = Math.min(...vectors.map(v => v[0]))\n const maxX = Math.max(...vectors.map(v => v[0]))\n const minZ = Math.min(...vectors.map(v => v[2]))\n const maxZ = Math.max(...vectors.map(v => v[2]))\n const sizeX = maxX - minX || 1\n const sizeZ = maxZ - minZ || 1\n\n // 添加顶点和UV\n for (const vector of vectors) {\n positions.push(vector[0], vector[1], vector[2])\n const u = (vector[0] - minX) / sizeX\n const v = (vector[2] - minZ) / sizeZ\n uvs.push(u, v)\n }\n\n // 添加索引\n const startIndex = indices.length\n const faceIndices = this._type === 'Concave' ? \n concavePolygonVertexIndex(vectors) : \n convexPolygonVertexIndex(vectors)\n \n for (const index of faceIndices) {\n indices.push(index + indexOffset)\n }\n\n groups.push({\n start: startIndex,\n count: indices.length - startIndex,\n materialIndex\n })\n }\n\n private addTopFace(\n vectors: number[][], \n positions: number[], \n uvs: number[], \n indices: number[], \n indexOffset: number,\n groups: { start: number; count: number; materialIndex: number }[],\n materialIndex: number\n ) {\n // 计算顶面边界框用于UV映射\n const minX = Math.min(...vectors.map(v => v[0]))\n const maxX = Math.max(...vectors.map(v => v[0]))\n const minZ = Math.min(...vectors.map(v => v[2]))\n const maxZ = Math.max(...vectors.map(v => v[2]))\n const sizeX = maxX - minX || 1\n const sizeZ = maxZ - minZ || 1\n\n // 添加顶点和UV\n for (const vector of vectors) {\n positions.push(vector[0], vector[1], vector[2])\n const u = (vector[0] - minX) / sizeX\n const v = (vector[2] - minZ) / sizeZ\n uvs.push(u, v)\n }\n\n // 添加索引(顶面需要反向,因为法向量朝上)\n const startIndex = indices.length\n const faceIndices = this._type === 'Concave' ? \n concavePolygonVertexIndex(vectors) : \n convexPolygonVertexIndex(vectors)\n \n // 反向索引以确保正确的法向量\n for (let i = faceIndices.length - 1; i >= 0; i--) {\n indices.push(faceIndices[i] + indexOffset)\n }\n\n groups.push({\n start: startIndex,\n count: indices.length - startIndex,\n materialIndex\n })\n }\n\n private addSideFace(\n bottom1: number[], bottom2: number[],\n top1: number[], top2: number[],\n positions: number[], \n uvs: number[], \n indices: number[], \n indexOffset: number,\n groups: { start: number; count: number; materialIndex: number }[],\n materialIndex: number\n ) {\n // 添加四个顶点:bottom1, bottom2, top2, top1\n positions.push(\n bottom1[0], bottom1[1], bottom1[2], // 0\n bottom2[0], bottom2[1], bottom2[2], // 1\n top2[0], top2[1], top2[2], // 2\n top1[0], top1[1], top1[2] // 3\n )\n\n // 添加UV坐标(每个侧面都是0-1的矩形)\n // 顶点顺序:bottom1, bottom2, top2, top1\n // UV应该从底部到顶部:(0,0) -> (1,0) -> (1,1) -> (0,1)\n uvs.push(\n 0, 0, // bottom1 (左下)\n 1, 0, // bottom2 (右下) \n 1, 1, // top2 (右上)\n 0, 1 // top1 (左上)\n )\n\n // 添加索引(两个三角形组成四边形)\n const startIndex = indices.length\n indices.push(\n indexOffset + 0, indexOffset + 1, indexOffset + 2, // 第一个三角形\n indexOffset + 0, indexOffset + 2, indexOffset + 3 // 第二个三角形\n )\n\n groups.push({\n start: startIndex,\n count: 6, // 两个三角形,6个索引\n materialIndex\n })\n }\n\n private getBottomFaceVertexCount(vectors: number[][]): number {\n return vectors.length\n }\n\n private getTopFaceVertexCount(vectors: number[][]): number {\n return vectors.length\n }\n}","import { IObject3D } from '../../shared-utils/three/IObject3D'\nimport { anyPositionToVector3, type AnyPosition } from '../../shared-utils/positionToVector3'\nimport type { AreaData } from './Area'\nimport * as THREE from 'three/webgpu'\nimport type { LineStyle } from '../typings/style'\nimport type { ColoredMeshStyle } from '../utils/three/ColoredMesh'\nimport { intersectWithoutLine } from '../../shared-utils/three/core/Raycaster'\nimport ColoredMesh from '../utils/three/ColoredMesh'\nimport { PrismGeometry } from '../../shared-utils/three/core/PrismGeometry'\nimport { PrismAnimationGeometry } from '../../shared-utils/three/core/PrismAnimationGeometry'\nimport { triangleArea, triangleCenter } from '../../shared-utils/three/geometryUtil'\nimport { LineMesh } from './Line'\nimport { LineGeometry } from '../../shared-utils/three/core/LineGeometry'\nimport { AnimationFrameLoop, type Five } from '@realsee/five-webgpu'\n\nclass PrismAnimationMaterial extends THREE.MeshBasicNodeMaterial {\n public readonly colorValue = THREE.TSL.uniform(new THREE.Color())\n public readonly sizeValue = THREE.TSL.uniform(new THREE.Vector3(1, 1, 1))\n public readonly minPosition = THREE.TSL.uniform(new THREE.Vector3())\n public readonly progressValue = THREE.TSL.uniform(0.5)\n\n public constructor(color: string) {\n super({ depthTest: false, side: THREE.DoubleSide, transparent: true })\n this.colorValue.value.set(color)\n\n const sourceUv = THREE.TSL.uv()\n const radius = THREE.TSL.length(sourceUv).mul(0.3).add(0.1)\n const edge = sourceUv.x.lessThan(0.003)\n .or(sourceUv.x.greaterThan(0.997))\n .or(sourceUv.y.lessThan(0.003))\n .or(sourceUv.y.greaterThan(0.997))\n const edgeBoost = THREE.TSL.float(1).sub(\n THREE.TSL.min(THREE.TSL.abs(sourceUv.x.sub(0.5)), THREE.TSL.abs(sourceUv.y.sub(0.5))).mul(2),\n )\n const intensity = radius.add(THREE.TSL.select(edge, edgeBoost, 0))\n const normalizedY = THREE.TSL.positionWorld.y.sub(this.minPosition.y).div(this.sizeValue.y)\n const sweep = THREE.TSL.clamp(\n THREE.TSL.float(1).sub(THREE.TSL.abs(normalizedY.sub(this.progressValue)).div(0.3)),\n 0,\n 1,\n ).pow(2)\n\n this.colorNode = this.colorValue\n this.opacityNode = THREE.TSL.clamp(intensity.mul(sweep).mul(1.5), 0, 1)\n this.polygonOffset = true\n this.polygonOffsetFactor = 1\n this.polygonOffsetUnits = 1\n }\n}\n\nexport type PrismStyle = ColoredMeshStyle & LineStyle\n\nexport interface PrismData extends AreaData {\n heightPoint: AnyPosition\n}\n\n/**\n * @description: 多棱柱\n */\nexport class PrismMesh extends IObject3D {\n public name = 'PrismMesh'\n\n private five?: Five\n private animatedBoxMesh?: THREE.Mesh<PrismAnimationGeometry, PrismAnimationMaterial>\n private activeAnimations: Map<string | number, { animatedBoxMesh: THREE.Mesh<PrismAnimationGeometry, PrismAnimationMaterial>; remove: () => void; resolve: () => void }> = new Map()\n private activeEaseInAnimations: Map<string | number, { interval: NodeJS.Timeout; model: PrismMesh }> = new Map()\n\n public get topPosition() {\n return new THREE.Vector3().fromArray(this.prismMesh.geometry.topPosition)\n }\n\n public get bottomPositions() {\n return this.prismMesh.geometry.bottomPositions.map((p) => new THREE.Vector3().fromArray(p))\n }\n\n public get topPositions() {\n const offset = this.bottomPositions[0].clone().sub(this.topPosition)\n return this.bottomPositions.map((p) => p.clone().sub(offset))\n }\n\n public get style() {\n return {\n color: this.color,\n lineColor: this.lineColor,\n lineWidth: this.lineWidth,\n opacity: this.opacity,\n occlusionVisibility: this.occlusionVisibility,\n occlusionMode: this.occlusionMode,\n }\n }\n\n public get opacity() {\n return this.prismMesh.opacity\n }\n\n public get occlusionVisibility() {\n return this.prismMesh.occlusionVisibility\n }\n\n public get occlusionMode() {\n return this.prismMesh.occlusionMode\n }\n\n public get localCenter() {\n return this.geometryInfo.center.clone() ?? new THREE.Vector3(9999, 9999, 9999)\n }\n\n public get geometryInfo() {\n if (this.geometryInfoNeedUpdate) {\n this.geometryInfoNeedUpdate = false\n\n const bottomPositions = this.prismMesh.geometry.bottomPositions\n const topPosition = this.prismMesh.geometry.topPosition\n\n if (!bottomPositions || bottomPositions.length < 3 || !topPosition) {\n this._geometryInfoCache = undefined\n return undefined\n }\n\n const triangles = bottomPositions\n .map((_, i) => {\n if (i >= bottomPositions.length - 2) return null\n return [\n new THREE.Vector3().fromArray(bottomPositions[0]),\n new THREE.Vector3().fromArray(bottomPositions[i + 1]),\n new THREE.Vector3().fromArray(bottomPositions[i + 2]),\n ]\n })\n .filter(Boolean)\n\n if (triangles.length === 0) {\n this._geometryInfoCache = undefined\n return undefined\n }\n\n let area = 0\n let bottomCenter = new THREE.Vector3()\n\n for (const [p1, p2, p3] of triangles) {\n const triArea = triangleArea(p1, p2, p3)\n const triCenter = triangleCenter(p1, p2, p3, triArea)\n\n area += triArea\n bottomCenter.add(triCenter)\n }\n\n bottomCenter = bottomCenter.divideScalar(area)\n\n const offset = new THREE.Vector3().fromArray(topPosition).sub(new THREE.Vector3().fromArray(bottomPositions[0]))\n\n const center = bottomCenter.clone().add(offset.divideScalar(2))\n\n this._geometryInfoCache = { center }\n }\n return this._geometryInfoCache\n }\n\n public get worldCenter(): THREE.Vector3 {\n this.updateMatrixWorld()\n return this.localToWorld(this.localCenter)\n }\n\n public get color() {\n return this.prismMesh.color\n }\n\n public get lineWidth() {\n return this.edgeMesh.style.lineWidth\n }\n\n public get lineColor() {\n return this.edgeMesh.color\n }\n\n protected _geometryInfoCache?: { center: THREE.Vector3 }\n\n protected geometryInfoNeedUpdate = true\n\n public edgeMesh: LineMesh = new LineMesh()\n\n public prismMesh: ColoredMesh & { geometry: PrismGeometry } = new ColoredMesh() as ColoredMesh & { geometry: PrismGeometry }\n\n public paramStyle: Partial<PrismStyle>\n\n public constructor(params?: Partial<PrismData & PrismStyle & { five?: Five }>) {\n super()\n\n this.five = (params as any)?.five\n this.prismMesh.name = 'PrismMesh'\n this.prismMesh.geometry = new PrismGeometry()\n\n this.edgeMesh.name = 'EdgeMesh'\n\n this.addIfNotExists(this.prismMesh, this.edgeMesh)\n\n if (params && Object.keys(params).some((key) => key !== 'five')) {\n this.setPoints(params)\n }\n\n this.setStyle(params)\n }\n\n public setStyle(params: Partial<PrismStyle> = {}) {\n this.paramStyle = { ...this.paramStyle, ...params }\n this.prismMesh.setStyle(this.paramStyle)\n this.edgeMesh.setStyle(this.paramStyle)\n }\n\n /**\n * Check if the prism is a box (has 4 bottom positions)\n */\n public isBox(): boolean {\n const bottomPositions = this.prismMesh.geometry.bottomPositions\n return bottomPositions && bottomPositions.length === 4\n }\n\n public setPoints(params: Partial<PrismData>) {\n this.prismMesh.geometry.setPosition({\n bottomPositions: params.points?.map(anyPositionToVector3).map((v) => v.toArray()),\n topPosition: params.heightPoint ? anyPositionToVector3(params.heightPoint).toArray() : undefined,\n })\n this.edgeMesh.geometry = new LineGeometry().fromEdgesGeometry(new THREE.EdgesGeometry(this.prismMesh.geometry))\n this.geometryInfoNeedUpdate = true\n }\n\n public highlight() {\n this.prismMesh.highlight()\n }\n\n public unhighlight() {\n this.prismMesh.unhighlight()\n }\n\n public raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection[]) {\n this.children.forEach((child) => intersectWithoutLine(child, raycaster, intersects, true))\n return false\n }\n\n /**\n * 设置Five实例\n * @param five Five实例\n */\n public setFive(five: Five): void {\n this.five = five\n }\n\n /**\n * 播放盒子上下动画\n * @param id 盒子项目ID\n * @param color 动画颜色,默认为浅蓝色 (#4DF0FF)\n * @returns Promise,动画完成时解析\n */\n public playBoxAnimation(id: string | number, color: string = '#4DF0FF'): Promise<void> {\n if (!this.five) {\n console.warn('Five instance not available for box animation')\n return Promise.resolve()\n }\n\n // 强制结束任何现有动画\n if (this.activeAnimations.has(id)) {\n this.forceFinishBoxAnimation(id)\n }\n\n return new Promise<void>((resolve) => {\n // 首先隐藏原始网格\n this.prismMesh.visible = false\n this.edgeMesh.visible = false\n\n // 创建或更新动画盒子\n const animatedBoxMesh = this.createOrUpdateAnimatedBoxMesh(color)\n\n const material = animatedBoxMesh.material\n\n const duration = 3000\n let currentTime = 0\n const remove = AnimationFrameLoop.shared.add((_, deltaTime) => {\n currentTime += deltaTime\n let progress = currentTime / duration\n if (progress > 1) {\n progress = 1\n }\n // 简化进度计算,实现往返扫光:0-1过程中,0-0.5是从底到顶,0.5-1是从顶到底\n let _progress = progress\n if (progress <= 0.5) {\n // 前半段:从底到顶 (0 -> 1)\n _progress = progress * 2\n } else {\n // 后半段:从顶到底 (1 -> 0)\n _progress = 2 - progress * 2\n }\n\n material.progressValue.value = _progress\n\n if (progress === 1) {\n remove()\n animatedBoxMesh.visible = false\n this.playEaseInAnimation(id, () => {\n this.activeAnimations.delete(id)\n resolve()\n })\n }\n this.five!.needsRender = true\n })\n\n // 存储动画以便潜在中断\n this.activeAnimations.set(id, { animatedBoxMesh, remove, resolve })\n\n // 显示动画盒子\n animatedBoxMesh.visible = true\n })\n }\n\n /**\n * 强制立即完成所有活动的盒子动画\n * @param id 可选的盒子项目ID。如果未提供,完成所有活动的盒子动画。\n */\n public forceFinishBoxAnimation(id?: string | number): void {\n if (!this.five) {\n console.warn('Five instance not available for finishing box animation')\n return\n }\n\n const targetIds = id ? [id] : Array.from(this.activeAnimations.keys())\n\n targetIds.forEach((targetId) => {\n const animation = this.activeAnimations.get(targetId)\n if (animation) {\n // 移除动画循环\n animation.remove()\n\n // 隐藏动画盒子\n if (this.animatedBoxMesh) {\n this.animatedBoxMesh.visible = false\n }\n\n // 从活动动画中移除\n this.activeAnimations.delete(targetId)\n animation.resolve()\n }\n\n // 同时检查并清除任何淡入动画\n const easeInAnimation = this.activeEaseInAnimations.get(targetId)\n if (easeInAnimation) {\n clearInterval(easeInAnimation.interval)\n this.activeEaseInAnimations.delete(targetId)\n }\n })\n\n this.showBoxFinalState()\n this.five.needsRender = true\n }\n\n /** Release the independently mounted sweep mesh when its owning marker is removed. */\n public disposeAnimation(): void {\n if (this.five) this.forceFinishBoxAnimation()\n this.animatedBoxMesh?.removeFromParent()\n this.animatedBoxMesh?.geometry.dispose()\n this.animatedBoxMesh?.material.dispose()\n this.animatedBoxMesh = undefined\n }\n\n private playEaseInAnimation(id: string | number, callback: () => void) {\n if (!this.five) return\n\n this.prismMesh.visible = true\n this.edgeMesh.visible = true\n let edgeMeshCount = 0\n const originalPrismMeshOpacity = this.prismMesh.style.opacity\n this.prismMesh.setStyle({ opacity: 0 })\n this.edgeMesh.setStyle({ lineOpacity: 0 })\n\n const interval = setInterval(() => {\n if (edgeMeshCount === 61) {\n clearInterval(interval)\n this.activeEaseInAnimations.delete(id)\n this.showBoxFinalState()\n callback()\n }\n this.edgeMesh.setStyle({ lineOpacity: edgeMeshCount / 60 })\n this.prismMesh.setStyle({ opacity: (edgeMeshCount / 60) * originalPrismMeshOpacity })\n this.five!.needsRender = true\n edgeMeshCount++\n }, 16)\n\n // 存储间隔以便潜在中断\n this.activeEaseInAnimations.set(id, { interval, model: this })\n }\n\n /**\n * 创建或更新动画盒子网格\n * @param color 动画颜色\n */\n private createOrUpdateAnimatedBoxMesh(color: string): THREE.Mesh<PrismAnimationGeometry, PrismAnimationMaterial> {\n if (!this.five) {\n throw new Error('Five instance not available')\n }\n\n // 计算边界框\n const min = new THREE.Vector3(Infinity, Infinity, Infinity)\n const max = new THREE.Vector3(-Infinity, -Infinity, -Infinity)\n\n // 获取网格位置\n const bottomPositions = this.bottomPositions\n for (const pos of bottomPositions) {\n min.min(pos)\n max.max(pos)\n }\n\n const topPositions = this.topPositions\n for (const pos of topPositions) {\n min.min(pos)\n max.max(pos)\n }\n\n const size = max.clone().sub(min)\n // 获取原始几何体的局部坐标\n const originalGeometry = this.prismMesh.geometry\n const originalBottomPositions = originalGeometry.bottomPositions\n const originalTopPosition = originalGeometry.topPosition\n\n // 如果已存在动画网格,更新几何体和材质\n if (this.animatedBoxMesh) {\n // 更新矩阵\n this.matrixWorld.decompose(this.animatedBoxMesh.position, this.animatedBoxMesh.quaternion, this.animatedBoxMesh.scale);\n this.animatedBoxMesh.updateMatrixWorld();\n this.animatedBoxMesh.matrixAutoUpdate = false\n return this.animatedBoxMesh\n }\n\n // 创建新的动画几何体\n const animationGeometry = new PrismAnimationGeometry({\n bottomPositions: originalBottomPositions,\n topPosition: originalTopPosition,\n type: 'Concave'\n })\n\n const material = new PrismAnimationMaterial(color)\n animationGeometry.clearGroups()\n this.animatedBoxMesh = new THREE.Mesh(animationGeometry, material)\n this.matrixWorld.decompose(this.animatedBoxMesh.position, this.animatedBoxMesh.quaternion, this.animatedBoxMesh.scale);\n this.animatedBoxMesh.updateMatrixWorld();\n this.animatedBoxMesh.matrixAutoUpdate = false\n\n // 添加动画回调\n this.animatedBoxMesh.onBeforeRender = () => {\n if (!animationGeometry.boundingBox) {\n animationGeometry.computeBoundingBox()\n }\n const minWorld = animationGeometry.boundingBox!.min.clone().applyMatrix4(this.animatedBoxMesh!.matrixWorld)\n const maxWorld = animationGeometry.boundingBox!.max.clone().applyMatrix4(this.animatedBoxMesh!.matrixWorld)\n material.minPosition.value.copy(minWorld)\n material.sizeValue.value.subVectors(maxWorld, minWorld)\n this.five!.needsRender = true\n }\n\n // 添加到场景\n this.five.scene.add(this.animatedBoxMesh)\n\n return this.animatedBoxMesh\n }\n\n /**\n * 显示盒子模型的最终状态(完全可见且不透明度完整)\n */\n private showBoxFinalState(): void {\n this.prismMesh.visible = true\n this.edgeMesh.visible = true\n this.prismMesh.setStyle({ opacity: this.prismMesh.style.opacity })\n this.edgeMesh.setStyle({ lineOpacity: 1 })\n }\n}\n"],"mappings":";;;;;;;;;AAEA,SAAwBW,EAAa,GAA0B;CAC7D,IAAMC,IAAqB,CAAC,GAAGC,CAAO;CACtC,IAAIA,EAAQ,SAAS,GAAG,OAAOA;CAC/B,IAAMC,IAAOD,EAAQA,EAAQ,SAAS,IAChCE,IAAQF,EAAQ;CAEtB,OADKC,EAAK,OAAOC,CAAK,KAAGH,EAAE,KAAKG,CA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","names":["LineMesh","triangleArea","earcut3D","triangleCenter","IObject3D","intersectWithoutLine","LineGeometry","ColoredMesh","LineWithDotsMesh","PolygonMesh","THREE","closeVectors","v","vectors","last","first","PolylineBaseMesh","line","style","params","withDots","points","anyPositionToVector3","nextPoint","index","mesh","point","PolylineMesh","PolylineWithDotsMesh","PolygonWithEdgeMesh","child","raycaster","intersects","convexPolygonVertexIndex","_vectors","i","concavePolygonVertexIndex","PrismGeometry","b","t","bottemIndex","o","topVectors","topIndex","PrismAnimationGeometry","bottomVectors","offset","positions","uvs","indices","groups","indexOffset","nextI","group","minX","maxX","minZ","maxZ","sizeX","sizeZ","vector","u","startIndex","faceIndices","bottom1","bottom2","top2","top1","PrismAnimationMaterial","color","sourceUv","radius","edge","edgeBoost","intensity","normalizedY","sweep","PrismMesh","p","bottomPositions","topPosition","triangles","area","bottomCenter","p1","p2","p3","triArea","triCenter","center","key","five","id","animatedBoxMesh","material","currentTime","remove","AnimationFrameLoop","deltaTime","progress","_progress","resolve","animation","targetId","easeInAnimation","edgeMeshCount","originalPrismMeshOpacity","interval","callback","min","max","pos","topPositions","originalGeometry","originalBottomPositions","originalTopPosition","animationGeometry","minWorld","maxWorld"],"sources":["../../src/shared-utils/three/closeVectors.ts","../../src/Sculpt/Meshes/Polyline.ts","../../src/Sculpt/Meshes/PolygonWithEdge.ts","../../src/shared-utils/three/core/polygonVertex.ts","../../src/shared-utils/three/core/PrismGeometry.ts","../../src/shared-utils/three/core/PrismAnimationGeometry.ts","../../src/Sculpt/Meshes/Prism.ts"],"sourcesContent":["import type * as THREE from 'three/webgpu'\n\nexport default function closeVectors(vectors: THREE.Vector3[]) {\n const v: THREE.Vector3[] = [...vectors]\n if (vectors.length < 3) return vectors\n const last = vectors[vectors.length - 1]\n const first = vectors[0]\n if (!last.equals(first)) v.push(first)\n return v\n}\n","import { anyPositionToVector3, type AnyPositions } from '../../shared-utils/positionToVector3'\nimport { IObject3D } from '../../shared-utils/three/IObject3D'\nimport { notNil } from '../../shared-utils'\nimport { LineWithDotsMesh } from './LineWithDots'\nimport type { LineMeshStyle } from './Line'\nimport type { PointsData } from '../utils/data'\nimport * as THREE from 'three/webgpu'\nimport closeVectors from '../../shared-utils/three/closeVectors'\nimport { removeAllTag } from '../utils/removeAllTag'\n\nexport type PolylineStyle = LineMeshStyle\n\nexport type PolylineData = PointsData\n\nexport abstract class PolylineBaseMesh extends IObject3D {\n public name = 'PolylineBaseMesh'\n\n public get style() {\n return {\n lineColor: this.lineColor,\n lineWidth: this.lineWidth,\n opacity: this.opacity,\n dashed: this.dashed,\n occlusionVisibility: this.occlusionVisibility,\n occlusionMode: this.occlusionMode,\n lengthEnable: this.paramsStyle?.lengthEnable,\n }\n }\n\n public get opacity() {\n return this.lines[0]?.lineOpacity ?? this.paramsStyle?.lineOpacity\n }\n\n public get lineColor() {\n return this.lines[0]?.color ?? (this.paramsStyle?.lineColor ? new THREE.Color(this.paramsStyle.lineColor) : undefined)\n }\n\n public get lineWidth() {\n return this.lines[0]?.lineWidth ?? this.paramsStyle?.lineWidth\n }\n\n public get dashed() {\n return this.lines[0]?.dashed ?? this.paramsStyle?.dashed\n }\n\n public get occlusionVisibility() {\n return this.lines[0]?.occlusionVisibility ?? this.paramsStyle?.occlusionVisibility\n }\n\n public get occlusionMode() {\n return this.lines[0]?.occlusionMode ?? this.paramsStyle?.occlusionMode\n }\n\n public get points() {\n return this.lines\n .map((line) => line.points[0])\n .concat(this.lines?.[this.lines?.length - 1]?.points[1])\n .filter(Boolean)\n }\n public lines: Array<LineWithDotsMesh> = []\n\n private withDots: boolean\n\n private paramsStyle: Partial<PolylineStyle>\n\n public constructor(params?: Partial<PolylineStyle & PolylineData & { withDots: boolean }>) {\n super()\n const { withDots, points, ...style } = params\n this.withDots = withDots ?? true\n if (points) this.setPoints(points)\n if (style) this.setStyle(style)\n }\n\n public setPoints(points: AnyPositions, params = { closed: false }) {\n let vectors = points.map(anyPositionToVector3)\n\n if (params.closed) vectors = closeVectors(vectors)\n\n vectors.forEach((point, index) => {\n const nextPoint = vectors[index + 1]\n if (index !== 0 && nextPoint === undefined) return\n const line =\n this.lines[index] ??\n (() => {\n const mesh = new LineWithDotsMesh({\n ...this.style,\n pointVisibility: this.withDots ? { startPoint: index === 0, endPoint: true } : false,\n })\n this.lines[index] = mesh\n this.add(mesh)\n return mesh\n })()\n\n line.setStyle(this.style)\n line.setPoints([point, nextPoint])\n })\n\n if (vectors.length === 0) {\n this.lines.forEach((line) => line.removeFromParent())\n this.lines = []\n } else if (vectors.length === 1) {\n // 跳过特殊情况:一个点,一条线\n } else {\n if (this.lines.length > vectors.length - 1) {\n this.lines.splice(vectors.length - 1).forEach((line) => line.removeFromParent())\n }\n }\n }\n\n public setStyle(style: Partial<PolylineStyle>) {\n this.paramsStyle = { ...this.paramsStyle, ...style }\n this.lines.forEach((line) => line.setStyle(this.paramsStyle))\n }\n\n public highlight() {\n this.lines.forEach((line) => line.highlight())\n }\n\n public unhighlight() {\n this.lines.forEach((line) => line.unhighlight())\n }\n}\n\nexport class PolylineMesh extends PolylineBaseMesh {\n public name = 'PolylineMesh'\n public constructor(...params: ConstructorParameters<typeof PolylineBaseMesh>) {\n super({ ...params[0], withDots: false })\n }\n}\n\nexport class PolylineWithDotsMesh extends PolylineBaseMesh {\n public name = 'PolylineWithDotsMesh'\n public constructor(...params: ConstructorParameters<typeof PolylineBaseMesh>) {\n super({ ...params[0], withDots: true })\n }\n}\n","import type * as THREE from 'three/webgpu'\nimport type { AnyPositions } from '../../shared-utils/positionToVector3'\nimport { PolylineMesh } from './Polyline'\nimport type { LineStyle } from '../typings/style'\nimport { PolygonMesh, type PolygonData, type PolygonStyle } from './Polygon'\nimport { intersectWithoutLine } from '../../shared-utils/three/core/Raycaster'\n\nexport type PolygonWithEdgeMeshStyle = PolygonStyle & LineStyle\n\n/**\n * @description: 带边线的多边形\n */\nexport class PolygonWithEdgeMesh extends PolygonMesh {\n public name = 'PolygonWithEdgeMesh'\n\n public get style() {\n return {\n ...super.style,\n lineWidth: this.lineWidth,\n lineColor: this.lineColor,\n }\n }\n\n public get lineWidth() {\n return this.line.lineWidth\n }\n\n public get lineColor() {\n return this.line.lineColor\n }\n\n public line: PolylineMesh = new PolylineMesh()\n\n public constructor(params?: Partial<PolygonWithEdgeMeshStyle & PolygonData>) {\n const { points, ...style } = params ?? {}\n super()\n\n if (points) this.setPoints(points)\n if (style) this.setStyle(style)\n }\n\n public raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection[]) {\n this.children.forEach((child) => {\n intersectWithoutLine(child, raycaster, intersects, true)\n })\n return false\n }\n\n public setPoints(points: AnyPositions, params?: { closed?: boolean; checkLinesIntersect?: boolean }) {\n super.setPoints(points, { closed: true, ...params })\n if (this.points) {\n this.line.setPoints(this.points, { closed: true, ...params })\n this.addIfNotExists(this.line)\n }\n }\n\n public setStyle(style: Partial<PolygonWithEdgeMeshStyle>) {\n super.setStyle(style)\n // 特别处理lineOpacity属性,确保传递给line\n if (style.lineOpacity !== undefined) {\n this.line.setStyle({\n ...style,\n // 强制设置line的lineOpacity\n lineOpacity: style.lineOpacity,\n })\n } else {\n this.line.setStyle(style)\n }\n // 确保更新渲染\n this.needsRender = true\n }\n\n public highlight() {\n super.highlight()\n this.line.highlight()\n }\n\n public unhighlight() {\n super.unhighlight()\n this.line.unhighlight()\n }\n}\n","import * as THREE from 'three/webgpu'\nimport earcut3D from '../earcut3D'\n\n/**\n * @description 凸多边形的顶点\n */\nexport function convexPolygonVertexIndex(_vectors: number[][]) {\n const vectors = [..._vectors]\n const index: number[] = []\n\n // 底面索引\n for (let i = 0; i < vectors.length - 2; i++) {\n index.push(0, i + 1, i + 2)\n }\n\n return index\n}\n\n/**\n * @description 凹多边形的顶点\n */\nexport function concavePolygonVertexIndex(vectors: number[][]) {\n const points = vectors.map((v) => new THREE.Vector3(v[0], v[1], v[2]))\n\n const index = earcut3D(points)\n\n return index\n}\n","import * as THREE from 'three/webgpu'\nimport { concavePolygonVertexIndex, convexPolygonVertexIndex } from './polygonVertex'\n\nexport class PrismGeometry extends THREE.BufferGeometry {\n public bottomPositions: number[][] = []\n public topPosition: number[] = []\n\n private _type: 'Concave' | 'Convex' = 'Concave'\n\n public constructor(params?: { bottomPositions?: number[][]; topPosition?: number[]; type?: 'Concave' | 'Convex' }) {\n super()\n if (params) this.setPosition(params)\n }\n\n /**\n * @description 设置底面和顶面的位置\n * @param params.bottomPositions 底面多边形的有序顶点,顺时针或逆时针均可\n * @param params.topPosition 底面多边形的第一个点对应的顶面的顶点\n * @param params.type 棱柱的类型,凹多边形(Concave)或凸多边形(Convex),默认为凹多边形。如果可以确定是凸多边形,建议设置为凸多边形,性能更好\n */\n public setPosition(params: { bottomPositions?: number[][]; topPosition?: number[]; type?: 'Concave' | 'Convex' }) {\n const b = params.bottomPositions ?? this.bottomPositions\n const t = params.topPosition ?? this.topPosition\n this._type = params.type ?? this._type\n\n this.bottomPositions = b\n this.topPosition = t\n\n if (!b || b.length < 3) {\n console.error('PrismGeometry: Invalid parameters', b, t, params)\n this.bottomPositions = []\n this.setAttribute('position', new THREE.BufferAttribute(new Float32Array([]), 3))\n return\n }\n\n const index: number[] = []\n const vectors: number[][] = []\n\n // 底面顶点\n vectors.push(...b)\n\n // 检查头尾点是否相等,相等则删除\n if (vectors[0][0] === vectors.at(-1)[0] && vectors[0][1] === vectors.at(-1)[1] && vectors[0][2] === vectors.at(-1)[2]) {\n vectors.length -= 1\n }\n\n const bottemIndex = this._type === 'Concave' ? concavePolygonVertexIndex(vectors) : convexPolygonVertexIndex(vectors)\n index.push(...bottemIndex)\n\n if (t && t.length === 3) {\n const o = [t[0] - b[0][0], t[1] - b[0][1], t[2] - b[0][2]] // offset\n\n // 顶面顶点\n const topVectors = vectors.map((v) => [v[0] + o[0], v[1] + o[1], v[2] + o[2]])\n vectors.push(...topVectors)\n\n // 顶面索引\n const topIndex = index.map((i) => i + vectors.length / 2)\n index.push(...topIndex)\n\n // 侧面索引\n for (let i = 0; i < vectors.length / 2 - 1; i++) {\n index.push(i, i + 1, i + vectors.length / 2)\n index.push(i + 1, i + vectors.length / 2 + 1, i + vectors.length / 2)\n }\n\n // 闭合侧面\n index.push(0, vectors.length / 2, vectors.length / 2 - 1)\n index.push(vectors.length / 2, vectors.length - 1, vectors.length / 2 - 1)\n }\n\n this.setAttribute('position', new THREE.Float32BufferAttribute(vectors.flat(), 3))\n this.setIndex(index)\n\n this.computeBoundingSphere()\n }\n}\n","import * as THREE from 'three/webgpu'\nimport { concavePolygonVertexIndex, convexPolygonVertexIndex } from './polygonVertex'\n\nexport class PrismAnimationGeometry extends THREE.BufferGeometry {\n public bottomPositions: number[][] = []\n public topPosition: number[] = []\n public faceCount: number = 0\n\n private _type: 'Concave' | 'Convex' = 'Concave'\n\n public constructor(params?: { bottomPositions?: number[][]; topPosition?: number[]; type?: 'Concave' | 'Convex' }) {\n super()\n if (params) this.setPosition(params)\n }\n\n /**\n * 设置底面和顶面的位置,创建类似BoxGeometry的多面结构\n */\n public setPosition(params: { bottomPositions?: number[][]; topPosition?: number[]; type?: 'Concave' | 'Convex' }) {\n const b = params.bottomPositions ?? this.bottomPositions\n const t = params.topPosition ?? this.topPosition\n this._type = params.type ?? this._type\n\n this.bottomPositions = b\n this.topPosition = t\n\n if (!b || b.length < 3 || !t || t.length !== 3) {\n console.error('PrismAnimationGeometry: Invalid parameters', b, t, params)\n return\n }\n\n // 检查头尾点是否相等,相等则删除\n const bottomVectors = [...b]\n if (bottomVectors[0][0] === bottomVectors.at(-1)[0] && \n bottomVectors[0][1] === bottomVectors.at(-1)[1] && \n bottomVectors[0][2] === bottomVectors.at(-1)[2]) {\n bottomVectors.length -= 1\n }\n\n const offset = [t[0] - b[0][0], t[1] - b[0][1], t[2] - b[0][2]]\n const topVectors = bottomVectors.map(v => [v[0] + offset[0], v[1] + offset[1], v[2] + offset[2]])\n\n // 计算面数:底面 + 顶面 + 侧面数\n this.faceCount = 2 + bottomVectors.length\n\n const positions: number[] = []\n const uvs: number[] = []\n const indices: number[] = []\n const groups: { start: number; count: number; materialIndex: number }[] = []\n\n let indexOffset = 0\n\n // 1. 底面\n this.addBottomFace(bottomVectors, positions, uvs, indices, indexOffset, groups, 0)\n indexOffset += this.getBottomFaceVertexCount(bottomVectors)\n\n // 2. 顶面\n this.addTopFace(topVectors, positions, uvs, indices, indexOffset, groups, 1)\n indexOffset += this.getTopFaceVertexCount(topVectors)\n\n // 3. 侧面\n for (let i = 0; i < bottomVectors.length; i++) {\n const nextI = (i + 1) % bottomVectors.length\n this.addSideFace(\n bottomVectors[i], bottomVectors[nextI], \n topVectors[i], topVectors[nextI],\n positions, uvs, indices, indexOffset, groups, 2 + i\n )\n indexOffset += 4 // 每个侧面4个顶点\n }\n\n this.setAttribute('position', new THREE.Float32BufferAttribute(positions, 3))\n this.setAttribute('uv', new THREE.Float32BufferAttribute(uvs, 2))\n this.setIndex(indices)\n\n // 设置材质组\n this.clearGroups()\n groups.forEach(group => {\n this.addGroup(group.start, group.count, group.materialIndex)\n })\n\n this.computeBoundingSphere()\n\n console.log('PrismAnimationGeometry UV debug:', {\n totalUVs: uvs.length / 2,\n totalPositions: positions.length / 3,\n faceCount: this.faceCount,\n uvSample: uvs.slice(0, 20)\n })\n }\n\n private addBottomFace(\n vectors: number[][], \n positions: number[], \n uvs: number[], \n indices: number[], \n indexOffset: number,\n groups: { start: number; count: number; materialIndex: number }[],\n materialIndex: number\n ) {\n // 计算底面边界框用于UV映射\n const minX = Math.min(...vectors.map(v => v[0]))\n const maxX = Math.max(...vectors.map(v => v[0]))\n const minZ = Math.min(...vectors.map(v => v[2]))\n const maxZ = Math.max(...vectors.map(v => v[2]))\n const sizeX = maxX - minX || 1\n const sizeZ = maxZ - minZ || 1\n\n // 添加顶点和UV\n for (const vector of vectors) {\n positions.push(vector[0], vector[1], vector[2])\n const u = (vector[0] - minX) / sizeX\n const v = (vector[2] - minZ) / sizeZ\n uvs.push(u, v)\n }\n\n // 添加索引\n const startIndex = indices.length\n const faceIndices = this._type === 'Concave' ? \n concavePolygonVertexIndex(vectors) : \n convexPolygonVertexIndex(vectors)\n \n for (const index of faceIndices) {\n indices.push(index + indexOffset)\n }\n\n groups.push({\n start: startIndex,\n count: indices.length - startIndex,\n materialIndex\n })\n }\n\n private addTopFace(\n vectors: number[][], \n positions: number[], \n uvs: number[], \n indices: number[], \n indexOffset: number,\n groups: { start: number; count: number; materialIndex: number }[],\n materialIndex: number\n ) {\n // 计算顶面边界框用于UV映射\n const minX = Math.min(...vectors.map(v => v[0]))\n const maxX = Math.max(...vectors.map(v => v[0]))\n const minZ = Math.min(...vectors.map(v => v[2]))\n const maxZ = Math.max(...vectors.map(v => v[2]))\n const sizeX = maxX - minX || 1\n const sizeZ = maxZ - minZ || 1\n\n // 添加顶点和UV\n for (const vector of vectors) {\n positions.push(vector[0], vector[1], vector[2])\n const u = (vector[0] - minX) / sizeX\n const v = (vector[2] - minZ) / sizeZ\n uvs.push(u, v)\n }\n\n // 添加索引(顶面需要反向,因为法向量朝上)\n const startIndex = indices.length\n const faceIndices = this._type === 'Concave' ? \n concavePolygonVertexIndex(vectors) : \n convexPolygonVertexIndex(vectors)\n \n // 反向索引以确保正确的法向量\n for (let i = faceIndices.length - 1; i >= 0; i--) {\n indices.push(faceIndices[i] + indexOffset)\n }\n\n groups.push({\n start: startIndex,\n count: indices.length - startIndex,\n materialIndex\n })\n }\n\n private addSideFace(\n bottom1: number[], bottom2: number[],\n top1: number[], top2: number[],\n positions: number[], \n uvs: number[], \n indices: number[], \n indexOffset: number,\n groups: { start: number; count: number; materialIndex: number }[],\n materialIndex: number\n ) {\n // 添加四个顶点:bottom1, bottom2, top2, top1\n positions.push(\n bottom1[0], bottom1[1], bottom1[2], // 0\n bottom2[0], bottom2[1], bottom2[2], // 1\n top2[0], top2[1], top2[2], // 2\n top1[0], top1[1], top1[2] // 3\n )\n\n // 添加UV坐标(每个侧面都是0-1的矩形)\n // 顶点顺序:bottom1, bottom2, top2, top1\n // UV应该从底部到顶部:(0,0) -> (1,0) -> (1,1) -> (0,1)\n uvs.push(\n 0, 0, // bottom1 (左下)\n 1, 0, // bottom2 (右下) \n 1, 1, // top2 (右上)\n 0, 1 // top1 (左上)\n )\n\n // 添加索引(两个三角形组成四边形)\n const startIndex = indices.length\n indices.push(\n indexOffset + 0, indexOffset + 1, indexOffset + 2, // 第一个三角形\n indexOffset + 0, indexOffset + 2, indexOffset + 3 // 第二个三角形\n )\n\n groups.push({\n start: startIndex,\n count: 6, // 两个三角形,6个索引\n materialIndex\n })\n }\n\n private getBottomFaceVertexCount(vectors: number[][]): number {\n return vectors.length\n }\n\n private getTopFaceVertexCount(vectors: number[][]): number {\n return vectors.length\n }\n}","import { IObject3D } from '../../shared-utils/three/IObject3D'\nimport { anyPositionToVector3, type AnyPosition } from '../../shared-utils/positionToVector3'\nimport type { AreaData } from './Area'\nimport * as THREE from 'three/webgpu'\nimport type { LineStyle } from '../typings/style'\nimport type { ColoredMeshStyle } from '../utils/three/ColoredMesh'\nimport { intersectWithoutLine } from '../../shared-utils/three/core/Raycaster'\nimport ColoredMesh from '../utils/three/ColoredMesh'\nimport { PrismGeometry } from '../../shared-utils/three/core/PrismGeometry'\nimport { PrismAnimationGeometry } from '../../shared-utils/three/core/PrismAnimationGeometry'\nimport { triangleArea, triangleCenter } from '../../shared-utils/three/geometryUtil'\nimport { LineMesh } from './Line'\nimport { LineGeometry } from '../../shared-utils/three/core/LineGeometry'\nimport { AnimationFrameLoop, type Five } from '@realsee/five-webgpu'\n\nclass PrismAnimationMaterial extends THREE.MeshBasicNodeMaterial {\n public readonly colorValue = THREE.TSL.uniform(new THREE.Color())\n public readonly sizeValue = THREE.TSL.uniform(new THREE.Vector3(1, 1, 1))\n public readonly minPosition = THREE.TSL.uniform(new THREE.Vector3())\n public readonly progressValue = THREE.TSL.uniform(0.5)\n\n public constructor(color: string) {\n super({ depthTest: false, side: THREE.DoubleSide, transparent: true })\n this.colorValue.value.set(color)\n\n const sourceUv = THREE.TSL.uv()\n const radius = THREE.TSL.length(sourceUv).mul(0.3).add(0.1)\n const edge = sourceUv.x.lessThan(0.003)\n .or(sourceUv.x.greaterThan(0.997))\n .or(sourceUv.y.lessThan(0.003))\n .or(sourceUv.y.greaterThan(0.997))\n const edgeBoost = THREE.TSL.float(1).sub(\n THREE.TSL.min(THREE.TSL.abs(sourceUv.x.sub(0.5)), THREE.TSL.abs(sourceUv.y.sub(0.5))).mul(2),\n )\n const intensity = radius.add(THREE.TSL.select(edge, edgeBoost, 0))\n const normalizedY = THREE.TSL.positionWorld.y.sub(this.minPosition.y).div(this.sizeValue.y)\n const sweep = THREE.TSL.clamp(\n THREE.TSL.float(1).sub(THREE.TSL.abs(normalizedY.sub(this.progressValue)).div(0.3)),\n 0,\n 1,\n ).pow(2)\n\n this.colorNode = this.colorValue\n this.opacityNode = THREE.TSL.clamp(intensity.mul(sweep).mul(1.5), 0, 1)\n this.polygonOffset = true\n this.polygonOffsetFactor = 1\n this.polygonOffsetUnits = 1\n }\n}\n\nexport type PrismStyle = ColoredMeshStyle & LineStyle\n\nexport interface PrismData extends AreaData {\n heightPoint: AnyPosition\n}\n\n/**\n * @description: 多棱柱\n */\nexport class PrismMesh extends IObject3D {\n public name = 'PrismMesh'\n\n private five?: Five\n private animatedBoxMesh?: THREE.Mesh<PrismAnimationGeometry, PrismAnimationMaterial>\n private activeAnimations: Map<string | number, { animatedBoxMesh: THREE.Mesh<PrismAnimationGeometry, PrismAnimationMaterial>; remove: () => void; resolve: () => void }> = new Map()\n private activeEaseInAnimations: Map<string | number, { interval: NodeJS.Timeout; model: PrismMesh }> = new Map()\n\n public get topPosition() {\n return new THREE.Vector3().fromArray(this.prismMesh.geometry.topPosition)\n }\n\n public get bottomPositions() {\n return this.prismMesh.geometry.bottomPositions.map((p) => new THREE.Vector3().fromArray(p))\n }\n\n public get topPositions() {\n const offset = this.bottomPositions[0].clone().sub(this.topPosition)\n return this.bottomPositions.map((p) => p.clone().sub(offset))\n }\n\n public get style() {\n return {\n color: this.color,\n lineColor: this.lineColor,\n lineWidth: this.lineWidth,\n opacity: this.opacity,\n occlusionVisibility: this.occlusionVisibility,\n occlusionMode: this.occlusionMode,\n }\n }\n\n public get opacity() {\n return this.prismMesh.opacity\n }\n\n public get occlusionVisibility() {\n return this.prismMesh.occlusionVisibility\n }\n\n public get occlusionMode() {\n return this.prismMesh.occlusionMode\n }\n\n public get localCenter() {\n return this.geometryInfo.center.clone() ?? new THREE.Vector3(9999, 9999, 9999)\n }\n\n public get geometryInfo() {\n if (this.geometryInfoNeedUpdate) {\n this.geometryInfoNeedUpdate = false\n\n const bottomPositions = this.prismMesh.geometry.bottomPositions\n const topPosition = this.prismMesh.geometry.topPosition\n\n if (!bottomPositions || bottomPositions.length < 3 || !topPosition) {\n this._geometryInfoCache = undefined\n return undefined\n }\n\n const triangles = bottomPositions\n .map((_, i) => {\n if (i >= bottomPositions.length - 2) return null\n return [\n new THREE.Vector3().fromArray(bottomPositions[0]),\n new THREE.Vector3().fromArray(bottomPositions[i + 1]),\n new THREE.Vector3().fromArray(bottomPositions[i + 2]),\n ]\n })\n .filter(Boolean)\n\n if (triangles.length === 0) {\n this._geometryInfoCache = undefined\n return undefined\n }\n\n let area = 0\n let bottomCenter = new THREE.Vector3()\n\n for (const [p1, p2, p3] of triangles) {\n const triArea = triangleArea(p1, p2, p3)\n const triCenter = triangleCenter(p1, p2, p3, triArea)\n\n area += triArea\n bottomCenter.add(triCenter)\n }\n\n bottomCenter = bottomCenter.divideScalar(area)\n\n const offset = new THREE.Vector3().fromArray(topPosition).sub(new THREE.Vector3().fromArray(bottomPositions[0]))\n\n const center = bottomCenter.clone().add(offset.divideScalar(2))\n\n this._geometryInfoCache = { center }\n }\n return this._geometryInfoCache\n }\n\n public get worldCenter(): THREE.Vector3 {\n this.updateMatrixWorld()\n return this.localToWorld(this.localCenter)\n }\n\n public get color() {\n return this.prismMesh.color\n }\n\n public get lineWidth() {\n return this.edgeMesh.style.lineWidth\n }\n\n public get lineColor() {\n return this.edgeMesh.color\n }\n\n protected _geometryInfoCache?: { center: THREE.Vector3 }\n\n protected geometryInfoNeedUpdate = true\n\n public edgeMesh: LineMesh = new LineMesh()\n\n public prismMesh: ColoredMesh & { geometry: PrismGeometry } = new ColoredMesh() as ColoredMesh & { geometry: PrismGeometry }\n\n public paramStyle: Partial<PrismStyle>\n\n public constructor(params?: Partial<PrismData & PrismStyle & { five?: Five }>) {\n super()\n\n this.five = (params as any)?.five\n this.prismMesh.name = 'PrismMesh'\n this.prismMesh.geometry = new PrismGeometry()\n\n this.edgeMesh.name = 'EdgeMesh'\n\n this.addIfNotExists(this.prismMesh, this.edgeMesh)\n\n if (params && Object.keys(params).some((key) => key !== 'five')) {\n this.setPoints(params)\n }\n\n this.setStyle(params)\n }\n\n public setStyle(params: Partial<PrismStyle> = {}) {\n this.paramStyle = { ...this.paramStyle, ...params }\n this.prismMesh.setStyle(this.paramStyle)\n this.edgeMesh.setStyle(this.paramStyle)\n }\n\n /**\n * Check if the prism is a box (has 4 bottom positions)\n */\n public isBox(): boolean {\n const bottomPositions = this.prismMesh.geometry.bottomPositions\n return bottomPositions && bottomPositions.length === 4\n }\n\n public setPoints(params: Partial<PrismData>) {\n this.prismMesh.geometry.setPosition({\n bottomPositions: params.points?.map(anyPositionToVector3).map((v) => v.toArray()),\n topPosition: params.heightPoint ? anyPositionToVector3(params.heightPoint).toArray() : undefined,\n })\n this.edgeMesh.geometry = new LineGeometry().fromEdgesGeometry(new THREE.EdgesGeometry(this.prismMesh.geometry))\n this.geometryInfoNeedUpdate = true\n }\n\n public highlight() {\n this.prismMesh.highlight()\n }\n\n public unhighlight() {\n this.prismMesh.unhighlight()\n }\n\n public raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection[]) {\n this.children.forEach((child) => intersectWithoutLine(child, raycaster, intersects, true))\n return false\n }\n\n /**\n * 设置Five实例\n * @param five Five实例\n */\n public setFive(five: Five): void {\n this.five = five\n }\n\n /**\n * 播放盒子上下动画\n * @param id 盒子项目ID\n * @param color 动画颜色,默认为浅蓝色 (#4DF0FF)\n * @returns Promise,动画完成时解析\n */\n public playBoxAnimation(id: string | number, color: string = '#4DF0FF'): Promise<void> {\n if (!this.five) {\n console.warn('Five instance not available for box animation')\n return Promise.resolve()\n }\n\n // 强制结束任何现有动画\n if (this.activeAnimations.has(id)) {\n this.forceFinishBoxAnimation(id)\n }\n\n return new Promise<void>((resolve) => {\n // 首先隐藏原始网格\n this.prismMesh.visible = false\n this.edgeMesh.visible = false\n\n // 创建或更新动画盒子\n const animatedBoxMesh = this.createOrUpdateAnimatedBoxMesh(color)\n\n const material = animatedBoxMesh.material\n\n const duration = 3000\n let currentTime = 0\n const remove = AnimationFrameLoop.shared.add((_, deltaTime) => {\n currentTime += deltaTime\n let progress = currentTime / duration\n if (progress > 1) {\n progress = 1\n }\n // 简化进度计算,实现往返扫光:0-1过程中,0-0.5是从底到顶,0.5-1是从顶到底\n let _progress = progress\n if (progress <= 0.5) {\n // 前半段:从底到顶 (0 -> 1)\n _progress = progress * 2\n } else {\n // 后半段:从顶到底 (1 -> 0)\n _progress = 2 - progress * 2\n }\n\n material.progressValue.value = _progress\n\n if (progress === 1) {\n remove()\n animatedBoxMesh.visible = false\n this.playEaseInAnimation(id, () => {\n this.activeAnimations.delete(id)\n resolve()\n })\n }\n this.five!.needsRender = true\n })\n\n // 存储动画以便潜在中断\n this.activeAnimations.set(id, { animatedBoxMesh, remove, resolve })\n\n // 显示动画盒子\n animatedBoxMesh.visible = true\n })\n }\n\n /**\n * 强制立即完成所有活动的盒子动画\n * @param id 可选的盒子项目ID。如果未提供,完成所有活动的盒子动画。\n */\n public forceFinishBoxAnimation(id?: string | number): void {\n if (!this.five) {\n console.warn('Five instance not available for finishing box animation')\n return\n }\n\n const targetIds = id ? [id] : Array.from(this.activeAnimations.keys())\n\n targetIds.forEach((targetId) => {\n const animation = this.activeAnimations.get(targetId)\n if (animation) {\n // 移除动画循环\n animation.remove()\n\n // 隐藏动画盒子\n if (this.animatedBoxMesh) {\n this.animatedBoxMesh.visible = false\n }\n\n // 从活动动画中移除\n this.activeAnimations.delete(targetId)\n animation.resolve()\n }\n\n // 同时检查并清除任何淡入动画\n const easeInAnimation = this.activeEaseInAnimations.get(targetId)\n if (easeInAnimation) {\n clearInterval(easeInAnimation.interval)\n this.activeEaseInAnimations.delete(targetId)\n }\n })\n\n this.showBoxFinalState()\n this.five.needsRender = true\n }\n\n /** Release the independently mounted sweep mesh when its owning marker is removed. */\n public disposeAnimation(): void {\n if (this.five) this.forceFinishBoxAnimation()\n this.animatedBoxMesh?.removeFromParent()\n this.animatedBoxMesh?.geometry.dispose()\n this.animatedBoxMesh?.material.dispose()\n this.animatedBoxMesh = undefined\n }\n\n private playEaseInAnimation(id: string | number, callback: () => void) {\n if (!this.five) return\n\n this.prismMesh.visible = true\n this.edgeMesh.visible = true\n let edgeMeshCount = 0\n const originalPrismMeshOpacity = this.prismMesh.style.opacity\n this.prismMesh.setStyle({ opacity: 0 })\n this.edgeMesh.setStyle({ lineOpacity: 0 })\n\n const interval = setInterval(() => {\n if (edgeMeshCount === 61) {\n clearInterval(interval)\n this.activeEaseInAnimations.delete(id)\n this.showBoxFinalState()\n callback()\n }\n this.edgeMesh.setStyle({ lineOpacity: edgeMeshCount / 60 })\n this.prismMesh.setStyle({ opacity: (edgeMeshCount / 60) * originalPrismMeshOpacity })\n this.five!.needsRender = true\n edgeMeshCount++\n }, 16)\n\n // 存储间隔以便潜在中断\n this.activeEaseInAnimations.set(id, { interval, model: this })\n }\n\n /**\n * 创建或更新动画盒子网格\n * @param color 动画颜色\n */\n private createOrUpdateAnimatedBoxMesh(color: string): THREE.Mesh<PrismAnimationGeometry, PrismAnimationMaterial> {\n if (!this.five) {\n throw new Error('Five instance not available')\n }\n\n // 计算边界框\n const min = new THREE.Vector3(Infinity, Infinity, Infinity)\n const max = new THREE.Vector3(-Infinity, -Infinity, -Infinity)\n\n // 获取网格位置\n const bottomPositions = this.bottomPositions\n for (const pos of bottomPositions) {\n min.min(pos)\n max.max(pos)\n }\n\n const topPositions = this.topPositions\n for (const pos of topPositions) {\n min.min(pos)\n max.max(pos)\n }\n\n const size = max.clone().sub(min)\n // 获取原始几何体的局部坐标\n const originalGeometry = this.prismMesh.geometry\n const originalBottomPositions = originalGeometry.bottomPositions\n const originalTopPosition = originalGeometry.topPosition\n\n // 如果已存在动画网格,更新几何体和材质\n if (this.animatedBoxMesh) {\n // 更新矩阵\n this.matrixWorld.decompose(this.animatedBoxMesh.position, this.animatedBoxMesh.quaternion, this.animatedBoxMesh.scale);\n this.animatedBoxMesh.updateMatrixWorld();\n this.animatedBoxMesh.matrixAutoUpdate = false\n return this.animatedBoxMesh\n }\n\n // 创建新的动画几何体\n const animationGeometry = new PrismAnimationGeometry({\n bottomPositions: originalBottomPositions,\n topPosition: originalTopPosition,\n type: 'Concave'\n })\n\n const material = new PrismAnimationMaterial(color)\n animationGeometry.clearGroups()\n this.animatedBoxMesh = new THREE.Mesh(animationGeometry, material)\n this.matrixWorld.decompose(this.animatedBoxMesh.position, this.animatedBoxMesh.quaternion, this.animatedBoxMesh.scale);\n this.animatedBoxMesh.updateMatrixWorld();\n this.animatedBoxMesh.matrixAutoUpdate = false\n\n // 添加动画回调\n this.animatedBoxMesh.onBeforeRender = () => {\n if (!animationGeometry.boundingBox) {\n animationGeometry.computeBoundingBox()\n }\n const minWorld = animationGeometry.boundingBox!.min.clone().applyMatrix4(this.animatedBoxMesh!.matrixWorld)\n const maxWorld = animationGeometry.boundingBox!.max.clone().applyMatrix4(this.animatedBoxMesh!.matrixWorld)\n material.minPosition.value.copy(minWorld)\n material.sizeValue.value.subVectors(maxWorld, minWorld)\n this.five!.needsRender = true\n }\n\n // 添加到场景\n this.five.scene.add(this.animatedBoxMesh)\n\n return this.animatedBoxMesh\n }\n\n /**\n * 显示盒子模型的最终状态(完全可见且不透明度完整)\n */\n private showBoxFinalState(): void {\n this.prismMesh.visible = true\n this.edgeMesh.visible = true\n this.prismMesh.setStyle({ opacity: this.prismMesh.style.opacity })\n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