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.
@@ -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, Ue = 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, U = (p, e) => {
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
- Ue.call(e, t) && Ie(p, t, e[t]);
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 && Ue.call(p, n) && (t[n] = p[n]);
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 dn, g as pn } from "../index.module2.js";
44
- import { BufferGeometry as de, 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 mt, SplineCurve as dt, 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 Oe, mergeGroups as _t } from "three/examples/jsm/utils/BufferGeometryUtils";
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 de();
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 = Oe(r[o]);
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 = Oe(u);
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(U({}, s), {
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 = U({}, e);
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(U({
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(U({
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: mt,
198
- SplineCurve: dt
197
+ QuadraticBezierCurve3: dt,
198
+ SplineCurve: mt
199
199
  };
200
- class Q extends de {
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 : Ut, v = (Te = t.hasTop) != null ? Te : !0, C = (Ge = t.hasBottom) != null ? Ge : !0, ee = (_e = t.hasSide) != null ? _e : !0;
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 O = ve.shape;
231
+ let U = ve.shape;
232
232
  const j = ve.holes;
233
- if (!fe.isClockWise(O)) {
234
- O = O.reverse();
235
- for (let l = 0, m = j.length; l < m; l++) {
236
- const d = j[l];
237
- fe.isClockWise(d) && (j[l] = d.reverse());
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 d = 10000000000000001e-36;
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 = d * I * I;
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(O), j.forEach(Se);
258
- const pe = j.length, D = O;
257
+ Se(U), j.forEach(Se);
258
+ const pe = j.length, D = U;
259
259
  for (let l = 0; l < pe; l++) {
260
- const m = j[l];
261
- O = O.concat(m);
260
+ const d = j[l];
261
+ U = U.concat(d);
262
262
  }
263
- function te(l, m, d) {
264
- return m || error("ExtrudeGeometry: vec does not exist"), l.clone().addScaledVector(m, d);
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 = O.length;
267
- function Ae(l, m, d) {
266
+ const W = U.length;
267
+ function Ae(l, d, m) {
268
268
  let x, b, M;
269
- const w = l.x - m.x, T = l.y - m.y, G = d.x - l.x, _ = d.y - l.y, I = w * w + T * T, J = w * _ - T * G;
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 = m.x - T / B, ze = m.y + w / B, Ze = d.x - _ / Ee, $e = d.y + G / Ee, Ce = ((Ze - Pe) * _ - ($e - ze) * G) / (w * _ - T * G);
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, m = D.length, d = m - 1, x = l + 1; l < m; l++, d++, x++)
287
- d === m && (d = 0), x === m && (x = 0), re[l] = Ae(D[l], D[d], D[x]);
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, m = pe; l < m; l++) {
291
- const d = j[l];
290
+ for (let l = 0, d = pe; l < d; l++) {
291
+ const m = j[l];
292
292
  q = [];
293
- for (let x = 0, b = d.length, M = b - 1, w = x + 1; x < b; x++, M++, w++)
294
- M === b && (M = 0), w === b && (w = 0), q[x] = Ae(d[x], d[M], d[w]);
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 = [], m = [];
302
- for (let d = 0; d < S; d++) {
303
- const x = d / S, b = u * Math.cos(x * Math.PI / 2), M = y * Math.sin(x * Math.PI / 2) + L;
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 && m.push(_);
316
+ x === 0 && d.push(_);
317
317
  }
318
318
  }
319
319
  $ = fe.triangulateShape(
320
320
  l,
321
- m
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 m = g ? te(O[l], ae[l], Me) : O[l];
327
- Z ? (oe.copy(R.normals[0]).multiplyScalar(m.x), se.copy(R.binormals[0]).multiplyScalar(m.y), V.copy(X[0]).add(oe).add(se), N(V.x, V.y, V.z)) : N(m.x, m.y, 0);
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 m = 0; m < W; m++) {
331
- const d = g ? te(O[m], ae[m], Me) : O[m];
332
- Z ? (oe.copy(R.normals[l]).multiplyScalar(d.x), se.copy(R.binormals[l]).multiplyScalar(d.y), V.copy(X[l]).add(oe).add(se), N(V.x, V.y, V.z)) : N(d.x, d.y, c / o * l);
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 m = l / S, d = u * Math.cos(m * Math.PI / 2), x = y * Math.sin(m * Math.PI / 2) + L;
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 + d);
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 + d
349
- ) : N(_.x, _.y, c + d);
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 m = 0, d = W * m;
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] + d, b[1] + d, b[0] + d);
361
+ le(b[2] + m, b[1] + m, b[0] + m);
362
362
  }
363
- if (m = o + S * 2, d = W * m, v)
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] + d, b[1] + d, b[2] + d);
366
+ le(b[0] + m, b[1] + m, b[2] + m);
367
367
  }
368
368
  } else {
369
369
  if (C)
370
- for (let m = 0; m < ce; m++) {
371
- const d = $[m];
372
- le(d[2], d[1], d[0]);
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 m = 0; m < ce; m++) {
376
- const d = $[m];
375
+ for (let d = 0; d < ce; d++) {
376
+ const m = $[d];
377
377
  le(
378
- d[0] + W * o,
379
- d[1] + W * o,
380
- d[2] + W * o
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 m = 0;
389
- Le(D, m), m += D.length;
390
- for (let d = 0, x = j.length; d < x; d++) {
391
- const b = j[d];
392
- Le(b, m), m += b.length;
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, m) {
397
- let d = l.length;
398
- for (; --d >= 0; ) {
399
- const x = d;
400
- let b = d - 1;
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), _ = m + x + T, I = m + b + T, J = m + b + G, B = m + x + G;
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, m, d) {
409
- i.push(l), i.push(m), i.push(d);
408
+ function N(l, d, m) {
409
+ i.push(l), i.push(d), i.push(m);
410
410
  }
411
- function le(l, m, d) {
412
- k(l), k(m), k(d);
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, m, d, x) {
423
- k(l), k(m), k(x), k(m), k(d), k(x);
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 Ot(t, n, e);
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 Ut = {
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 Ot(p, e, t) {
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(U({}, t), {
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(U({}, t), {
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 = U({
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 de {
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(), me = /* @__PURE__ */ new Map();
874
+ }, Xe = /* @__PURE__ */ new WeakMap(), de = /* @__PURE__ */ new Map();
868
875
  let sn = class extends K {
869
876
  constructor(e = {}) {
870
- super(), this.options = U({}, e);
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(U({
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 ? me : Xe;
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", me.size);
966
+ }), this.pencil.userData.debugLine && console.log("animate", de.size);
960
967
  }
961
968
  stopAnimation() {
962
- const e = this.pencil.userData.debugLine ? me : Xe, t = e.get(this.material);
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", me.size);
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 de().setFromPoints(t);
979
+ return new me().setFromPoints(t);
973
980
  };
974
981
  class rn extends K {
975
982
  constructor(e = {}) {
976
- super(), this.options = U({}, e);
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(U({
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 = U({
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
- dn as Node,
1103
+ mn as Node,
1097
1104
  an as Pie,
1098
1105
  nt as getConicPolygonGeometry,
1099
1106
  pn as getConicPolygonGeometryMetas,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gl-draw",
3
- "version": "0.17.0-beta.23",
3
+ "version": "0.17.0-beta.25",
4
4
  "author": "gitplus <hstits@gmail.com>",
5
5
  "scripts": {
6
6
  "start": "bundler-dev",