@soonspacejs/plugin-heat-cloud 2.16.8 → 3.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2499 -24
- package/dist/index.esm.js +79 -78
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TextureLoader as Nt, Texture as Pt, Vector4 as Ot, Vector3 as f, Vector2 as T, DepthStencilFormat as It, DepthFormat as Ft,
|
|
2
|
-
import
|
|
1
|
+
import { TextureLoader as Nt, Texture as Pt, Vector4 as Ot, Vector3 as f, Vector2 as T, DepthStencilFormat as It, DepthFormat as Ft, RGBAIntegerFormat as Tt, RGBAFormat as Xe, RGIntegerFormat as Rt, RGFormat as Vt, RedIntegerFormat as Et, RedFormat as Ye, AlphaFormat as Gt, Matrix3 as _e, ShaderMaterial as te, UniformsUtils as Je, BackSide as Q, RawShaderMaterial as Ze, Color as Qe, GLSL3 as ie, ShaderLib as Bt, Data3DTexture as et, FloatType as tt, LinearFilter as it, UnsignedByteType as at, DoubleSide as Oe, Mesh as rt, PlaneGeometry as Lt, FrontSide as J, Matrix4 as ot, BoxGeometry as jt, Points as nt, Box3 as xe, Line3 as kt, Quaternion as Ht, BufferGeometry as st, Float32BufferAttribute as Z, Uint8ClampedBufferAttribute as $t } from "three";
|
|
2
|
+
import qt from "soonspacejs";
|
|
3
3
|
var S = /* @__PURE__ */ ((i) => (i[i.x = 0] = "x", i[i.y = 1] = "y", i[i.z = 2] = "z", i))(S || {});
|
|
4
4
|
((i) => {
|
|
5
5
|
function e(r) {
|
|
@@ -32,7 +32,7 @@ var Ae = /* @__PURE__ */ ((i) => (i[i.x = 0] = "x", i[i.y = 1] = "y", i[i.z = 2]
|
|
|
32
32
|
}
|
|
33
33
|
i.getCrossAxiss = a;
|
|
34
34
|
})(Ae || (Ae = {}));
|
|
35
|
-
var
|
|
35
|
+
var Kt = Object.defineProperty, Wt = (i, e, t) => e in i ? Kt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, F = (i, e, t) => (Wt(i, typeof e != "symbol" ? e + "" : e, t), t);
|
|
36
36
|
function lt(i, e, t, a = "srgb") {
|
|
37
37
|
const r = new OffscreenCanvas(e, t).getContext("2d"), o = r.createLinearGradient(0, 0, 256, 1);
|
|
38
38
|
for (const [n, s] of i)
|
|
@@ -42,12 +42,12 @@ function lt(i, e, t, a = "srgb") {
|
|
|
42
42
|
function ut(i, e) {
|
|
43
43
|
let { area: t, width: a, height: r, colorSpace: o } = e || {};
|
|
44
44
|
o = o ?? "srgb", t = t || {};
|
|
45
|
-
const n = t.x ?? 0, s = t.y ?? 0, u =
|
|
45
|
+
const n = t.x ?? 0, s = t.y ?? 0, u = Xt(i), l = t.width ?? u.width, c = t.height ?? u.height;
|
|
46
46
|
a = a ?? l, r = r ?? c;
|
|
47
47
|
const d = new OffscreenCanvas(a, r).getContext("2d");
|
|
48
48
|
return d.drawImage(i, n, s, l, c, 0, 0, a, r), d.getImageData(0, 0, a, r, { colorSpace: o });
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function Xt(i) {
|
|
51
51
|
let e = 0, t = 0;
|
|
52
52
|
return i instanceof HTMLImageElement ? (e = i.naturalWidth, t = i.naturalHeight) : i instanceof HTMLVideoElement ? (e = i.videoWidth, t = i.videoHeight) : (e = i.width, t = i.height), { width: e, height: t };
|
|
53
53
|
}
|
|
@@ -67,12 +67,12 @@ function dt(i, e, t) {
|
|
|
67
67
|
const { data: a, width: r } = i, o = (e * r + t) * 4;
|
|
68
68
|
return a.slice(o, o + 4);
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function Yt(i) {
|
|
71
71
|
const e = document.createElement("canvas"), t = e.getContext("2d");
|
|
72
72
|
return e.width = i.width, e.height = i.height, t.putImageData(i, 0, 0), e;
|
|
73
73
|
}
|
|
74
74
|
function aa(i) {
|
|
75
|
-
return
|
|
75
|
+
return Yt(i).toDataURL();
|
|
76
76
|
}
|
|
77
77
|
function Ie(i) {
|
|
78
78
|
return i && i.data != null && i.width != null && i.height != null;
|
|
@@ -109,7 +109,7 @@ function mt(i, e, t = 1) {
|
|
|
109
109
|
}
|
|
110
110
|
return { index: o, value: n };
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function Jt(i, e) {
|
|
113
113
|
let { x: t, y: a, z: r } = e;
|
|
114
114
|
const o = i.size;
|
|
115
115
|
return t = Math.max(0, Math.min(o.x - 1, t)), a = Math.max(0, Math.min(o.y - 1, a)), r = Math.max(0, Math.min(o.z - 1, r)), pt(i, { x: t, y: a, z: r });
|
|
@@ -166,18 +166,18 @@ function ye(i, e, t, a = 1) {
|
|
|
166
166
|
}
|
|
167
167
|
return { data: m, size: { x: c, y: d } };
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function Zt(i, e, t) {
|
|
170
170
|
e = Math.trunc(e);
|
|
171
171
|
const { data: a, width: r, height: o, colorSpace: n } = t ? ct(i) : i, s = a.length, u = s * e, l = new Uint8ClampedArray(u);
|
|
172
172
|
for (let c = 0; c < e; c++)
|
|
173
173
|
l.set(a, c * s);
|
|
174
174
|
return { data: l, width: r, height: o, depth: e, colorSpace: n };
|
|
175
175
|
}
|
|
176
|
-
function
|
|
176
|
+
function Qt(i, e, t) {
|
|
177
177
|
const a = t || {}, r = a.reverseY, o = a.axis ?? "z", n = Ie(i) ? i : ut(i, a);
|
|
178
|
-
return o === "z" ?
|
|
178
|
+
return o === "z" ? Zt(n, e, r) : ei(n, o, e, r);
|
|
179
179
|
}
|
|
180
|
-
function
|
|
180
|
+
function ei(i, e, t, a) {
|
|
181
181
|
t = Math.trunc(t);
|
|
182
182
|
const { data: r, width: o, height: n, colorSpace: s } = a ? ct(i) : i, u = S.toKey(e), l = (e + 1) % 3, c = (e + 2) % 3, d = S.toKey(l), m = S.toKey(c), p = {
|
|
183
183
|
[d]: o,
|
|
@@ -207,9 +207,9 @@ function sa(i, e) {
|
|
|
207
207
|
function la(i, e, t = 1) {
|
|
208
208
|
let { x: a, y: r } = e;
|
|
209
209
|
const o = i.size;
|
|
210
|
-
return a = Math.max(0, Math.min(o.x - 1, a)), r = Math.max(0, Math.min(o.y - 1, r)),
|
|
210
|
+
return a = Math.max(0, Math.min(o.x - 1, a)), r = Math.max(0, Math.min(o.y - 1, r)), ti(i, { x: a, y: r }, t);
|
|
211
211
|
}
|
|
212
|
-
function
|
|
212
|
+
function ti(i, e, t = 1) {
|
|
213
213
|
const { data: a, size: r } = i, o = ft(e, r);
|
|
214
214
|
let n = [];
|
|
215
215
|
if (t > 0) {
|
|
@@ -222,9 +222,9 @@ function ai(i, e, t = 1) {
|
|
|
222
222
|
function ua(i, e) {
|
|
223
223
|
let { x: t, y: a } = e;
|
|
224
224
|
const r = i.size;
|
|
225
|
-
return t = Math.max(0, Math.min(r.x - 1, t)), a = Math.max(0, Math.min(r.y - 1, a)),
|
|
225
|
+
return t = Math.max(0, Math.min(r.x - 1, t)), a = Math.max(0, Math.min(r.y - 1, a)), ii(i, { x: t, y: a });
|
|
226
226
|
}
|
|
227
|
-
function
|
|
227
|
+
function ii(i, e) {
|
|
228
228
|
const { data: t, size: a } = i, r = ft(e, a);
|
|
229
229
|
return { index: r, value: t[r] };
|
|
230
230
|
}
|
|
@@ -232,7 +232,7 @@ function ca(i, e, t = 1) {
|
|
|
232
232
|
const { data: a, size: r } = i, o = r.x, n = e * o, s = n + o;
|
|
233
233
|
return (typeof a.slice == "function" ? a : Array.from(a)).slice(n * t, s * t);
|
|
234
234
|
}
|
|
235
|
-
class
|
|
235
|
+
class ai {
|
|
236
236
|
constructor(e) {
|
|
237
237
|
F(this, "isImageData3DSlice", !0), F(this, "_image3D"), F(this, "_canvas"), F(this, "_context"), F(this, "_axis", S.z), F(this, "_depth", 0), F(this, "_sliceSize", null), F(this, "_slice"), this.image3D = e;
|
|
238
238
|
}
|
|
@@ -352,7 +352,8 @@ class oi {
|
|
|
352
352
|
this._slice = null, this.context.putImageData(this.slice, 0, 0);
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
|
-
var
|
|
355
|
+
var ri = Object.defineProperty, oi = (i, e, t) => e in i ? ri(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, Y = (i, e, t) => (oi(i, typeof e != "symbol" ? e + "" : e, t), t);
|
|
356
|
+
const ni = 1024, si = 1025;
|
|
356
357
|
function li(i) {
|
|
357
358
|
return i.w !== void 0 ? [Ot, 4] : i.z !== void 0 ? [f, 3] : [T, 2];
|
|
358
359
|
}
|
|
@@ -431,7 +432,7 @@ const Ce = {
|
|
|
431
432
|
};
|
|
432
433
|
let ht = class {
|
|
433
434
|
constructor(e) {
|
|
434
|
-
|
|
435
|
+
Y(this, "_options"), Y(this, "_listMap"), Y(this, "_front"), Y(this, "_up"), e && (this.options = e);
|
|
435
436
|
}
|
|
436
437
|
static get options() {
|
|
437
438
|
return this._options ?? (this.options = Ce);
|
|
@@ -525,18 +526,18 @@ let ht = class {
|
|
|
525
526
|
return a;
|
|
526
527
|
}
|
|
527
528
|
};
|
|
528
|
-
|
|
529
|
+
Y(ht, "_options");
|
|
529
530
|
new ht();
|
|
530
531
|
const pi = {
|
|
531
|
-
[
|
|
532
|
-
[
|
|
533
|
-
[
|
|
534
|
-
[
|
|
535
|
-
[
|
|
536
|
-
[
|
|
537
|
-
[
|
|
538
|
-
[
|
|
539
|
-
[
|
|
532
|
+
[Gt]: 1,
|
|
533
|
+
[Ye]: 1,
|
|
534
|
+
[Et]: 1,
|
|
535
|
+
[Vt]: 3,
|
|
536
|
+
[Rt]: 2,
|
|
537
|
+
[Xe]: 4,
|
|
538
|
+
[Tt]: 4,
|
|
539
|
+
[ni]: 1,
|
|
540
|
+
[si]: 2,
|
|
540
541
|
[Ft]: 1,
|
|
541
542
|
[It]: 2
|
|
542
543
|
};
|
|
@@ -855,7 +856,7 @@ function _i(i) {
|
|
|
855
856
|
class $e extends rt {
|
|
856
857
|
constructor(e) {
|
|
857
858
|
var t;
|
|
858
|
-
const { width: a, height: r, depth: o } = ((t = e.map) == null ? void 0 : t.image) || {}, n = new
|
|
859
|
+
const { width: a, height: r, depth: o } = ((t = e.map) == null ? void 0 : t.image) || {}, n = new jt(a, r, o);
|
|
859
860
|
_i(n), super(n, e), g(this, "isVolumeMesh", !0), g(this, "_geometry"), g(this, "autoUpdateMaterial", !0), g(this, "_material"), g(this, "autoUpdateGeometry", !0), g(this, "autoNormalize", !1), Object.defineProperties(this, {
|
|
860
861
|
geometry: {
|
|
861
862
|
get: () => this._geometry,
|
|
@@ -1133,7 +1134,7 @@ class Ue extends xt {
|
|
|
1133
1134
|
}
|
|
1134
1135
|
class Mi extends et {
|
|
1135
1136
|
constructor(e, t, a, r, o) {
|
|
1136
|
-
super(e, t, a, r), g(this, "isGradientData3DTexture", !0), this.format =
|
|
1137
|
+
super(e, t, a, r), g(this, "isGradientData3DTexture", !0), this.format = Ye, this.type = o ?? tt, this.minFilter = this.magFilter = it, this.unpackAlignment = 1, this.needsUpdate = !0;
|
|
1137
1138
|
}
|
|
1138
1139
|
/**
|
|
1139
1140
|
* 获取3D数据的切片
|
|
@@ -1165,7 +1166,7 @@ class Mi extends et {
|
|
|
1165
1166
|
*/
|
|
1166
1167
|
getValue(e) {
|
|
1167
1168
|
const { data: t, width: a, height: r, depth: o } = this.image;
|
|
1168
|
-
return
|
|
1169
|
+
return Jt({ data: t, size: { x: a, y: r, z: o } }, e).value;
|
|
1169
1170
|
}
|
|
1170
1171
|
}
|
|
1171
1172
|
function wi(i, e) {
|
|
@@ -1297,7 +1298,7 @@ function Di(i, e, t) {
|
|
|
1297
1298
|
}
|
|
1298
1299
|
class _t extends et {
|
|
1299
1300
|
constructor(e, t, a, r) {
|
|
1300
|
-
super(e, t, a, r), g(this, "isImageData3DTexture", !0), this.format =
|
|
1301
|
+
super(e, t, a, r), g(this, "isImageData3DTexture", !0), this.format = Xe, this.type = at, this.minFilter = this.magFilter = it, this.unpackAlignment = 1, this.needsUpdate = !0;
|
|
1301
1302
|
}
|
|
1302
1303
|
/**
|
|
1303
1304
|
* 获取3D数据的切片
|
|
@@ -1332,7 +1333,7 @@ class _t extends et {
|
|
|
1332
1333
|
}
|
|
1333
1334
|
}
|
|
1334
1335
|
function Si(i, e, t) {
|
|
1335
|
-
const a = t?.reverseY ?? !0, { data: r, width: o, height: n, depth: s, colorSpace: u } =
|
|
1336
|
+
const a = t?.reverseY ?? !0, { data: r, width: o, height: n, depth: s, colorSpace: u } = Qt(i, e, { ...t, reverseY: a }), l = new _t(r, o, n, s);
|
|
1336
1337
|
return u === "srgb" && (l.colorSpace = "srgb"), l;
|
|
1337
1338
|
}
|
|
1338
1339
|
function Ke(i, e) {
|
|
@@ -1499,7 +1500,7 @@ class yt extends te {
|
|
|
1499
1500
|
super({
|
|
1500
1501
|
// glslVersion: GLSL3,
|
|
1501
1502
|
// @ts-ignore
|
|
1502
|
-
uniforms: Je.merge([
|
|
1503
|
+
uniforms: Je.merge([Bt.points.uniforms, d, l]),
|
|
1503
1504
|
transparent: !0,
|
|
1504
1505
|
depthTest: !1,
|
|
1505
1506
|
// depthWrite:false,
|
|
@@ -1756,7 +1757,7 @@ function Pi(i) {
|
|
|
1756
1757
|
p[3] = Math.trunc(h * 255), n.push(...p);
|
|
1757
1758
|
}
|
|
1758
1759
|
const s = new st();
|
|
1759
|
-
return s.setAttribute("position", new Z(r, 3)), s.setAttribute("radius", new Z(o, 1)), s.setAttribute("color", new
|
|
1760
|
+
return s.setAttribute("position", new Z(r, 3)), s.setAttribute("radius", new Z(o, 1)), s.setAttribute("color", new $t(n, 4, !0)), s;
|
|
1760
1761
|
}
|
|
1761
1762
|
function pa(i) {
|
|
1762
1763
|
const e = new Ni(i), t = Pi(i);
|
|
@@ -2038,7 +2039,7 @@ class Ei extends te {
|
|
|
2038
2039
|
}
|
|
2039
2040
|
class Gi extends rt {
|
|
2040
2041
|
constructor(e) {
|
|
2041
|
-
const t = new Ei(e), a = new
|
|
2042
|
+
const t = new Ei(e), a = new Lt();
|
|
2042
2043
|
super(a, t), g(this, "isSliceMesh", !0), g(this, "_geometry"), g(this, "_material"), g(this, "autoUpdateGeometry", !0), Object.defineProperties(this, {
|
|
2043
2044
|
geometry: {
|
|
2044
2045
|
get: () => this._geometry,
|
|
@@ -2109,7 +2110,7 @@ class Gi extends rt {
|
|
|
2109
2110
|
return this.material.sliceSize;
|
|
2110
2111
|
}
|
|
2111
2112
|
}
|
|
2112
|
-
class
|
|
2113
|
+
class Bi extends ai {
|
|
2113
2114
|
constructor(e) {
|
|
2114
2115
|
const t = Ne(e) ? e : e.image;
|
|
2115
2116
|
super(t), g(this, "isImageData3DTextureSlice", !0);
|
|
@@ -2124,7 +2125,7 @@ class Li extends oi {
|
|
|
2124
2125
|
function Mt({ ratio: i, value: e }) {
|
|
2125
2126
|
return e - e * i;
|
|
2126
2127
|
}
|
|
2127
|
-
function
|
|
2128
|
+
function Li(i, e) {
|
|
2128
2129
|
const { x: t, y: a } = e;
|
|
2129
2130
|
let r = 0;
|
|
2130
2131
|
for (const { value: o, clim: { x: n, y: s } } of i)
|
|
@@ -2176,16 +2177,16 @@ function ji(i, e, t) {
|
|
|
2176
2177
|
...H,
|
|
2177
2178
|
value: $
|
|
2178
2179
|
});
|
|
2179
|
-
for (const
|
|
2180
|
-
const
|
|
2181
|
-
if (
|
|
2180
|
+
for (const B of t) {
|
|
2181
|
+
const L = I.distanceTo(B), { hollow: we, radius: K } = B;
|
|
2182
|
+
if (L <= K) {
|
|
2182
2183
|
const W = K * we;
|
|
2183
|
-
if (
|
|
2184
|
+
if (L < W)
|
|
2184
2185
|
continue e;
|
|
2185
2186
|
const V = {
|
|
2186
|
-
...
|
|
2187
|
-
ratio:
|
|
2188
|
-
distance:
|
|
2187
|
+
...B,
|
|
2188
|
+
ratio: L / K,
|
|
2189
|
+
distance: L,
|
|
2189
2190
|
hollowRadius: W,
|
|
2190
2191
|
point: I
|
|
2191
2192
|
}, ze = c(V);
|
|
@@ -2200,7 +2201,7 @@ function ji(i, e, t) {
|
|
|
2200
2201
|
return x;
|
|
2201
2202
|
}
|
|
2202
2203
|
function ki(i) {
|
|
2203
|
-
const { points: e, clim: t = { x: 0, y: 100 }, radius: a = 10, value: r = 100, hollow: o = 0, valueGradient: n = Mt, valuesAccumulate: s =
|
|
2204
|
+
const { points: e, clim: t = { x: 0, y: 100 }, radius: a = 10, value: r = 100, hollow: o = 0, valueGradient: n = Mt, valuesAccumulate: s = Li, size: u } = i, l = { clim: t, radius: a, value: r, hollow: o, valueGradient: n, valuesAccumulate: s }, c = e.map((y) => ({ ...l, ...y }));
|
|
2204
2205
|
let d = u;
|
|
2205
2206
|
u || (d = new xe().setFromPoints(c).max.addScalar(1));
|
|
2206
2207
|
const m = ui(c);
|
|
@@ -2241,11 +2242,11 @@ function Wi(i) {
|
|
|
2241
2242
|
data: y
|
|
2242
2243
|
}, C = new f(0, 0, 0), U = e.length, E = Math.trunc(U / 2);
|
|
2243
2244
|
for (let N = 0; N < E; N++) {
|
|
2244
|
-
const ae = N * 2, O = p[ae], Me = ae + 1, R = p[Me], re = new
|
|
2245
|
+
const ae = N * 2, O = p[ae], Me = ae + 1, R = p[Me], re = new kt(O, R), P = re.distance(), j = re.delta(new f()).normalize(), I = new Ht();
|
|
2245
2246
|
I.setFromUnitVectors(new f(0, 1, 0), j);
|
|
2246
2247
|
const A = new ot().makeRotationFromQuaternion(I);
|
|
2247
2248
|
A.setPosition(O);
|
|
2248
|
-
const { radius: k, value: G, hollow: H } = O, { radius: $, value: q, hollow:
|
|
2249
|
+
const { radius: k, value: G, hollow: H } = O, { radius: $, value: q, hollow: B } = R, L = $ - k, we = q - G, K = B - H, W = { length: P, startRadius: k, endRadius: $, addedRadius: L, defaultRadius: r, radius: r, startValue: G, endValue: q, addedValue: we, defaultValue: o, startHollow: H, endHollow: B, addedHollow: K, defaultHollow: n, clim: a }, V = Math.max(k, $), ze = new f(-V, 0, -V), zt = new f(V, P, V), Re = new xe(ze, zt);
|
|
2249
2250
|
Re.applyMatrix4(A);
|
|
2250
2251
|
const { min: Ve, max: Ee } = Re;
|
|
2251
2252
|
Ve.max(C), Ee.min(h);
|
|
@@ -2260,26 +2261,26 @@ function Wi(i) {
|
|
|
2260
2261
|
for (let me = ne; me <= ue; me++) {
|
|
2261
2262
|
const St = Dt + me * _;
|
|
2262
2263
|
for (let pe = oe; pe <= le; pe++) {
|
|
2263
|
-
const Ge = St + pe, fe = new f(pe, me, de),
|
|
2264
|
-
|
|
2265
|
-
const { x: bt, y: De, z: Ct } =
|
|
2264
|
+
const Ge = St + pe, fe = new f(pe, me, de), Be = fe.clone();
|
|
2265
|
+
Be.applyMatrix4(A);
|
|
2266
|
+
const { x: bt, y: De, z: Ct } = Be;
|
|
2266
2267
|
if (De < 0 || De > P)
|
|
2267
2268
|
continue;
|
|
2268
2269
|
const he = Math.hypot(bt, Ct), ve = {
|
|
2269
2270
|
...W,
|
|
2270
2271
|
ratio: De / P,
|
|
2271
2272
|
point: fe
|
|
2272
|
-
},
|
|
2273
|
-
ve.radius =
|
|
2274
|
-
const
|
|
2275
|
-
if (he >
|
|
2273
|
+
}, X = u(ve);
|
|
2274
|
+
ve.radius = X;
|
|
2275
|
+
const Le = l(ve), je = X * Le;
|
|
2276
|
+
if (he > X || he < je)
|
|
2276
2277
|
continue;
|
|
2277
2278
|
const Ut = c(ve), At = {
|
|
2278
2279
|
...W,
|
|
2279
2280
|
value: Ut,
|
|
2280
|
-
ratio: he /
|
|
2281
|
-
radius:
|
|
2282
|
-
hollow:
|
|
2281
|
+
ratio: he / X,
|
|
2282
|
+
radius: X,
|
|
2283
|
+
hollow: Le,
|
|
2283
2284
|
hollowRadius: je,
|
|
2284
2285
|
distance: he,
|
|
2285
2286
|
point: fe
|
|
@@ -2307,7 +2308,7 @@ function ha(i, e) {
|
|
|
2307
2308
|
}
|
|
2308
2309
|
return { points: o, size: n, radius: s, ...u };
|
|
2309
2310
|
}
|
|
2310
|
-
function
|
|
2311
|
+
function Xi(i, e, t = 1) {
|
|
2311
2312
|
let { points: a, size: r, radius: o, ...n } = i;
|
|
2312
2313
|
if (o && (o *= t), a) {
|
|
2313
2314
|
const s = [];
|
|
@@ -2320,7 +2321,7 @@ function Yi(i, e, t = 1) {
|
|
|
2320
2321
|
}
|
|
2321
2322
|
return r && (r = new f().copy(r).add(e).multiplyScalar(t)), { points: a, size: r, radius: o, ...n };
|
|
2322
2323
|
}
|
|
2323
|
-
function
|
|
2324
|
+
function Yi(i, e) {
|
|
2324
2325
|
const { points: t, radius: a } = i;
|
|
2325
2326
|
if (!t)
|
|
2326
2327
|
return { options: i, position: new f(), scale: 1 };
|
|
@@ -2333,7 +2334,7 @@ function Xi(i, e) {
|
|
|
2333
2334
|
i.size && n.min(i.size);
|
|
2334
2335
|
let { scale: s, maxSize: u } = e || {};
|
|
2335
2336
|
s || (u = u ?? 100, s = u / Math.max(n.x, n.y, n.z)), n.multiplyScalar(s);
|
|
2336
|
-
const l = o.clone().negate(), c =
|
|
2337
|
+
const l = o.clone().negate(), c = Xi(i, l, s);
|
|
2337
2338
|
return c.size = n, { options: c, position: o, scale: 1 / s };
|
|
2338
2339
|
}
|
|
2339
2340
|
const We = {
|
|
@@ -3081,7 +3082,7 @@ class _a {
|
|
|
3081
3082
|
gradient: ee(this.defaultColorGradient)
|
|
3082
3083
|
};
|
|
3083
3084
|
_createTexture(e, t, a = !1) {
|
|
3084
|
-
const r =
|
|
3085
|
+
const r = Yi({ points: e, ...t }, { maxSize: 60, ...t }), { options: o, position: n, scale: s } = r, u = a ? Wi(o) : ki(o), l = wi(u, {
|
|
3085
3086
|
...t
|
|
3086
3087
|
}), c = new Ue({
|
|
3087
3088
|
...this.defaultGradientVolumeMaterialOptions,
|
|
@@ -3103,7 +3104,7 @@ class _a {
|
|
|
3103
3104
|
}
|
|
3104
3105
|
//创建图片挤压
|
|
3105
3106
|
async createImageExtrusion(e, t) {
|
|
3106
|
-
const a = new qe({ side: Q, depthTest: !1, ...t }), r = await
|
|
3107
|
+
const a = new qe({ side: Q, depthTest: !1, ...t }), r = await qt.utils.imageLoader.loadAsync(e), o = Si(r, t?.depth ?? 200, t);
|
|
3107
3108
|
a.map = o;
|
|
3108
3109
|
const n = new $e(a);
|
|
3109
3110
|
return this.ssp.addObject(n), n;
|
|
@@ -3142,7 +3143,7 @@ class _a {
|
|
|
3142
3143
|
// voidColor
|
|
3143
3144
|
});
|
|
3144
3145
|
}
|
|
3145
|
-
return e instanceof qe && (r = a), r ? new
|
|
3146
|
+
return e instanceof qe && (r = a), r ? new Bi(r) : void 0;
|
|
3146
3147
|
}
|
|
3147
3148
|
}
|
|
3148
3149
|
export {
|
|
@@ -3155,9 +3156,9 @@ export {
|
|
|
3155
3156
|
Fi as GradientFogPointsMaterial,
|
|
3156
3157
|
Ue as GradientVolumeMaterial,
|
|
3157
3158
|
_a as HeatMapPlugin,
|
|
3158
|
-
|
|
3159
|
+
ai as ImageData3DSlice,
|
|
3159
3160
|
_t as ImageData3DTexture,
|
|
3160
|
-
|
|
3161
|
+
Bi as ImageData3DTextureSlice,
|
|
3161
3162
|
qe as ImageVolumeMaterial,
|
|
3162
3163
|
Ei as SliceMaterial,
|
|
3163
3164
|
Gi as SliceMesh,
|
|
@@ -3180,26 +3181,26 @@ export {
|
|
|
3180
3181
|
Fe as data3DCoordToIndex,
|
|
3181
3182
|
oa as data3DIndexToCoord,
|
|
3182
3183
|
_a as default,
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3184
|
+
Qt as extrudeImage,
|
|
3185
|
+
Zt as extrudeImageData,
|
|
3186
|
+
ei as extrudeImageDataOnAxis,
|
|
3187
|
+
ti as getData2DItem,
|
|
3187
3188
|
la as getData2DItemSafe,
|
|
3188
3189
|
ca as getData2DRow,
|
|
3189
|
-
|
|
3190
|
+
ii as getData2DValue,
|
|
3190
3191
|
ua as getData2DValueSafe,
|
|
3191
3192
|
mt as getData3DItem,
|
|
3192
3193
|
Te as getData3DItemSafe,
|
|
3193
3194
|
ye as getData3DSlice,
|
|
3194
3195
|
pt as getData3DValue,
|
|
3195
|
-
|
|
3196
|
+
Jt as getData3DValueSafe,
|
|
3196
3197
|
dt as getImageDateColor,
|
|
3197
3198
|
ut as getImageDateOfImage,
|
|
3198
3199
|
ia as getImageDateRow,
|
|
3199
|
-
|
|
3200
|
+
Xt as getNaturalSizeOfImageSource,
|
|
3200
3201
|
Di as gradientData3DToImageData3D,
|
|
3201
3202
|
$i as hollowGradient_Default,
|
|
3202
|
-
|
|
3203
|
+
Yt as imageDataToCanvas,
|
|
3203
3204
|
aa as imageDataToUrl,
|
|
3204
3205
|
Ie as isIImageData2,
|
|
3205
3206
|
Ne as isIImageData3,
|
|
@@ -3208,11 +3209,11 @@ export {
|
|
|
3208
3209
|
_i as makeOriginOnBoundingBoxMinOfGeometry,
|
|
3209
3210
|
na as mergeData3Ds,
|
|
3210
3211
|
Ki as numberValuesAccumulate_Default,
|
|
3211
|
-
|
|
3212
|
+
Yi as optimizeGradientOptions,
|
|
3212
3213
|
Hi as radiusGradient_Default,
|
|
3213
3214
|
ct as reverseImageDateY,
|
|
3214
3215
|
ha as transformGradientOptions,
|
|
3215
|
-
|
|
3216
|
+
Xi as translateScaleGradientOptions,
|
|
3216
3217
|
Mt as valueGradient_Default,
|
|
3217
|
-
|
|
3218
|
+
Li as valuesAccumulate_Default
|
|
3218
3219
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soonspacejs/plugin-heat-cloud",
|
|
3
3
|
"pluginName": "HeatCloudPlugin",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "3.0.0-alpha.0",
|
|
5
5
|
"description": "Haet-cloud plugin for SoonSpace.js",
|
|
6
6
|
"main": "dist/index.esm.js",
|
|
7
7
|
"module": "dist/index.esm.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"license": "UNLICENSED",
|
|
16
16
|
"gitHead": "4a87dd85050651088e11c3da777c49fab3db7e5d",
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"soonspacejs": "
|
|
18
|
+
"soonspacejs": "3.0.0-alpha.0"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@three3d/volume": "^1.4.3"
|