gl-draw 0.17.0-beta.23 → 0.17.0-beta.25
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/core/BaseObject/PointerEvent.d.ts +1 -0
- package/dist/core/Lead/Pick.d.ts +15 -1
- package/dist/index.js +2 -2
- package/dist/index.module.js +346 -310
- package/dist/index.module2.js +17 -14
- package/dist/index2.js +3 -3
- package/dist/objects/group/index.d.ts +1 -0
- package/dist/objects/index.js +1 -1
- package/dist/objects/index.module.js +111 -104
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
var Je = Object.defineProperty, Qe = Object.defineProperties;
|
|
2
2
|
var Ke = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var he = Object.getOwnPropertySymbols;
|
|
4
|
-
var Be = Object.prototype.hasOwnProperty,
|
|
5
|
-
var Ie = (p, e, t) => e in p ? Je(p, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : p[e] = t,
|
|
4
|
+
var Be = Object.prototype.hasOwnProperty, Oe = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var Ie = (p, e, t) => e in p ? Je(p, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : p[e] = t, O = (p, e) => {
|
|
6
6
|
for (var t in e || (e = {}))
|
|
7
7
|
Be.call(e, t) && Ie(p, t, e[t]);
|
|
8
8
|
if (he)
|
|
9
9
|
for (var t of he(e))
|
|
10
|
-
|
|
10
|
+
Oe.call(e, t) && Ie(p, t, e[t]);
|
|
11
11
|
return p;
|
|
12
12
|
}, ue = (p, e) => Qe(p, Ke(e));
|
|
13
13
|
var ye = (p, e) => {
|
|
@@ -16,7 +16,7 @@ var ye = (p, e) => {
|
|
|
16
16
|
Be.call(p, n) && e.indexOf(n) < 0 && (t[n] = p[n]);
|
|
17
17
|
if (p != null && he)
|
|
18
18
|
for (var n of he(p))
|
|
19
|
-
e.indexOf(n) < 0 &&
|
|
19
|
+
e.indexOf(n) < 0 && Oe.call(p, n) && (t[n] = p[n]);
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
22
|
var ie = (p, e, t) => new Promise((n, s) => {
|
|
@@ -40,9 +40,9 @@ import { LineMaterial as hn } from "three/examples/jsm/lines/LineMaterial";
|
|
|
40
40
|
import { LineSegmentsGeometry as tt } from "three/examples/jsm/lines/LineSegmentsGeometry";
|
|
41
41
|
import { LineSegmentsGeometry as fn } from "three/examples/jsm/lines/LineSegmentsGeometry";
|
|
42
42
|
import { P as nt, a as K, M as st, L as ot } from "../index.module2.js";
|
|
43
|
-
import { N as
|
|
44
|
-
import { BufferGeometry as
|
|
45
|
-
import { mergeAttributes as
|
|
43
|
+
import { N as mn, g as pn } from "../index.module2.js";
|
|
44
|
+
import { BufferGeometry as me, Float32BufferAttribute as xe, Vector3 as z, ShapeUtils as fe, Shape as we, Vector2 as E, ArcCurve as it, CatmullRomCurve3 as rt, CubicBezierCurve as at, CubicBezierCurve3 as ct, EllipseCurve as lt, LineCurve as ht, LineCurve3 as ut, QuadraticBezierCurve as ft, QuadraticBezierCurve3 as dt, SplineCurve as mt, Box3 as pt, PlaneGeometry as gt, CanvasTexture as yt, AmbientLight as bt, DirectionalLight as xt, PointLight as wt, SpotLight as vt, HemisphereLight as St, RectAreaLight as At, Matrix4 as We, BufferAttribute as Y, Ray as Mt, Sphere as Lt, LineSegments as Ne, Color as ke, MeshBasicMaterial as Tt, Mesh as Gt } from "three";
|
|
45
|
+
import { mergeAttributes as Ue, mergeGroups as _t } from "three/examples/jsm/utils/BufferGeometryUtils";
|
|
46
46
|
import { g as Et, c as Pt } from "../uvGenerator.module.js";
|
|
47
47
|
import { Brush as Re, Evaluator as zt, INTERSECTION as Ct } from "three-bvh-csg";
|
|
48
48
|
import { RectAreaLightUniformsLib as jt } from "three/examples/jsm/lights/RectAreaLightUniformsLib";
|
|
@@ -51,7 +51,7 @@ import { LineSegments2 as It } from "three/examples/jsm/lines/LineSegments2";
|
|
|
51
51
|
function H(p, e = 0) {
|
|
52
52
|
const t = p[0].index !== null, n = new Set(Object.keys(p[0].attributes)), s = new Set(
|
|
53
53
|
Object.keys(p[0].morphAttributes)
|
|
54
|
-
), r = {}, a = {}, f = p[0].morphTargetsRelative, i = new
|
|
54
|
+
), r = {}, a = {}, f = p[0].morphTargetsRelative, i = new me();
|
|
55
55
|
let h = 0;
|
|
56
56
|
for (let o = 0; o < p.length; ++o) {
|
|
57
57
|
const c = p[o];
|
|
@@ -118,7 +118,7 @@ function H(p, e = 0) {
|
|
|
118
118
|
i.setIndex(c);
|
|
119
119
|
}
|
|
120
120
|
for (const o in r) {
|
|
121
|
-
const c =
|
|
121
|
+
const c = Ue(r[o]);
|
|
122
122
|
if (!c)
|
|
123
123
|
return console.error(
|
|
124
124
|
"THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the " + o + " attribute."
|
|
@@ -133,7 +133,7 @@ function H(p, e = 0) {
|
|
|
133
133
|
const u = [];
|
|
134
134
|
for (let L = 0; L < a[o].length; ++L)
|
|
135
135
|
u.push(a[o][L][g]);
|
|
136
|
-
const y =
|
|
136
|
+
const y = Ue(u);
|
|
137
137
|
if (!y)
|
|
138
138
|
return console.error(
|
|
139
139
|
"THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the " + o + " morphAttribute."
|
|
@@ -146,14 +146,14 @@ function H(p, e = 0) {
|
|
|
146
146
|
const De = (p) => {
|
|
147
147
|
const f = p, { coordinate: e, startHeight: t, height: n } = f, s = ye(f, ["coordinate", "startHeight", "height"]);
|
|
148
148
|
let r = t || 0;
|
|
149
|
-
return typeof t != "undefined" && typeof n != "undefined" && (r = t + n), new nt([e], ue(
|
|
149
|
+
return typeof t != "undefined" && typeof n != "undefined" && (r = t + n), new nt([e], ue(O({}, s), {
|
|
150
150
|
startHeight: t,
|
|
151
151
|
endHeight: r
|
|
152
152
|
}));
|
|
153
153
|
};
|
|
154
154
|
class Jt extends K {
|
|
155
155
|
constructor(e) {
|
|
156
|
-
super(), this.options =
|
|
156
|
+
super(), this.options = O({}, e);
|
|
157
157
|
}
|
|
158
158
|
create() {
|
|
159
159
|
const i = this.options, {
|
|
@@ -171,12 +171,12 @@ class Jt extends K {
|
|
|
171
171
|
]);
|
|
172
172
|
let f = e;
|
|
173
173
|
if (!f && n)
|
|
174
|
-
f = De(
|
|
174
|
+
f = De(O({
|
|
175
175
|
coordinate: n
|
|
176
176
|
}, a));
|
|
177
177
|
else if (!f && t) {
|
|
178
178
|
const h = t.map(
|
|
179
|
-
(o) => De(
|
|
179
|
+
(o) => De(O({
|
|
180
180
|
coordinate: o
|
|
181
181
|
}, a))
|
|
182
182
|
);
|
|
@@ -194,10 +194,10 @@ const Bt = {
|
|
|
194
194
|
LineCurve: ht,
|
|
195
195
|
LineCurve3: ut,
|
|
196
196
|
QuadraticBezierCurve: ft,
|
|
197
|
-
QuadraticBezierCurve3:
|
|
198
|
-
SplineCurve:
|
|
197
|
+
QuadraticBezierCurve3: dt,
|
|
198
|
+
SplineCurve: mt
|
|
199
199
|
};
|
|
200
|
-
class Q extends
|
|
200
|
+
class Q extends me {
|
|
201
201
|
/**
|
|
202
202
|
* Constructs a new extrude geometry.
|
|
203
203
|
*
|
|
@@ -224,21 +224,21 @@ class Q extends de {
|
|
|
224
224
|
var Te, Ge, _e;
|
|
225
225
|
const i = [], h = t.curveSegments !== void 0 ? t.curveSegments : 12, o = t.steps !== void 0 ? t.steps : 1, c = t.depth !== void 0 ? t.depth : 1;
|
|
226
226
|
let g = t.bevelEnabled !== void 0 ? t.bevelEnabled : !0, u = t.bevelThickness !== void 0 ? t.bevelThickness : 0.2, y = t.bevelSize !== void 0 ? t.bevelSize : u - 0.1, L = t.bevelOffset !== void 0 ? t.bevelOffset : 0, S = t.bevelSegments !== void 0 ? t.bevelSegments : 3;
|
|
227
|
-
const A = t.extrudePath, P = t.UVGenerator !== void 0 ? t.UVGenerator :
|
|
227
|
+
const A = t.extrudePath, P = t.UVGenerator !== void 0 ? t.UVGenerator : Ot, v = (Te = t.hasTop) != null ? Te : !0, C = (Ge = t.hasBottom) != null ? Ge : !0, ee = (_e = t.hasSide) != null ? _e : !0;
|
|
228
228
|
let X, Z = !1, R, se, oe, V;
|
|
229
229
|
A && (X = A.getSpacedPoints(o), Z = !0, g = !1, R = A.computeFrenetFrames(o, !1), se = new z(), oe = new z(), V = new z()), g || (S = 0, u = 0, y = 0, L = 0);
|
|
230
230
|
const ve = f.extractPoints(h);
|
|
231
|
-
let
|
|
231
|
+
let U = ve.shape;
|
|
232
232
|
const j = ve.holes;
|
|
233
|
-
if (!fe.isClockWise(
|
|
234
|
-
|
|
235
|
-
for (let l = 0,
|
|
236
|
-
const
|
|
237
|
-
fe.isClockWise(
|
|
233
|
+
if (!fe.isClockWise(U)) {
|
|
234
|
+
U = U.reverse();
|
|
235
|
+
for (let l = 0, d = j.length; l < d; l++) {
|
|
236
|
+
const m = j[l];
|
|
237
|
+
fe.isClockWise(m) && (j[l] = m.reverse());
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
function Se(l) {
|
|
241
|
-
const
|
|
241
|
+
const m = 10000000000000001e-36;
|
|
242
242
|
let x = l[0];
|
|
243
243
|
for (let b = 1; b <= l.length; b++) {
|
|
244
244
|
const M = b % l.length, w = l[M], T = w.x - x.x, G = w.y - x.y, _ = T * T + G * G, I = Math.max(
|
|
@@ -246,7 +246,7 @@ class Q extends de {
|
|
|
246
246
|
Math.abs(w.y),
|
|
247
247
|
Math.abs(x.x),
|
|
248
248
|
Math.abs(x.y)
|
|
249
|
-
), J =
|
|
249
|
+
), J = m * I * I;
|
|
250
250
|
if (_ <= J) {
|
|
251
251
|
l.splice(M, 1), b--;
|
|
252
252
|
continue;
|
|
@@ -254,23 +254,23 @@ class Q extends de {
|
|
|
254
254
|
x = w;
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
|
-
Se(
|
|
258
|
-
const pe = j.length, D =
|
|
257
|
+
Se(U), j.forEach(Se);
|
|
258
|
+
const pe = j.length, D = U;
|
|
259
259
|
for (let l = 0; l < pe; l++) {
|
|
260
|
-
const
|
|
261
|
-
|
|
260
|
+
const d = j[l];
|
|
261
|
+
U = U.concat(d);
|
|
262
262
|
}
|
|
263
|
-
function te(l,
|
|
264
|
-
return
|
|
263
|
+
function te(l, d, m) {
|
|
264
|
+
return d || error("ExtrudeGeometry: vec does not exist"), l.clone().addScaledVector(d, m);
|
|
265
265
|
}
|
|
266
|
-
const W =
|
|
267
|
-
function Ae(l,
|
|
266
|
+
const W = U.length;
|
|
267
|
+
function Ae(l, d, m) {
|
|
268
268
|
let x, b, M;
|
|
269
|
-
const w = l.x -
|
|
269
|
+
const w = l.x - d.x, T = l.y - d.y, G = m.x - l.x, _ = m.y - l.y, I = w * w + T * T, J = w * _ - T * G;
|
|
270
270
|
if (Math.abs(J) > Number.EPSILON) {
|
|
271
271
|
const B = Math.sqrt(I), Ee = Math.sqrt(
|
|
272
272
|
G * G + _ * _
|
|
273
|
-
), Pe =
|
|
273
|
+
), Pe = d.x - T / B, ze = d.y + w / B, Ze = m.x - _ / Ee, $e = m.y + G / Ee, Ce = ((Ze - Pe) * _ - ($e - ze) * G) / (w * _ - T * G);
|
|
274
274
|
x = Pe + w * Ce - l.x, b = ze + T * Ce - l.y;
|
|
275
275
|
const je = x * x + b * b;
|
|
276
276
|
if (je <= 2)
|
|
@@ -283,24 +283,24 @@ class Q extends de {
|
|
|
283
283
|
return new E(x / M, b / M);
|
|
284
284
|
}
|
|
285
285
|
const re = [];
|
|
286
|
-
for (let l = 0,
|
|
287
|
-
|
|
286
|
+
for (let l = 0, d = D.length, m = d - 1, x = l + 1; l < d; l++, m++, x++)
|
|
287
|
+
m === d && (m = 0), x === d && (x = 0), re[l] = Ae(D[l], D[m], D[x]);
|
|
288
288
|
const ge = [];
|
|
289
289
|
let q, ae = re.concat();
|
|
290
|
-
for (let l = 0,
|
|
291
|
-
const
|
|
290
|
+
for (let l = 0, d = pe; l < d; l++) {
|
|
291
|
+
const m = j[l];
|
|
292
292
|
q = [];
|
|
293
|
-
for (let x = 0, b =
|
|
294
|
-
M === b && (M = 0), w === b && (w = 0), q[x] = Ae(
|
|
293
|
+
for (let x = 0, b = m.length, M = b - 1, w = x + 1; x < b; x++, M++, w++)
|
|
294
|
+
M === b && (M = 0), w === b && (w = 0), q[x] = Ae(m[x], m[M], m[w]);
|
|
295
295
|
ge.push(q), ae = ae.concat(q);
|
|
296
296
|
}
|
|
297
297
|
let $;
|
|
298
298
|
if (S === 0)
|
|
299
299
|
$ = fe.triangulateShape(D, j);
|
|
300
300
|
else {
|
|
301
|
-
const l = [],
|
|
302
|
-
for (let
|
|
303
|
-
const x =
|
|
301
|
+
const l = [], d = [];
|
|
302
|
+
for (let m = 0; m < S; m++) {
|
|
303
|
+
const x = m / S, b = u * Math.cos(x * Math.PI / 2), M = y * Math.sin(x * Math.PI / 2) + L;
|
|
304
304
|
for (let w = 0, T = D.length; w < T; w++) {
|
|
305
305
|
const G = te(D[w], re[w], M);
|
|
306
306
|
N(G.x, G.y, -b), x === 0 && l.push(G);
|
|
@@ -313,29 +313,29 @@ class Q extends de {
|
|
|
313
313
|
const B = te(G[I], q[I], M);
|
|
314
314
|
N(B.x, B.y, -b), x === 0 && _.push(B);
|
|
315
315
|
}
|
|
316
|
-
x === 0 &&
|
|
316
|
+
x === 0 && d.push(_);
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
319
|
$ = fe.triangulateShape(
|
|
320
320
|
l,
|
|
321
|
-
|
|
321
|
+
d
|
|
322
322
|
);
|
|
323
323
|
}
|
|
324
324
|
const ce = $.length, Me = y + L;
|
|
325
325
|
for (let l = 0; l < W; l++) {
|
|
326
|
-
const
|
|
327
|
-
Z ? (oe.copy(R.normals[0]).multiplyScalar(
|
|
326
|
+
const d = g ? te(U[l], ae[l], Me) : U[l];
|
|
327
|
+
Z ? (oe.copy(R.normals[0]).multiplyScalar(d.x), se.copy(R.binormals[0]).multiplyScalar(d.y), V.copy(X[0]).add(oe).add(se), N(V.x, V.y, V.z)) : N(d.x, d.y, 0);
|
|
328
328
|
}
|
|
329
329
|
for (let l = 1; l <= o; l++)
|
|
330
|
-
for (let
|
|
331
|
-
const
|
|
332
|
-
Z ? (oe.copy(R.normals[l]).multiplyScalar(
|
|
330
|
+
for (let d = 0; d < W; d++) {
|
|
331
|
+
const m = g ? te(U[d], ae[d], Me) : U[d];
|
|
332
|
+
Z ? (oe.copy(R.normals[l]).multiplyScalar(m.x), se.copy(R.binormals[l]).multiplyScalar(m.y), V.copy(X[l]).add(oe).add(se), N(V.x, V.y, V.z)) : N(m.x, m.y, c / o * l);
|
|
333
333
|
}
|
|
334
334
|
for (let l = S - 1; l >= 0; l--) {
|
|
335
|
-
const
|
|
335
|
+
const d = l / S, m = u * Math.cos(d * Math.PI / 2), x = y * Math.sin(d * Math.PI / 2) + L;
|
|
336
336
|
for (let b = 0, M = D.length; b < M; b++) {
|
|
337
337
|
const w = te(D[b], re[b], x);
|
|
338
|
-
N(w.x, w.y, c +
|
|
338
|
+
N(w.x, w.y, c + m);
|
|
339
339
|
}
|
|
340
340
|
for (let b = 0, M = j.length; b < M; b++) {
|
|
341
341
|
const w = j[b];
|
|
@@ -345,8 +345,8 @@ class Q extends de {
|
|
|
345
345
|
Z ? N(
|
|
346
346
|
_.x,
|
|
347
347
|
_.y + X[o - 1].y,
|
|
348
|
-
X[o - 1].x +
|
|
349
|
-
) : N(_.x, _.y, c +
|
|
348
|
+
X[o - 1].x + m
|
|
349
|
+
) : N(_.x, _.y, c + m);
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
352
|
}
|
|
@@ -354,30 +354,30 @@ class Q extends de {
|
|
|
354
354
|
function Fe() {
|
|
355
355
|
const l = s.length / 3;
|
|
356
356
|
if (g) {
|
|
357
|
-
let
|
|
357
|
+
let d = 0, m = W * d;
|
|
358
358
|
if (C)
|
|
359
359
|
for (let x = 0; x < ce; x++) {
|
|
360
360
|
const b = $[x];
|
|
361
|
-
le(b[2] +
|
|
361
|
+
le(b[2] + m, b[1] + m, b[0] + m);
|
|
362
362
|
}
|
|
363
|
-
if (
|
|
363
|
+
if (d = o + S * 2, m = W * d, v)
|
|
364
364
|
for (let x = 0; x < ce; x++) {
|
|
365
365
|
const b = $[x];
|
|
366
|
-
le(b[0] +
|
|
366
|
+
le(b[0] + m, b[1] + m, b[2] + m);
|
|
367
367
|
}
|
|
368
368
|
} else {
|
|
369
369
|
if (C)
|
|
370
|
-
for (let
|
|
371
|
-
const
|
|
372
|
-
le(
|
|
370
|
+
for (let d = 0; d < ce; d++) {
|
|
371
|
+
const m = $[d];
|
|
372
|
+
le(m[2], m[1], m[0]);
|
|
373
373
|
}
|
|
374
374
|
if (v)
|
|
375
|
-
for (let
|
|
376
|
-
const
|
|
375
|
+
for (let d = 0; d < ce; d++) {
|
|
376
|
+
const m = $[d];
|
|
377
377
|
le(
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
378
|
+
m[0] + W * o,
|
|
379
|
+
m[1] + W * o,
|
|
380
|
+
m[2] + W * o
|
|
381
381
|
);
|
|
382
382
|
}
|
|
383
383
|
}
|
|
@@ -385,31 +385,31 @@ class Q extends de {
|
|
|
385
385
|
}
|
|
386
386
|
function qe() {
|
|
387
387
|
const l = s.length / 3;
|
|
388
|
-
let
|
|
389
|
-
Le(D,
|
|
390
|
-
for (let
|
|
391
|
-
const b = j[
|
|
392
|
-
Le(b,
|
|
388
|
+
let d = 0;
|
|
389
|
+
Le(D, d), d += D.length;
|
|
390
|
+
for (let m = 0, x = j.length; m < x; m++) {
|
|
391
|
+
const b = j[m];
|
|
392
|
+
Le(b, d), d += b.length;
|
|
393
393
|
}
|
|
394
394
|
n.addGroup(l, s.length / 3 - l, 1);
|
|
395
395
|
}
|
|
396
|
-
function Le(l,
|
|
397
|
-
let
|
|
398
|
-
for (; --
|
|
399
|
-
const x =
|
|
400
|
-
let b =
|
|
396
|
+
function Le(l, d) {
|
|
397
|
+
let m = l.length;
|
|
398
|
+
for (; --m >= 0; ) {
|
|
399
|
+
const x = m;
|
|
400
|
+
let b = m - 1;
|
|
401
401
|
b < 0 && (b = l.length - 1);
|
|
402
402
|
for (let M = 0, w = o + S * 2; M < w; M++) {
|
|
403
|
-
const T = W * M, G = W * (M + 1), _ =
|
|
403
|
+
const T = W * M, G = W * (M + 1), _ = d + x + T, I = d + b + T, J = d + b + G, B = d + x + G;
|
|
404
404
|
Ye(_, I, J, B);
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
|
-
function N(l,
|
|
409
|
-
i.push(l), i.push(
|
|
408
|
+
function N(l, d, m) {
|
|
409
|
+
i.push(l), i.push(d), i.push(m);
|
|
410
410
|
}
|
|
411
|
-
function le(l,
|
|
412
|
-
k(l), k(
|
|
411
|
+
function le(l, d, m) {
|
|
412
|
+
k(l), k(d), k(m);
|
|
413
413
|
const x = s.length / 3, b = P.generateTopUV(
|
|
414
414
|
n,
|
|
415
415
|
s,
|
|
@@ -419,8 +419,8 @@ class Q extends de {
|
|
|
419
419
|
);
|
|
420
420
|
F(b[0]), F(b[1]), F(b[2]);
|
|
421
421
|
}
|
|
422
|
-
function Ye(l,
|
|
423
|
-
k(l), k(
|
|
422
|
+
function Ye(l, d, m, x) {
|
|
423
|
+
k(l), k(d), k(x), k(d), k(m), k(x);
|
|
424
424
|
const b = s.length / 3, M = P.generateSideWallUV(
|
|
425
425
|
n,
|
|
426
426
|
s,
|
|
@@ -444,7 +444,7 @@ class Q extends de {
|
|
|
444
444
|
}
|
|
445
445
|
toJSON() {
|
|
446
446
|
const e = super.toJSON(), t = this.parameters.shapes, n = this.parameters.options;
|
|
447
|
-
return
|
|
447
|
+
return Ut(t, n, e);
|
|
448
448
|
}
|
|
449
449
|
/**
|
|
450
450
|
* Factory method for creating an instance of this class from the given
|
|
@@ -466,7 +466,7 @@ class Q extends de {
|
|
|
466
466
|
)), new Q(n, e.options);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
const
|
|
469
|
+
const Ot = {
|
|
470
470
|
generateTopUV: function(p, e, t, n, s) {
|
|
471
471
|
const r = e[t * 3], a = e[t * 3 + 1], f = e[n * 3], i = e[n * 3 + 1], h = e[s * 3], o = e[s * 3 + 1];
|
|
472
472
|
return [
|
|
@@ -490,7 +490,7 @@ const Ut = {
|
|
|
490
490
|
];
|
|
491
491
|
}
|
|
492
492
|
};
|
|
493
|
-
function
|
|
493
|
+
function Ut(p, e, t) {
|
|
494
494
|
if (t.shapes = [], Array.isArray(p))
|
|
495
495
|
for (let n = 0, s = p.length; n < s; n++) {
|
|
496
496
|
const r = p[n];
|
|
@@ -504,7 +504,7 @@ class Rt extends Q {
|
|
|
504
504
|
constructor(e, t) {
|
|
505
505
|
super(e, t);
|
|
506
506
|
const n = new Re(
|
|
507
|
-
new Q(e, ue(
|
|
507
|
+
new Q(e, ue(O({}, t), {
|
|
508
508
|
hasTop: !0,
|
|
509
509
|
hasSide: !0,
|
|
510
510
|
hasBottom: !1
|
|
@@ -555,7 +555,7 @@ class Rt extends Q {
|
|
|
555
555
|
g.geometry.setAttribute("uv", y);
|
|
556
556
|
}
|
|
557
557
|
u.needsUpdate = !0;
|
|
558
|
-
const L = new Q(e, ue(
|
|
558
|
+
const L = new Q(e, ue(O({}, t), {
|
|
559
559
|
hasTop: !1
|
|
560
560
|
})), S = H([g.geometry, L], 2);
|
|
561
561
|
this.copy(S.toNonIndexed());
|
|
@@ -590,7 +590,7 @@ const He = (p) => {
|
|
|
590
590
|
};
|
|
591
591
|
class Qt extends K {
|
|
592
592
|
constructor(e) {
|
|
593
|
-
super(), this.options =
|
|
593
|
+
super(), this.options = O({
|
|
594
594
|
depth: 1
|
|
595
595
|
}, e);
|
|
596
596
|
}
|
|
@@ -677,6 +677,13 @@ class en extends K {
|
|
|
677
677
|
create() {
|
|
678
678
|
this.createGroup();
|
|
679
679
|
}
|
|
680
|
+
render() {
|
|
681
|
+
this.object3d.raycast = (e, t) => e.intersectObjects(
|
|
682
|
+
this.object3d.children,
|
|
683
|
+
!0,
|
|
684
|
+
t
|
|
685
|
+
);
|
|
686
|
+
}
|
|
680
687
|
}
|
|
681
688
|
class tn extends K {
|
|
682
689
|
constructor(e) {
|
|
@@ -741,7 +748,7 @@ class tn extends K {
|
|
|
741
748
|
e.target && this.pencil.scene.remove(e.target), super.dispose();
|
|
742
749
|
}
|
|
743
750
|
}
|
|
744
|
-
class Dt extends
|
|
751
|
+
class Dt extends me {
|
|
745
752
|
constructor(e = [], t = "none", n) {
|
|
746
753
|
super(), this.type = "MeshLineGeometry", this.pointCount = 0, this._points = [], this.shape = "none", this.shapeFunction = (s) => 1, this.matrixWorld = new We(), this.shape = t, n && (this.shapeFunction = n), e.length > 0 && this.setPoints(e);
|
|
747
754
|
}
|
|
@@ -864,10 +871,10 @@ function nn(p, e) {
|
|
|
864
871
|
const be = (p) => {
|
|
865
872
|
const { setPointWidth: e, nodes: t } = p, n = new Dt();
|
|
866
873
|
return n.setPoints(t, e), n;
|
|
867
|
-
}, Xe = /* @__PURE__ */ new WeakMap(),
|
|
874
|
+
}, Xe = /* @__PURE__ */ new WeakMap(), de = /* @__PURE__ */ new Map();
|
|
868
875
|
let sn = class extends K {
|
|
869
876
|
constructor(e = {}) {
|
|
870
|
-
super(), this.options =
|
|
877
|
+
super(), this.options = O({}, e);
|
|
871
878
|
}
|
|
872
879
|
get material() {
|
|
873
880
|
var e;
|
|
@@ -913,7 +920,7 @@ let sn = class extends K {
|
|
|
913
920
|
s.geometry = n, r.dispose();
|
|
914
921
|
}
|
|
915
922
|
getMaterial(e) {
|
|
916
|
-
const { width: t, height: n } = this.pencil.getSize(), s = new st(
|
|
923
|
+
const { width: t, height: n } = this.pencil.getSize(), s = new st(O({
|
|
917
924
|
color: new ke("#ffffff")
|
|
918
925
|
}, e));
|
|
919
926
|
return s.uniforms.resolution.value.set(t, n), s;
|
|
@@ -942,7 +949,7 @@ let sn = class extends K {
|
|
|
942
949
|
onComplete: f,
|
|
943
950
|
startShow: i
|
|
944
951
|
} = {}) {
|
|
945
|
-
const { offset: h, offsetLoop: o } = this.material.uniforms, c = this.pencil.userData.debugLine ?
|
|
952
|
+
const { offset: h, offsetLoop: o } = this.material.uniforms, c = this.pencil.userData.debugLine ? de : Xe;
|
|
946
953
|
if (c.get(this.material) && this.stopAnimation(), e === 0) return;
|
|
947
954
|
const g = s != null ? s : !0;
|
|
948
955
|
h.value.x = 1, o.value = g && i ? 1 : 0;
|
|
@@ -956,11 +963,11 @@ let sn = class extends K {
|
|
|
956
963
|
}).start();
|
|
957
964
|
c.set(this.material, y), this.material.addEventListener("dispose", () => {
|
|
958
965
|
this.stopAnimation();
|
|
959
|
-
}), this.pencil.userData.debugLine && console.log("animate",
|
|
966
|
+
}), this.pencil.userData.debugLine && console.log("animate", de.size);
|
|
960
967
|
}
|
|
961
968
|
stopAnimation() {
|
|
962
|
-
const e = this.pencil.userData.debugLine ?
|
|
963
|
-
t && (t.stop(), ne.remove(t), e.delete(this.material), this.material.uniforms.offset.value.x = 0, this.material.uniforms.offsetLoop.value = 1), this.pencil.userData.debugLine && console.log("stopAnimation",
|
|
969
|
+
const e = this.pencil.userData.debugLine ? de : Xe, t = e.get(this.material);
|
|
970
|
+
t && (t.stop(), ne.remove(t), e.delete(this.material), this.material.uniforms.offset.value.x = 0, this.material.uniforms.offsetLoop.value = 1), this.pencil.userData.debugLine && console.log("stopAnimation", de.size);
|
|
964
971
|
}
|
|
965
972
|
render() {
|
|
966
973
|
const { width: e, height: t } = this.pencil.getSize();
|
|
@@ -969,11 +976,11 @@ let sn = class extends K {
|
|
|
969
976
|
};
|
|
970
977
|
const Ve = (p) => {
|
|
971
978
|
const { points: e } = p, t = e.reduce((s, r, a) => (a < e.length - 1 && s.push(r, e[a + 1]), s), []);
|
|
972
|
-
return new
|
|
979
|
+
return new me().setFromPoints(t);
|
|
973
980
|
};
|
|
974
981
|
class rn extends K {
|
|
975
982
|
constructor(e = {}) {
|
|
976
|
-
super(), this.options =
|
|
983
|
+
super(), this.options = O({}, e);
|
|
977
984
|
}
|
|
978
985
|
get material() {
|
|
979
986
|
var e;
|
|
@@ -1016,14 +1023,14 @@ class rn extends K {
|
|
|
1016
1023
|
});
|
|
1017
1024
|
}
|
|
1018
1025
|
getMaterial(e) {
|
|
1019
|
-
return new et(
|
|
1026
|
+
return new et(O({
|
|
1020
1027
|
color: new ke("#ffffff")
|
|
1021
1028
|
}, e));
|
|
1022
1029
|
}
|
|
1023
1030
|
}
|
|
1024
1031
|
class an extends K {
|
|
1025
1032
|
constructor(e) {
|
|
1026
|
-
super(), this.options =
|
|
1033
|
+
super(), this.options = O({
|
|
1027
1034
|
maxDepth: 10,
|
|
1028
1035
|
percentDepth: !1,
|
|
1029
1036
|
innerRadius: 25,
|
|
@@ -1093,7 +1100,7 @@ export {
|
|
|
1093
1100
|
Dt as MeshLineGeometry,
|
|
1094
1101
|
st as MeshLineMaterial,
|
|
1095
1102
|
nn as MeshLineRaycast,
|
|
1096
|
-
|
|
1103
|
+
mn as Node,
|
|
1097
1104
|
an as Pie,
|
|
1098
1105
|
nt as getConicPolygonGeometry,
|
|
1099
1106
|
pn as getConicPolygonGeometryMetas,
|