gl-draw 0.14.16 → 0.14.18

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.
@@ -49,7 +49,10 @@ export default class BaseObject extends ResourceTracker {
49
49
  instantiate(meta?: {
50
50
  position: THREE.Vector3 | number[] | [number, number, number];
51
51
  scale?: THREE.Vector3 | number[] | [number, number, number];
52
- }[], target?: IBaseObject): Promise<this>;
52
+ }[], ops?: {
53
+ target?: IBaseObject;
54
+ create?: ((...args: any[]) => any) | boolean;
55
+ }): Promise<this>;
53
56
  private setInstancedMatrix;
54
57
  erase(): void;
55
58
  cloneMaterial(): THREE.Material | THREE.Material[] | undefined;
@@ -1,32 +1,32 @@
1
- var pt = Object.defineProperty, dt = Object.defineProperties;
1
+ var dt = Object.defineProperty, pt = Object.defineProperties;
2
2
  var mt = Object.getOwnPropertyDescriptors;
3
3
  var X = Object.getOwnPropertySymbols;
4
4
  var vt = Object.prototype.hasOwnProperty, gt = Object.prototype.propertyIsEnumerable;
5
- var H = Math.pow, Y = (o, t, e) => t in o ? pt(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e, O = (o, t) => {
5
+ var H = Math.pow, Y = (a, t, e) => t in a ? dt(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e, O = (a, t) => {
6
6
  for (var e in t || (t = {}))
7
- vt.call(t, e) && Y(o, e, t[e]);
7
+ vt.call(t, e) && Y(a, e, t[e]);
8
8
  if (X)
9
9
  for (var e of X(t))
10
- gt.call(t, e) && Y(o, e, t[e]);
11
- return o;
12
- }, Z = (o, t) => dt(o, mt(t));
13
- var J = (o, t, e) => new Promise((i, s) => {
14
- var a = (r) => {
10
+ gt.call(t, e) && Y(a, e, t[e]);
11
+ return a;
12
+ }, Z = (a, t) => pt(a, mt(t));
13
+ var J = (a, t, e) => new Promise((i, s) => {
14
+ var r = (l) => {
15
15
  try {
16
- n(e.next(r));
17
- } catch (c) {
18
- s(c);
16
+ n(e.next(l));
17
+ } catch (o) {
18
+ s(o);
19
19
  }
20
- }, l = (r) => {
20
+ }, c = (l) => {
21
21
  try {
22
- n(e.throw(r));
23
- } catch (c) {
24
- s(c);
22
+ n(e.throw(l));
23
+ } catch (o) {
24
+ s(o);
25
25
  }
26
- }, n = (r) => r.done ? i(r.value) : Promise.resolve(r.value).then(a, l);
27
- n((e = e.apply(o, t)).next());
26
+ }, n = (l) => l.done ? i(l.value) : Promise.resolve(l.value).then(r, c);
27
+ n((e = e.apply(a, t)).next());
28
28
  });
29
- import * as u from "three";
29
+ import * as h from "three";
30
30
  import { Vector4 as k, Vector3 as B, Matrix4 as bt, Line3 as yt, Box3 as xt, Sphere as Mt, Mesh as wt, InstancedInterleavedBuffer as Pt, InterleavedBufferAttribute as tt, MathUtils as jt } from "three";
31
31
  import { CSS2DObject as At } from "three/examples/jsm/renderers/CSS2DRenderer";
32
32
  import { CSS3DObject as St, CSS3DSprite as Ct } from "three/examples/jsm/renderers/CSS3DRenderer";
@@ -50,22 +50,22 @@ class V {
50
50
  return t;
51
51
  if (Array.isArray(t))
52
52
  return t.forEach((e) => this.track(e)), t;
53
- if (!this.disposeWithMaterial && t instanceof u.Material)
53
+ if (!this.disposeWithMaterial && t instanceof h.Material)
54
54
  return t;
55
- if (t instanceof V ? (t === this && t.object3d ? this.track(t.object3d) : (t.disposeTrack = !1, this.resources.add(t)), Object.values(t.materialList).map((e) => this.track(e))) : (t instanceof u.Object3D || Reflect.has(t, "dispose")) && this.resources.add(t), t instanceof V)
55
+ if (t instanceof V ? (t === this && t.object3d ? this.track(t.object3d) : (t.disposeTrack = !1, this.resources.add(t)), Object.values(t.materialList).map((e) => this.track(e))) : (t instanceof h.Object3D || Reflect.has(t, "dispose")) && this.resources.add(t), t instanceof V)
56
56
  this.track(t.children);
57
- else if (t instanceof u.Object3D) {
57
+ else if (t instanceof h.Object3D) {
58
58
  const e = t;
59
59
  this.track(e.geometry), this.track(e.material), this.track(e.children);
60
- } else if (t instanceof u.Material) {
60
+ } else if (t instanceof h.Material) {
61
61
  for (const i of Object.values(t))
62
- i instanceof u.Texture && this.track(i);
62
+ i instanceof h.Texture && this.track(i);
63
63
  const e = t;
64
64
  if (e.uniforms) {
65
65
  for (const i of Object.values(e.uniforms))
66
66
  if (i) {
67
67
  const s = i.value;
68
- (s instanceof u.Texture || Array.isArray(s)) && this.track(s);
68
+ (s instanceof h.Texture || Array.isArray(s)) && this.track(s);
69
69
  }
70
70
  }
71
71
  }
@@ -74,22 +74,22 @@ class V {
74
74
  dispose() {
75
75
  const t = [];
76
76
  for (const e of this.resources)
77
- e instanceof u.Object3D && t.push(e), Reflect.has(e, "dispose") && e.dispose();
77
+ e instanceof h.Object3D && t.push(e), Reflect.has(e, "dispose") && e.dispose();
78
78
  t.forEach((e) => {
79
79
  e.removeFromParent();
80
80
  }), t.length = 0, this.resources.clear();
81
81
  }
82
82
  }
83
- const Et = (o, t = 1) => {
84
- const e = new u.BufferGeometry();
83
+ const Et = (a, t = 1) => {
84
+ const e = new h.BufferGeometry();
85
85
  e.setAttribute(
86
86
  "position",
87
- new u.Float32BufferAttribute(new Array(t * 3).fill(0), 3)
87
+ new h.Float32BufferAttribute(new Array(t * 3).fill(0), 3)
88
88
  ), e.setAttribute(
89
89
  "scaleAtt",
90
- new u.Float32BufferAttribute(new Array(t).fill(1), 1)
90
+ new h.Float32BufferAttribute(new Array(t).fill(1), 1)
91
91
  );
92
- const i = o.material, s = new u.PointsMaterial({
92
+ const i = a.material, s = new h.PointsMaterial({
93
93
  size: 10,
94
94
  map: i.map,
95
95
  alphaMap: i.alphaMap,
@@ -102,15 +102,15 @@ const Et = (o, t = 1) => {
102
102
  alphaTest: i.alphaTest,
103
103
  sizeAttenuation: !1
104
104
  });
105
- return s.onBeforeCompile = (a) => {
106
- a.vertexShader = `
105
+ return s.onBeforeCompile = (r) => {
106
+ r.vertexShader = `
107
107
  attribute float scaleAtt;
108
- ${a.vertexShader.replace(
108
+ ${r.vertexShader.replace(
109
109
  "gl_PointSize = size;",
110
110
  "gl_PointSize = size * scaleAtt;"
111
111
  )}
112
112
  `;
113
- }, new u.Points(e, s);
113
+ }, new h.Points(e, s);
114
114
  };
115
115
  class Rt extends V {
116
116
  constructor() {
@@ -169,13 +169,13 @@ class Rt extends V {
169
169
  return this.object3d.visible = !1, this;
170
170
  }
171
171
  createMesh(...t) {
172
- return this.object3d = new u.Mesh(...t), this;
172
+ return this.object3d = new h.Mesh(...t), this;
173
173
  }
174
174
  createGroup() {
175
- return this.object3d = new u.Group(), this;
175
+ return this.object3d = new h.Group(), this;
176
176
  }
177
177
  createPoints(...t) {
178
- return this.object3d = new u.Points(...t), this;
178
+ return this.object3d = new h.Points(...t), this;
179
179
  }
180
180
  createCSS2DObject(t) {
181
181
  return this.object3d = new At(t), this;
@@ -187,7 +187,7 @@ class Rt extends V {
187
187
  return this.object3d = new Ct(t), this;
188
188
  }
189
189
  createSprite(t) {
190
- return this.object3d = new u.Sprite(t), this;
190
+ return this.object3d = new h.Sprite(t), this;
191
191
  }
192
192
  attach(...t) {
193
193
  return [...t].forEach((e) => {
@@ -195,12 +195,12 @@ class Rt extends V {
195
195
  }), this;
196
196
  }
197
197
  getSize() {
198
- const t = new u.Box3().setFromObject(this.object3d);
198
+ const t = new h.Box3().setFromObject(this.object3d);
199
199
  return {
200
200
  min: t.min,
201
201
  max: t.max,
202
- size: t.getSize(new u.Vector3()),
203
- center: t.getCenter(new u.Vector3())
202
+ size: t.getSize(new h.Vector3()),
203
+ center: t.getCenter(new h.Vector3())
204
204
  };
205
205
  }
206
206
  traverse(t) {
@@ -213,49 +213,56 @@ class Rt extends V {
213
213
  }
214
214
  instantiate(t, e) {
215
215
  return J(this, null, function* () {
216
- const i = t && t.length > 0, { objectType: s, objectOptions: a } = this, [, l] = s.split("#"), n = yield this.lead.draw(l, Z(O({}, a || {}), {
217
- create: (r) => {
218
- var c;
219
- if (this.object3d) {
220
- if (i) {
221
- const p = t.length;
222
- if (this.object3d instanceof u.Sprite)
223
- r.object3d = Et(this.object3d, p);
224
- else {
225
- const d = this.object3d;
226
- r.object3d = new u.InstancedMesh(
227
- d.geometry,
228
- d.material,
229
- p
230
- ), r.setMaterialList("instantiate", "clone"), r.useMaterial("instantiate");
231
- }
232
- const f = new u.Object3D();
233
- t.forEach((d, h) => {
234
- const v = et(d.position), m = et(d.scale || [1, 1, 1]);
235
- f.position.copy(v), f.scale.copy(m), f.updateMatrix(), r.setInstancedMatrix(h, f.matrix.clone());
236
- });
237
- } else
238
- r.object3d = this.object3d.clone(!1), r.setMaterialList("instantiate", "clone"), r.useMaterial("instantiate");
239
- r.object3d.userData.bloom && ((c = this.pencil.composerController) == null || c.toggleBloomSelection(
240
- r.object3d,
241
- !0
242
- )), r.object3d.userData.prefab && (r.object3d.userData.prefab = !1);
243
- }
244
- },
216
+ const i = t && t.length > 0, { objectType: s, objectOptions: r } = this, [, c] = s.split("#");
217
+ let n = e == null ? void 0 : e.create;
218
+ n === void 0 && (n = (o) => {
219
+ var d;
220
+ if (this.object3d) {
221
+ if (i) {
222
+ const f = t.length;
223
+ if (this.object3d instanceof h.Sprite)
224
+ o.object3d = Et(this.object3d, f);
225
+ else {
226
+ const u = this.object3d;
227
+ o.object3d = new h.InstancedMesh(
228
+ u.geometry,
229
+ u.material,
230
+ f
231
+ ), o.setMaterialList("instantiate", "clone"), o.useMaterial("instantiate");
232
+ }
233
+ const m = new h.Object3D();
234
+ t.forEach((u, v) => {
235
+ const p = et(u.position), b = et(u.scale || [1, 1, 1]);
236
+ m.position.copy(p), m.scale.copy(b), m.updateMatrix(), o.setInstancedMatrix(v, m.matrix.clone());
237
+ });
238
+ } else
239
+ o.object3d = this.object3d.clone(!1), o.setMaterialList("instantiate", "clone"), o.useMaterial("instantiate");
240
+ o.object3d.userData.bloom && ((d = this.pencil.composerController) == null || d.toggleBloomSelection(
241
+ o.object3d,
242
+ !0
243
+ )), o.object3d.userData.prefab && (o.object3d.userData.prefab = !1);
244
+ }
245
+ });
246
+ const l = yield this.lead.draw(c, Z(O({}, r || {}), {
247
+ create: n,
245
248
  prefab: !1,
246
- target: e || (a == null ? void 0 : a.target)
249
+ target: (e == null ? void 0 : e.target) || (r == null ? void 0 : r.target)
247
250
  }));
248
251
  return yield Promise.all(
249
- this.children.map((r) => r.instantiate(void 0, n))
250
- ), n.isInstantiate = !0, n;
252
+ this.children.map(
253
+ (o) => o.instantiate(void 0, {
254
+ target: l
255
+ })
256
+ )
257
+ ), l.isInstantiate = !0, l;
251
258
  });
252
259
  }
253
260
  setInstancedMatrix(t, e) {
254
- if (this.object3d instanceof u.InstancedMesh || this.object3d.isInstantiate)
261
+ if (this.object3d instanceof h.InstancedMesh || this.object3d.isInstantiate)
255
262
  this.object3d.setMatrixAt(t, e);
256
- else if (this.object3d instanceof u.Points || this.object3d.type === "Points") {
257
- const s = this.object3d.geometry, a = s.attributes.position.array, l = s.attributes.scaleAtt.array, n = new u.Vector3(), r = new u.Vector3(), c = new u.Quaternion(), p = t * 3, f = t * 1;
258
- e.decompose(n, c, r), a[p] = n.x, a[p + 1] = n.y, a[p + 2] = n.z, l[f] = Math.max(r.x, r.y, r.z), s.attributes.position.needsUpdate = !0, s.attributes.scaleAtt.needsUpdate = !0;
263
+ else if (this.object3d instanceof h.Points || this.object3d.type === "Points") {
264
+ const s = this.object3d.geometry, r = s.attributes.position.array, c = s.attributes.scaleAtt.array, n = new h.Vector3(), l = new h.Vector3(), o = new h.Quaternion(), d = t * 3, f = t * 1;
265
+ e.decompose(n, o, l), r[d] = n.x, r[d + 1] = n.y, r[d + 2] = n.z, c[f] = Math.max(l.x, l.y, l.z), s.attributes.position.needsUpdate = !0, s.attributes.scaleAtt.needsUpdate = !0;
259
266
  }
260
267
  }
261
268
  erase() {
@@ -270,8 +277,8 @@ class Rt extends V {
270
277
  return e.map((i) => {
271
278
  const s = i.userData;
272
279
  i.userData = {};
273
- const a = i.clone();
274
- return i.userData = s, a;
280
+ const r = i.clone();
281
+ return i.userData = s, r;
275
282
  });
276
283
  {
277
284
  const i = e.userData;
@@ -286,12 +293,12 @@ class Rt extends V {
286
293
  return;
287
294
  if (this.materialList.origin || (this.materialList.origin = s.material), this.materialList[t])
288
295
  if (i) {
289
- const l = this.materialList[t], n = new V();
290
- n.track(l), n.dispose();
296
+ const c = this.materialList[t], n = new V();
297
+ n.track(c), n.dispose();
291
298
  } else
292
299
  return this.materialList[t];
293
- const a = e === "clone" ? this.cloneMaterial() : e;
294
- return this.materialList[t] = a, a;
300
+ const r = e === "clone" ? this.cloneMaterial() : e;
301
+ return this.materialList[t] = r, r;
295
302
  }
296
303
  useMaterial(t) {
297
304
  const e = this.object3d;
@@ -320,19 +327,19 @@ class fe extends Rt {
320
327
  }
321
328
  const $ = new k(), nt = new B(), rt = new B(), y = new k(), x = new k(), I = new k(), q = new B(), N = new bt(), M = new yt(), at = new B(), R = new xt(), U = new Mt(), T = new k();
322
329
  let W, L;
323
- function ot(o, t, e) {
324
- return T.set(0, 0, -t, 1).applyMatrix4(o.projectionMatrix), T.multiplyScalar(1 / T.w), T.x = L / e.width, T.y = L / e.height, T.applyMatrix4(o.projectionMatrixInverse), T.multiplyScalar(1 / T.w), Math.abs(Math.max(T.x, T.y));
330
+ function ot(a, t, e) {
331
+ return T.set(0, 0, -t, 1).applyMatrix4(a.projectionMatrix), T.multiplyScalar(1 / T.w), T.x = L / e.width, T.y = L / e.height, T.applyMatrix4(a.projectionMatrixInverse), T.multiplyScalar(1 / T.w), Math.abs(Math.max(T.x, T.y));
325
332
  }
326
- function Ut(o, t) {
327
- const e = o.matrixWorld, i = o.geometry, s = i.attributes.instanceStart, a = i.attributes.instanceEnd, l = Math.min(i.instanceCount, s.count);
328
- for (let n = 0, r = l; n < r; n++) {
329
- M.start.fromBufferAttribute(s, n), M.end.fromBufferAttribute(a, n), M.applyMatrix4(e);
330
- const c = new B(), p = new B();
331
- W.distanceSqToSegment(M.start, M.end, p, c), p.distanceTo(c) < L * 0.5 && t.push({
332
- point: p,
333
- pointOnLine: c,
334
- distance: W.origin.distanceTo(p),
335
- object: o,
333
+ function Ut(a, t) {
334
+ const e = a.matrixWorld, i = a.geometry, s = i.attributes.instanceStart, r = i.attributes.instanceEnd, c = Math.min(i.instanceCount, s.count);
335
+ for (let n = 0, l = c; n < l; n++) {
336
+ M.start.fromBufferAttribute(s, n), M.end.fromBufferAttribute(r, n), M.applyMatrix4(e);
337
+ const o = new B(), d = new B();
338
+ W.distanceSqToSegment(M.start, M.end, d, o), d.distanceTo(o) < L * 0.5 && t.push({
339
+ point: d,
340
+ pointOnLine: o,
341
+ distance: W.origin.distanceTo(d),
342
+ object: a,
336
343
  face: null,
337
344
  faceIndex: n,
338
345
  uv: null,
@@ -340,11 +347,11 @@ function Ut(o, t) {
340
347
  });
341
348
  }
342
349
  }
343
- function Gt(o, t, e) {
344
- const i = t.projectionMatrix, a = o.material.resolution, l = o.matrixWorld, n = o.geometry, r = n.attributes.instanceStart, c = n.attributes.instanceEnd, p = Math.min(n.instanceCount, r.count), f = -t.near;
345
- W.at(1, I), I.w = 1, I.applyMatrix4(t.matrixWorldInverse), I.applyMatrix4(i), I.multiplyScalar(1 / I.w), I.x *= a.x / 2, I.y *= a.y / 2, I.z = 0, q.copy(I), N.multiplyMatrices(t.matrixWorldInverse, l);
346
- for (let d = 0, h = p; d < h; d++) {
347
- if (y.fromBufferAttribute(r, d), x.fromBufferAttribute(c, d), y.w = 1, x.w = 1, y.applyMatrix4(N), x.applyMatrix4(N), y.z > f && x.z > f)
350
+ function Gt(a, t, e) {
351
+ const i = t.projectionMatrix, r = a.material.resolution, c = a.matrixWorld, n = a.geometry, l = n.attributes.instanceStart, o = n.attributes.instanceEnd, d = Math.min(n.instanceCount, l.count), f = -t.near;
352
+ W.at(1, I), I.w = 1, I.applyMatrix4(t.matrixWorldInverse), I.applyMatrix4(i), I.multiplyScalar(1 / I.w), I.x *= r.x / 2, I.y *= r.y / 2, I.z = 0, q.copy(I), N.multiplyMatrices(t.matrixWorldInverse, c);
353
+ for (let m = 0, u = d; m < u; m++) {
354
+ if (y.fromBufferAttribute(l, m), x.fromBufferAttribute(o, m), y.w = 1, x.w = 1, y.applyMatrix4(N), x.applyMatrix4(N), y.z > f && x.z > f)
348
355
  continue;
349
356
  if (y.z > f) {
350
357
  const D = y.z - x.z, P = (y.z - f) / D;
@@ -353,46 +360,46 @@ function Gt(o, t, e) {
353
360
  const D = x.z - y.z, P = (x.z - f) / D;
354
361
  x.lerp(y, P);
355
362
  }
356
- y.applyMatrix4(i), x.applyMatrix4(i), y.multiplyScalar(1 / y.w), x.multiplyScalar(1 / x.w), y.x *= a.x / 2, y.y *= a.y / 2, x.x *= a.x / 2, x.y *= a.y / 2, M.start.copy(y), M.start.z = 0, M.end.copy(x), M.end.z = 0;
357
- const m = M.closestPointToPointParameter(q, !0);
358
- M.at(m, at);
359
- const b = jt.lerp(y.z, x.z, m), C = b >= -1 && b <= 1, z = q.distanceTo(at) < L * 0.5;
363
+ y.applyMatrix4(i), x.applyMatrix4(i), y.multiplyScalar(1 / y.w), x.multiplyScalar(1 / x.w), y.x *= r.x / 2, y.y *= r.y / 2, x.x *= r.x / 2, x.y *= r.y / 2, M.start.copy(y), M.start.z = 0, M.end.copy(x), M.end.z = 0;
364
+ const p = M.closestPointToPointParameter(q, !0);
365
+ M.at(p, at);
366
+ const b = jt.lerp(y.z, x.z, p), C = b >= -1 && b <= 1, z = q.distanceTo(at) < L * 0.5;
360
367
  if (C && z) {
361
- M.start.fromBufferAttribute(r, d), M.end.fromBufferAttribute(c, d), M.start.applyMatrix4(l), M.end.applyMatrix4(l);
368
+ M.start.fromBufferAttribute(l, m), M.end.fromBufferAttribute(o, m), M.start.applyMatrix4(c), M.end.applyMatrix4(c);
362
369
  const D = new B(), P = new B();
363
370
  W.distanceSqToSegment(M.start, M.end, P, D), e.push({
364
371
  point: P,
365
372
  pointOnLine: D,
366
373
  distance: W.origin.distanceTo(P),
367
- object: o,
374
+ object: a,
368
375
  face: null,
369
- faceIndex: d,
376
+ faceIndex: m,
370
377
  uv: null,
371
378
  uv1: null
372
379
  });
373
380
  }
374
381
  }
375
382
  }
376
- class pe extends wt {
383
+ class de extends wt {
377
384
  constructor(t = new Wt(), e) {
378
385
  super(t, e), this.isLineSegments2 = !0, this.type = "LineSegments2";
379
386
  }
380
387
  // for backwards-compatibility, but could be a method of LineSegmentsGeometry...
381
388
  computeLineDistances() {
382
389
  const t = this.geometry, e = t.attributes.instanceStart, i = t.attributes.instanceEnd, s = new Float32Array(2 * e.count);
383
- for (let l = 0, n = 0, r = e.count; l < r; l++, n += 2)
384
- nt.fromBufferAttribute(e, l), rt.fromBufferAttribute(i, l), s[n] = n === 0 ? 0 : s[n - 1], s[n + 1] = s[n] + nt.distanceTo(rt);
385
- const a = new Pt(
390
+ for (let c = 0, n = 0, l = e.count; c < l; c++, n += 2)
391
+ nt.fromBufferAttribute(e, c), rt.fromBufferAttribute(i, c), s[n] = n === 0 ? 0 : s[n - 1], s[n + 1] = s[n] + nt.distanceTo(rt);
392
+ const r = new Pt(
386
393
  s,
387
394
  2,
388
395
  1
389
396
  );
390
397
  return t.setAttribute(
391
398
  "instanceDistanceStart",
392
- new tt(a, 1, 0)
399
+ new tt(r, 1, 0)
393
400
  ), t.setAttribute(
394
401
  "instanceDistanceEnd",
395
- new tt(a, 1, 1)
402
+ new tt(r, 1, 1)
396
403
  ), this;
397
404
  }
398
405
  raycast(t, e) {
@@ -400,42 +407,42 @@ class pe extends wt {
400
407
  s === null && !i && console.error(
401
408
  'LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.'
402
409
  );
403
- const a = t.params.Line2 !== void 0 && t.params.Line2.threshold || 0;
410
+ const r = t.params.Line2 !== void 0 && t.params.Line2.threshold || 0;
404
411
  W = t.ray;
405
- const l = this.matrixWorld, n = this.geometry, r = this.material;
406
- L = r.linewidth + a, n.boundingSphere === null && n.computeBoundingSphere(), U.copy(n.boundingSphere).applyMatrix4(l);
407
- let c;
412
+ const c = this.matrixWorld, n = this.geometry, l = this.material;
413
+ L = l.linewidth + r, n.boundingSphere === null && n.computeBoundingSphere(), U.copy(n.boundingSphere).applyMatrix4(c);
414
+ let o;
408
415
  if (i)
409
- c = L * 0.5;
416
+ o = L * 0.5;
410
417
  else {
411
418
  const f = Math.max(
412
419
  s.near,
413
420
  U.distanceToPoint(W.origin)
414
421
  );
415
- c = ot(
422
+ o = ot(
416
423
  s,
417
424
  f,
418
- r.resolution
425
+ l.resolution
419
426
  );
420
427
  }
421
- if (U.radius += c, W.intersectsSphere(U) === !1)
428
+ if (U.radius += o, W.intersectsSphere(U) === !1)
422
429
  return;
423
- n.boundingBox === null && n.computeBoundingBox(), R.copy(n.boundingBox).applyMatrix4(l);
424
- let p;
430
+ n.boundingBox === null && n.computeBoundingBox(), R.copy(n.boundingBox).applyMatrix4(c);
431
+ let d;
425
432
  if (i)
426
- p = L * 0.5;
433
+ d = L * 0.5;
427
434
  else {
428
435
  const f = Math.max(
429
436
  s.near,
430
437
  R.distanceToPoint(W.origin)
431
438
  );
432
- p = ot(
439
+ d = ot(
433
440
  s,
434
441
  f,
435
- r.resolution
442
+ l.resolution
436
443
  );
437
444
  }
438
- R.expandByScalar(p), W.intersectsBox(R) !== !1 && (i ? Ut(this, e) : Gt(this, s, e));
445
+ R.expandByScalar(d), W.intersectsBox(R) !== !1 && (i ? Ut(this, e) : Gt(this, s, e));
439
446
  }
440
447
  onBeforeRender(t) {
441
448
  const e = this.material.uniforms;
@@ -590,22 +597,22 @@ const lt = ["encodings_fragment", "colorspace_fragment"], Ft = (
590
597
 
591
598
  #include <fog_fragment>
592
599
  #include <tonemapping_fragment>
593
- #include <${+u.REVISION < 154 ? lt[0] : lt[1]}>
600
+ #include <${+h.REVISION < 154 ? lt[0] : lt[1]}>
594
601
  }
595
602
  `
596
603
  );
597
- class de extends u.ShaderMaterial {
604
+ class pe extends h.ShaderMaterial {
598
605
  constructor(t) {
599
606
  super({
600
- uniforms: Z(O({}, u.UniformsLib.fog), {
607
+ uniforms: Z(O({}, h.UniformsLib.fog), {
601
608
  lineWidth: { value: 1 },
602
609
  map: { value: null },
603
610
  useMap: { value: 0 },
604
611
  alphaMap: { value: null },
605
612
  useAlphaMap: { value: 0 },
606
- color: { value: new u.Color(16777215) },
613
+ color: { value: new h.Color(16777215) },
607
614
  opacity: { value: 1 },
608
- resolution: { value: new u.Vector2(1, 1) },
615
+ resolution: { value: new h.Vector2(1, 1) },
609
616
  sizeAttenuation: { value: 1 },
610
617
  dashArray: { value: 0 },
611
618
  dashOffset: { value: 0 },
@@ -614,16 +621,16 @@ class de extends u.ShaderMaterial {
614
621
  useDepth: { value: 0 },
615
622
  visibility: { value: 1 },
616
623
  alphaTest: { value: 0 },
617
- repeat: { value: new u.Vector2(1, 1) },
618
- offset: { value: new u.Vector2(0, 0) },
624
+ repeat: { value: new h.Vector2(1, 1) },
625
+ offset: { value: new h.Vector2(0, 0) },
619
626
  offsetLoop: { value: 1 },
620
627
  lineLightAnimation: { value: 0 },
621
628
  time: { value: 0 },
622
629
  size: { value: 300 },
623
630
  speed: { value: 0.3 },
624
631
  lightWidth: { value: 0.1 },
625
- uCenter: { value: new u.Vector2(0, 0) },
626
- lightColor: { value: new u.Color(16777215) }
632
+ uCenter: { value: new h.Vector2(0, 0) },
633
+ lightColor: { value: new h.Color(16777215) }
627
634
  }),
628
635
  vertexShader: Ft,
629
636
  fragmentShader: Zt
@@ -850,58 +857,58 @@ class de extends u.ShaderMaterial {
850
857
  return super.copy(t), this.lineWidth = t.lineWidth, this.map = t.map, this.useMap = t.useMap, this.alphaMap = t.alphaMap, this.useAlphaMap = t.useAlphaMap, this.color.copy(t.color), this.opacity = t.opacity, this.resolution.copy(t.resolution), this.sizeAttenuation = t.sizeAttenuation, this.dashArray = t.dashArray, this.dashOffset = t.dashOffset, this.dashRatio = t.dashRatio, this.useDash = t.useDash, this.visibility = t.visibility, this.alphaTest = t.alphaTest, this.repeat.copy(t.repeat), this;
851
858
  }
852
859
  }
853
- function $t(o, t) {
854
- return o.map((e) => {
860
+ function $t(a, t) {
861
+ return a.map((e) => {
855
862
  const i = [];
856
863
  let s;
857
- return e.forEach((a) => {
864
+ return e.forEach((r) => {
858
865
  if (s) {
859
- const l = Dt(a, s) * 180 / Math.PI;
860
- if (l > t) {
861
- const n = It(s, a), r = 1 / Math.ceil(l / t);
862
- let c = r;
863
- for (; c < 1; )
864
- i.push(n(c)), c += r;
866
+ const c = Dt(r, s) * 180 / Math.PI;
867
+ if (c > t) {
868
+ const n = It(s, r), l = 1 / Math.ceil(c / t);
869
+ let o = l;
870
+ for (; o < 1; )
871
+ i.push(n(o)), o += l;
865
872
  }
866
873
  }
867
- i.push(s = a);
874
+ i.push(s = r);
868
875
  }), i;
869
876
  });
870
877
  }
871
- function qt(o, { minLng: t, maxLng: e, minLat: i, maxLat: s } = {}) {
872
- const a = Math.round(H(360 / o, 2) / Math.PI), l = (1 + Math.sqrt(5)) / 2, n = (h) => h / l * 360 % 360 - 180, r = (h) => Math.acos(2 * h / a - 1) / Math.PI * 180 - 90, c = (h) => a * (Math.cos((h + 90) * Math.PI / 180) + 1) / 2, p = [
873
- s !== void 0 ? Math.ceil(c(s)) : 0,
874
- i !== void 0 ? Math.floor(c(i)) : a - 1
875
- ], f = t === void 0 && e === void 0 ? () => !0 : t === void 0 ? (h) => h <= e : e === void 0 ? (h) => h >= t : e >= t ? (h) => h >= t && h <= e : (h) => h >= t || h <= e, d = [];
876
- for (let h = p[0]; h <= p[1]; h++) {
877
- const v = n(h);
878
- f(v) && d.push([v, r(h)]);
878
+ function qt(a, { minLng: t, maxLng: e, minLat: i, maxLat: s } = {}) {
879
+ const r = Math.round(H(360 / a, 2) / Math.PI), c = (1 + Math.sqrt(5)) / 2, n = (u) => u / c * 360 % 360 - 180, l = (u) => Math.acos(2 * u / r - 1) / Math.PI * 180 - 90, o = (u) => r * (Math.cos((u + 90) * Math.PI / 180) + 1) / 2, d = [
880
+ s !== void 0 ? Math.ceil(o(s)) : 0,
881
+ i !== void 0 ? Math.floor(o(i)) : r - 1
882
+ ], f = t === void 0 && e === void 0 ? () => !0 : t === void 0 ? (u) => u <= e : e === void 0 ? (u) => u >= t : e >= t ? (u) => u >= t && u <= e : (u) => u >= t || u <= e, m = [];
883
+ for (let u = d[0]; u <= d[1]; u++) {
884
+ const v = n(u);
885
+ f(v) && m.push([v, l(u)]);
879
886
  }
880
- return d;
887
+ return m;
881
888
  }
882
- function Q(o, t, e = !1) {
883
- return e ? zt(t, o) : Vt(o, t);
889
+ function Q(a, t, e = !1) {
890
+ return e ? zt(t, a) : Vt(a, t);
884
891
  }
885
- function Nt(o, t) {
886
- const e = { type: "Polygon", coordinates: o }, [[i, s], [a, l]] = ht(e);
887
- if (Math.min(Math.abs(a - i), Math.abs(l - s)) < t)
892
+ function Nt(a, t) {
893
+ const e = { type: "Polygon", coordinates: a }, [[i, s], [r, c]] = ht(e);
894
+ if (Math.min(Math.abs(r - i), Math.abs(c - s)) < t)
888
895
  return [];
889
- const n = i > a || l >= 89 || s <= -89;
896
+ const n = i > r || c >= 89 || s <= -89;
890
897
  return qt(t, {
891
898
  minLng: i,
892
- maxLng: a,
899
+ maxLng: r,
893
900
  minLat: s,
894
- maxLat: l
901
+ maxLat: c
895
902
  }).filter(
896
- (r) => Q(r, e, n)
903
+ (l) => Q(l, e, n)
897
904
  );
898
905
  }
899
- function Qt(o, { resolution: t = 1 / 0, bbox: e, projection: i } = {}) {
900
- const s = $t(o, t), a = K(s), l = Nt(o, t), n = [...a, ...l], r = { type: "Polygon", coordinates: o }, [[c, p], [f, d]] = ht(r), h = c > f || // crosses antimeridian
901
- d >= 89 || // crosses north pole
902
- p <= -89;
906
+ function Qt(a, { resolution: t = 1 / 0, bbox: e, projection: i } = {}) {
907
+ const s = $t(a, t), r = K(s), c = Nt(a, t), n = [...r, ...c], l = { type: "Polygon", coordinates: a }, [[o, d], [f, m]] = ht(l), u = o > f || // crosses antimeridian
908
+ m >= 89 || // crosses north pole
909
+ d <= -89;
903
910
  let v = [];
904
- if (h) {
911
+ if (u) {
905
912
  const g = kt(n).triangles(), w = new Map(
906
913
  n.map(([j, A], _) => [`${j}-${A}`, _])
907
914
  );
@@ -911,30 +918,30 @@ function Qt(o, { resolution: t = 1 / 0, bbox: e, projection: i } = {}) {
911
918
  const E = `${S}-${F}`;
912
919
  w.has(E) && _.push(w.get(E));
913
920
  }), _.length === 3) {
914
- if (_.some((S) => S < a.length)) {
921
+ if (_.some((S) => S < r.length)) {
915
922
  const S = j.properties.circumcenter;
916
923
  if (!Q(
917
924
  S,
918
- r,
919
- h
925
+ l,
926
+ u
920
927
  ))
921
928
  return;
922
929
  }
923
930
  v.push(..._);
924
931
  }
925
932
  });
926
- } else if (l.length) {
933
+ } else if (c.length) {
927
934
  const g = Ot.from(n);
928
935
  for (let w = 0, j = g.triangles.length; w < j; w += 3) {
929
936
  const A = [2, 1, 0].map((S) => g.triangles[w + S]), _ = A.map((S) => n[S]);
930
- if (A.some((S) => S < a.length)) {
937
+ if (A.some((S) => S < r.length)) {
931
938
  const S = [0, 1].map(
932
939
  (F) => _t(_, (E) => E[F])
933
940
  );
934
941
  if (!Q(
935
942
  S,
936
- r,
937
- h
943
+ l,
944
+ u
938
945
  ))
939
946
  continue;
940
947
  }
@@ -944,12 +951,12 @@ function Qt(o, { resolution: t = 1 / 0, bbox: e, projection: i } = {}) {
944
951
  const { vertices: g, holes: w = [] } = ft(s);
945
952
  v = Bt(g, w, 2);
946
953
  }
947
- let m = e ? [e[0], e[2]] : it(n, (g) => g[0]), b = e ? [e[1], e[3]] : it(n, (g) => g[1]);
954
+ let p = e ? [e[0], e[2]] : it(n, (g) => g[0]), b = e ? [e[1], e[3]] : it(n, (g) => g[1]);
948
955
  if (i) {
949
- const [g, w] = i([m[0], b[0]]), [j, A] = i([m[1], b[1]]);
950
- m = [g, j], b = [-w, -A];
956
+ const [g, w] = i([p[0], b[0]]), [j, A] = i([p[1], b[1]]);
957
+ p = [g, j], b = [-w, -A];
951
958
  }
952
- const C = st(m, [0, 1]), z = st(b, [0, 1]), D = n.map(([g, w]) => {
959
+ const C = st(p, [0, 1]), z = st(b, [0, 1]), D = n.map(([g, w]) => {
953
960
  if (i) {
954
961
  const [j, A] = i([g, w]);
955
962
  return [C(j), z(-A)];
@@ -958,98 +965,98 @@ function Qt(o, { resolution: t = 1 / 0, bbox: e, projection: i } = {}) {
958
965
  });
959
966
  return { contour: s, triangles: { points: n, indices: v, uvs: D } };
960
967
  }
961
- const ct = new u.BufferGeometry().setAttribute ? "setAttribute" : "addAttribute";
962
- function G(o, t, e, i) {
963
- const s = o.map(
964
- (a) => a.map(([l, n]) => {
968
+ const ct = new h.BufferGeometry().setAttribute ? "setAttribute" : "addAttribute";
969
+ function G(a, t, e, i) {
970
+ const s = a.map(
971
+ (r) => r.map(([c, n]) => {
965
972
  if (i) {
966
- const [r, c] = i([l, n]);
967
- return [r, -c, t];
973
+ const [l, o] = i([c, n]);
974
+ return [l, -o, t];
968
975
  }
969
- return e ? Tt(l, n, t) : [l, n, t];
976
+ return e ? Tt(c, n, t) : [c, n, t];
970
977
  })
971
978
  );
972
979
  return ft(s);
973
980
  }
974
- function Kt(o, t, e, i, s) {
975
- const { vertices: a, holes: l } = G(
976
- o,
981
+ function Kt(a, t, e, i, s) {
982
+ const { vertices: r, holes: c } = G(
983
+ a,
977
984
  t,
978
985
  i,
979
986
  s
980
987
  ), { vertices: n } = G(
981
- o,
988
+ a,
982
989
  e,
983
990
  i,
984
991
  s
985
- ), r = K([n, a]), c = Math.round(n.length / 3), p = new Set(l);
992
+ ), l = K([n, r]), o = Math.round(n.length / 3), d = new Set(c);
986
993
  let f = 0;
987
- const d = [];
988
- for (let v = 0; v < c; v++) {
989
- let m = v + 1;
990
- if (m === c)
991
- m = f;
992
- else if (p.has(m)) {
993
- const b = m;
994
- m = f, f = b;
994
+ const m = [];
995
+ for (let v = 0; v < o; v++) {
996
+ let p = v + 1;
997
+ if (p === o)
998
+ p = f;
999
+ else if (d.has(p)) {
1000
+ const b = p;
1001
+ p = f, f = b;
995
1002
  }
996
- d.push(v, v + c, m + c), d.push(m + c, m, v);
1003
+ m.push(v, v + o, p + o), m.push(p + o, p, v);
997
1004
  }
998
- const h = [];
1005
+ const u = [];
999
1006
  for (let v = 1; v >= 0; v--)
1000
- for (let m = 0; m < c; m += 1) h.push(m / (c - 1), v);
1001
- return { indices: d, vertices: r, uvs: h, topVerts: n };
1007
+ for (let p = 0; p < o; p += 1) u.push(p / (o - 1), v);
1008
+ return { indices: m, vertices: l, uvs: u, topVerts: n };
1002
1009
  }
1003
- function ut(o, t, e, i, s, a) {
1010
+ function ut(a, t, e, i, s, r) {
1004
1011
  return {
1005
- indices: i ? o.indices : o.indices.slice().reverse(),
1012
+ indices: i ? a.indices : a.indices.slice().reverse(),
1006
1013
  vertices: G(
1007
- [o.points],
1014
+ [a.points],
1008
1015
  t,
1009
1016
  s,
1010
- a
1017
+ r
1011
1018
  ).vertices,
1012
1019
  uvs: e
1013
1020
  };
1014
1021
  }
1015
1022
  const Xt = ({
1016
- polygonGeoJson: o,
1023
+ polygonGeoJson: a,
1017
1024
  startHeight: t,
1018
1025
  endHeight: e,
1019
1026
  curvatureResolution: i = 1,
1020
1027
  cartesian: s = !0,
1021
- hasSide: a = !0,
1022
- hasBottom: l = !1,
1028
+ hasSide: r = !0,
1029
+ hasBottom: c = !1,
1023
1030
  hasTop: n = !1,
1024
- projection: r,
1025
- bbox: c
1031
+ projection: l,
1032
+ bbox: o
1026
1033
  }) => {
1027
- o.forEach((C) => {
1034
+ a.forEach((C) => {
1028
1035
  Lt(C) || C.reverse();
1029
1036
  });
1030
- const { contour: p, triangles: f } = Qt(o, {
1037
+ const { contour: d, triangles: f } = Qt(a, {
1031
1038
  resolution: i,
1032
- bbox: c,
1033
- projection: r
1039
+ bbox: o,
1040
+ projection: l
1034
1041
  });
1035
- let d = {}, h;
1036
- a && (d = Kt(
1037
- p,
1042
+ let m = {}, u;
1043
+ r && (m = Kt(
1044
+ d,
1038
1045
  t != null ? t : e,
1039
1046
  e != null ? e : t,
1040
1047
  s,
1041
- r
1042
- ), h = d.topVerts);
1048
+ l
1049
+ ), u = m.topVerts);
1043
1050
  let v = [];
1044
- (l || n) && (v = K(f.uvs));
1045
- let m = {};
1046
- l && (m = ut(
1051
+ (c || n) && (v = K(f.uvs));
1052
+ let p = {};
1053
+ c && (p = ut(
1047
1054
  f,
1048
1055
  t,
1049
1056
  v,
1050
1057
  !1,
1051
1058
  s,
1052
- r
1059
+ l
1053
1060
  ));
1054
1061
  let b = {};
1055
1062
  return n && (b = ut(
@@ -1058,10 +1065,10 @@ const Xt = ({
1058
1065
  v,
1059
1066
  !0,
1060
1067
  s,
1061
- r
1062
- )), { contour: p, triangles: f, sideTorso: d, bottomCap: m, topCap: b, topVerts: h };
1068
+ l
1069
+ )), { contour: d, triangles: f, sideTorso: m, bottomCap: p, topCap: b, topVerts: u };
1063
1070
  };
1064
- class me extends u.BufferGeometry {
1071
+ class me extends h.BufferGeometry {
1065
1072
  constructor(t, e = {}) {
1066
1073
  super(), this.type = "PolygonBufferGeometry", this.parameters = O({
1067
1074
  polygonGeoJson: t,
@@ -1078,13 +1085,13 @@ class me extends u.BufferGeometry {
1078
1085
  const {
1079
1086
  endHeight: i,
1080
1087
  hasTop: s,
1081
- topFirst: a,
1082
- hasBottom: l,
1088
+ topFirst: r,
1089
+ hasBottom: c,
1083
1090
  hasSide: n,
1084
- cartesian: r,
1085
- userDataRsoOffset: c,
1086
- projection: p
1087
- } = this.parameters, { contour: f, sideTorso: d, topVerts: h, bottomCap: v, topCap: m } = Xt(O({}, this.parameters));
1091
+ cartesian: l,
1092
+ userDataRsoOffset: o,
1093
+ projection: d
1094
+ } = this.parameters, { contour: f, sideTorso: m, topVerts: u, bottomCap: v, topCap: p } = Xt(O({}, this.parameters));
1088
1095
  let b = [], C = [], z = [], D = 0;
1089
1096
  const P = (g) => {
1090
1097
  const w = Math.round(b.length / 3), j = z.length;
@@ -1092,22 +1099,22 @@ class me extends u.BufferGeometry {
1092
1099
  w ? g.indices.map((A) => A + w) : g.indices
1093
1100
  ), this.addGroup(j, z.length - j, D++);
1094
1101
  };
1095
- s && a && P(m), n && (P(d), this.userData.topVerts = c ? G(
1102
+ s && r && P(p), n && (P(m), this.userData.topVerts = o ? G(
1096
1103
  f,
1097
- i + c,
1098
- r,
1099
- p
1100
- ).vertices : h), l && P(v), s && !a && P(m), this.setIndex(z), this[ct](
1104
+ i + o,
1105
+ l,
1106
+ d
1107
+ ).vertices : u), c && P(v), s && !r && P(p), this.setIndex(z), this[ct](
1101
1108
  "position",
1102
- new u.Float32BufferAttribute(b, 3)
1103
- ), this[ct]("uv", new u.Float32BufferAttribute(C, 2)), this.computeVertexNormals();
1109
+ new h.Float32BufferAttribute(b, 3)
1110
+ ), this[ct]("uv", new h.Float32BufferAttribute(C, 2)), this.computeVertexNormals();
1104
1111
  }
1105
1112
  }
1106
1113
  export {
1107
1114
  Rt as B,
1108
1115
  fe as G,
1109
- pe as L,
1110
- de as M,
1116
+ de as L,
1117
+ pe as M,
1111
1118
  me as P,
1112
1119
  V as R,
1113
1120
  Xt as g
package/dist/index2.js CHANGED
@@ -1,7 +1,7 @@
1
- "use strict";var dt=Object.defineProperty,pt=Object.defineProperties;var mt=Object.getOwnPropertyDescriptors;var Y=Object.getOwnPropertySymbols;var vt=Object.prototype.hasOwnProperty,gt=Object.prototype.propertyIsEnumerable;var tt=Math.pow,J=(r,t,e)=>t in r?dt(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,k=(r,t)=>{for(var e in t||(t={}))vt.call(t,e)&&J(r,e,t[e]);if(Y)for(var e of Y(t))gt.call(t,e)&&J(r,e,t[e]);return r},Z=(r,t)=>pt(r,mt(t));var et=(r,t,e)=>new Promise((i,s)=>{var o=a=>{try{n(e.next(a))}catch(c){s(c)}},l=a=>{try{n(e.throw(a))}catch(c){s(c)}},n=a=>a.done?i(a.value):Promise.resolve(a.value).then(o,l);n((e=e.apply(r,t)).next())});const g=require("three"),bt=require("three/examples/jsm/renderers/CSS2DRenderer"),it=require("three/examples/jsm/renderers/CSS3DRenderer"),E=require("d3-geo");require("d3-geo-projection");const H=require("./parseVector.js"),yt=require("three/examples/jsm/lines/LineSegmentsGeometry"),W=require("d3-array"),K=require("earcut"),xt=require("@turf/boolean-clockwise"),Mt=require("delaunator"),wt=require("@turf/boolean-point-in-polygon"),Pt=require("d3-geo-voronoi"),st=require("d3-scale");function jt(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(t,e,i.get?i:{enumerable:!0,get:()=>r[e]})}}return t.default=r,Object.freeze(t)}const u=jt(g);class B{constructor(){this.resources=new Set,this.disposeWithMaterial=!0,this.materialList={},this.disposeTrack=!0}track(t){if(!t||this.disposeTrack===!1)return t;if(Array.isArray(t))return t.forEach(e=>this.track(e)),t;if(!this.disposeWithMaterial&&t instanceof u.Material)return t;if(t instanceof B?(t===this&&t.object3d?this.track(t.object3d):(t.disposeTrack=!1,this.resources.add(t)),Object.values(t.materialList).map(e=>this.track(e))):(t instanceof u.Object3D||Reflect.has(t,"dispose"))&&this.resources.add(t),t instanceof B)this.track(t.children);else if(t instanceof u.Object3D){const e=t;this.track(e.geometry),this.track(e.material),this.track(e.children)}else if(t instanceof u.Material){for(const i of Object.values(t))i instanceof u.Texture&&this.track(i);const e=t;if(e.uniforms){for(const i of Object.values(e.uniforms))if(i){const s=i.value;(s instanceof u.Texture||Array.isArray(s))&&this.track(s)}}}return t}dispose(){const t=[];for(const e of this.resources)e instanceof u.Object3D&&t.push(e),Reflect.has(e,"dispose")&&e.dispose();t.forEach(e=>{e.removeFromParent()}),t.length=0,this.resources.clear()}}const At=(r,t=1)=>{const e=new u.BufferGeometry;e.setAttribute("position",new u.Float32BufferAttribute(new Array(t*3).fill(0),3)),e.setAttribute("scaleAtt",new u.Float32BufferAttribute(new Array(t).fill(1),1));const i=r.material,s=new u.PointsMaterial({size:10,map:i.map,alphaMap:i.alphaMap,color:i.color,blending:i.blending,depthTest:i.depthTest,depthWrite:!1,opacity:i.opacity,transparent:!0,alphaTest:i.alphaTest,sizeAttenuation:!1});return s.onBeforeCompile=o=>{o.vertexShader=`
1
+ "use strict";var dt=Object.defineProperty,pt=Object.defineProperties;var mt=Object.getOwnPropertyDescriptors;var Y=Object.getOwnPropertySymbols;var vt=Object.prototype.hasOwnProperty,gt=Object.prototype.propertyIsEnumerable;var tt=Math.pow,J=(n,t,e)=>t in n?dt(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,k=(n,t)=>{for(var e in t||(t={}))vt.call(t,e)&&J(n,e,t[e]);if(Y)for(var e of Y(t))gt.call(t,e)&&J(n,e,t[e]);return n},Z=(n,t)=>pt(n,mt(t));var et=(n,t,e)=>new Promise((i,s)=>{var a=l=>{try{r(e.next(l))}catch(o){s(o)}},c=l=>{try{r(e.throw(l))}catch(o){s(o)}},r=l=>l.done?i(l.value):Promise.resolve(l.value).then(a,c);r((e=e.apply(n,t)).next())});const g=require("three"),bt=require("three/examples/jsm/renderers/CSS2DRenderer"),it=require("three/examples/jsm/renderers/CSS3DRenderer"),E=require("d3-geo");require("d3-geo-projection");const H=require("./parseVector.js"),yt=require("three/examples/jsm/lines/LineSegmentsGeometry"),W=require("d3-array"),K=require("earcut"),xt=require("@turf/boolean-clockwise"),Mt=require("delaunator"),wt=require("@turf/boolean-point-in-polygon"),Pt=require("d3-geo-voronoi"),st=require("d3-scale");function jt(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(t,e,i.get?i:{enumerable:!0,get:()=>n[e]})}}return t.default=n,Object.freeze(t)}const h=jt(g);class B{constructor(){this.resources=new Set,this.disposeWithMaterial=!0,this.materialList={},this.disposeTrack=!0}track(t){if(!t||this.disposeTrack===!1)return t;if(Array.isArray(t))return t.forEach(e=>this.track(e)),t;if(!this.disposeWithMaterial&&t instanceof h.Material)return t;if(t instanceof B?(t===this&&t.object3d?this.track(t.object3d):(t.disposeTrack=!1,this.resources.add(t)),Object.values(t.materialList).map(e=>this.track(e))):(t instanceof h.Object3D||Reflect.has(t,"dispose"))&&this.resources.add(t),t instanceof B)this.track(t.children);else if(t instanceof h.Object3D){const e=t;this.track(e.geometry),this.track(e.material),this.track(e.children)}else if(t instanceof h.Material){for(const i of Object.values(t))i instanceof h.Texture&&this.track(i);const e=t;if(e.uniforms){for(const i of Object.values(e.uniforms))if(i){const s=i.value;(s instanceof h.Texture||Array.isArray(s))&&this.track(s)}}}return t}dispose(){const t=[];for(const e of this.resources)e instanceof h.Object3D&&t.push(e),Reflect.has(e,"dispose")&&e.dispose();t.forEach(e=>{e.removeFromParent()}),t.length=0,this.resources.clear()}}const At=(n,t=1)=>{const e=new h.BufferGeometry;e.setAttribute("position",new h.Float32BufferAttribute(new Array(t*3).fill(0),3)),e.setAttribute("scaleAtt",new h.Float32BufferAttribute(new Array(t).fill(1),1));const i=n.material,s=new h.PointsMaterial({size:10,map:i.map,alphaMap:i.alphaMap,color:i.color,blending:i.blending,depthTest:i.depthTest,depthWrite:!1,opacity:i.opacity,transparent:!0,alphaTest:i.alphaTest,sizeAttenuation:!1});return s.onBeforeCompile=a=>{a.vertexShader=`
2
2
  attribute float scaleAtt;
3
- ${o.vertexShader.replace("gl_PointSize = size;","gl_PointSize = size * scaleAtt;")}
4
- `},new u.Points(e,s)};class ht extends B{constructor(){super(...arguments),this.objectType="BaseObject",this.userData={},this.prefab=!1,this.isInstantiate=!1,this.materialList={},this.useMaterialType="origin",this.onPointerIndex=[]}get parent(){const t=this.object3d.parent;return t&&this.lead.objMap.get(t)||null}get children(){return this.object3d.children.map(t=>this.lead.objMap.get(t)).filter(t=>!!t)}get position(){return this.object3d.position}get rotation(){return this.object3d.rotation}get scale(){return this.object3d.scale}get add(){return this.object3d.add.bind(this.object3d)}get remove(){return this.object3d.remove.bind(this.object3d)}get visible(){return this.object3d.visible}get visibleWithAncestors(){if(this.visible){let t=this.parent;for(;t;){if(!t.visible)return!1;t=t.parent}return!0}else return!1}create(){this.createGroup()}render(){}update(t,e){}resize(t,e){}show(){return this.object3d.visible=!0,this}hide(){return this.object3d.visible=!1,this}createMesh(...t){return this.object3d=new u.Mesh(...t),this}createGroup(){return this.object3d=new u.Group,this}createPoints(...t){return this.object3d=new u.Points(...t),this}createCSS2DObject(t){return this.object3d=new bt.CSS2DObject(t),this}createCSS3DObject(t){return this.object3d=new it.CSS3DObject(t),this}createCSS3DSprite(t){return this.object3d=new it.CSS3DSprite(t),this}createSprite(t){return this.object3d=new u.Sprite(t),this}attach(...t){return[...t].forEach(e=>{this.object3d.attach(e.object3d)}),this}getSize(){const t=new u.Box3().setFromObject(this.object3d);return{min:t.min,max:t.max,size:t.getSize(new u.Vector3),center:t.getCenter(new u.Vector3)}}traverse(t){t(this),this.children.forEach(e=>{e.traverse(t)})}clone(){return this.instantiate()}instantiate(t,e){return et(this,null,function*(){const i=t&&t.length>0,{objectType:s,objectOptions:o}=this,[,l]=s.split("#"),n=yield this.lead.draw(l,Z(k({},o||{}),{create:a=>{var c;if(this.object3d){if(i){const d=t.length;if(this.object3d instanceof u.Sprite)a.object3d=At(this.object3d,d);else{const p=this.object3d;a.object3d=new u.InstancedMesh(p.geometry,p.material,d),a.setMaterialList("instantiate","clone"),a.useMaterial("instantiate")}const f=new u.Object3D;t.forEach((p,h)=>{const v=H.parseVector3(p.position),m=H.parseVector3(p.scale||[1,1,1]);f.position.copy(v),f.scale.copy(m),f.updateMatrix(),a.setInstancedMatrix(h,f.matrix.clone())})}else a.object3d=this.object3d.clone(!1),a.setMaterialList("instantiate","clone"),a.useMaterial("instantiate");a.object3d.userData.bloom&&((c=this.pencil.composerController)==null||c.toggleBloomSelection(a.object3d,!0)),a.object3d.userData.prefab&&(a.object3d.userData.prefab=!1)}},prefab:!1,target:e||(o==null?void 0:o.target)}));return yield Promise.all(this.children.map(a=>a.instantiate(void 0,n))),n.isInstantiate=!0,n})}setInstancedMatrix(t,e){if(this.object3d instanceof u.InstancedMesh||this.object3d.isInstantiate)this.object3d.setMatrixAt(t,e);else if(this.object3d instanceof u.Points||this.object3d.type==="Points"){const s=this.object3d.geometry,o=s.attributes.position.array,l=s.attributes.scaleAtt.array,n=new u.Vector3,a=new u.Vector3,c=new u.Quaternion,d=t*3,f=t*1;e.decompose(n,c,a),o[d]=n.x,o[d+1]=n.y,o[d+2]=n.z,l[f]=Math.max(a.x,a.y,a.z),s.attributes.position.needsUpdate=!0,s.attributes.scaleAtt.needsUpdate=!0}}erase(){this.dispose()}cloneMaterial(){const t=this.object3d;if(!t||!t.material)return;const e=t.material;if(Array.isArray(e))return e.map(i=>{const s=i.userData;i.userData={};const o=i.clone();return i.userData=s,o});{const i=e.userData;e.userData={};const s=e.clone();return e.userData=i,s}}setMaterialList(t,e,i=!0){const s=this.object3d;if(!s||!s.material)return;if(this.materialList.origin||(this.materialList.origin=s.material),this.materialList[t])if(i){const l=this.materialList[t],n=new B;n.track(l),n.dispose()}else return this.materialList[t];const o=e==="clone"?this.cloneMaterial():e;return this.materialList[t]=o,o}useMaterial(t){const e=this.object3d;!e||!e.material||this.useMaterialType===t||!this.materialList[t]||(this.useMaterialType=t,e.material=this.materialList[t])}setTop(t){this.object3d&&(this.object3d.renderOrder=t)}onPointerEvent(t,e){const i=this.lead.handlePick([this],t,e);this.onPointerIndex.push(i)}dispose(){this.onPointerIndex.forEach(t=>{this.lead.removePick(t)}),this.lead&&(this.lead.objects.delete(this.key),this.object3d&&this.lead.objMap.delete(this.object3d)),this.track(this),super.dispose()}disposeWithOutMaterial(){this.disposeWithMaterial=!1,this.dispose()}}class St extends ht{create(){this.createGroup()}}const $=new g.Vector4,nt=new g.Vector3,rt=new g.Vector3,x=new g.Vector4,M=new g.Vector4,I=new g.Vector4,N=new g.Vector3,Q=new g.Matrix4,w=new g.Line3,at=new g.Vector3,R=new g.Box3,U=new g.Sphere,T=new g.Vector4;let _,L;function ot(r,t,e){return T.set(0,0,-t,1).applyMatrix4(r.projectionMatrix),T.multiplyScalar(1/T.w),T.x=L/e.width,T.y=L/e.height,T.applyMatrix4(r.projectionMatrixInverse),T.multiplyScalar(1/T.w),Math.abs(Math.max(T.x,T.y))}function Ct(r,t){const e=r.matrixWorld,i=r.geometry,s=i.attributes.instanceStart,o=i.attributes.instanceEnd,l=Math.min(i.instanceCount,s.count);for(let n=0,a=l;n<a;n++){w.start.fromBufferAttribute(s,n),w.end.fromBufferAttribute(o,n),w.applyMatrix4(e);const c=new g.Vector3,d=new g.Vector3;_.distanceSqToSegment(w.start,w.end,d,c),d.distanceTo(c)<L*.5&&t.push({point:d,pointOnLine:c,distance:_.origin.distanceTo(d),object:r,face:null,faceIndex:n,uv:null,uv1:null})}}function Dt(r,t,e){const i=t.projectionMatrix,o=r.material.resolution,l=r.matrixWorld,n=r.geometry,a=n.attributes.instanceStart,c=n.attributes.instanceEnd,d=Math.min(n.instanceCount,a.count),f=-t.near;_.at(1,I),I.w=1,I.applyMatrix4(t.matrixWorldInverse),I.applyMatrix4(i),I.multiplyScalar(1/I.w),I.x*=o.x/2,I.y*=o.y/2,I.z=0,N.copy(I),Q.multiplyMatrices(t.matrixWorldInverse,l);for(let p=0,h=d;p<h;p++){if(x.fromBufferAttribute(a,p),M.fromBufferAttribute(c,p),x.w=1,M.w=1,x.applyMatrix4(Q),M.applyMatrix4(Q),x.z>f&&M.z>f)continue;if(x.z>f){const V=x.z-M.z,j=(x.z-f)/V;x.lerp(M,j)}else if(M.z>f){const V=M.z-x.z,j=(M.z-f)/V;M.lerp(x,j)}x.applyMatrix4(i),M.applyMatrix4(i),x.multiplyScalar(1/x.w),M.multiplyScalar(1/M.w),x.x*=o.x/2,x.y*=o.y/2,M.x*=o.x/2,M.y*=o.y/2,w.start.copy(x),w.start.z=0,w.end.copy(M),w.end.z=0;const m=w.closestPointToPointParameter(N,!0);w.at(m,at);const y=g.MathUtils.lerp(x.z,M.z,m),D=y>=-1&&y<=1,z=N.distanceTo(at)<L*.5;if(D&&z){w.start.fromBufferAttribute(a,p),w.end.fromBufferAttribute(c,p),w.start.applyMatrix4(l),w.end.applyMatrix4(l);const V=new g.Vector3,j=new g.Vector3;_.distanceSqToSegment(w.start,w.end,j,V),e.push({point:j,pointOnLine:V,distance:_.origin.distanceTo(j),object:r,face:null,faceIndex:p,uv:null,uv1:null})}}}class zt extends g.Mesh{constructor(t=new yt.LineSegmentsGeometry,e){super(t,e),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const t=this.geometry,e=t.attributes.instanceStart,i=t.attributes.instanceEnd,s=new Float32Array(2*e.count);for(let l=0,n=0,a=e.count;l<a;l++,n+=2)nt.fromBufferAttribute(e,l),rt.fromBufferAttribute(i,l),s[n]=n===0?0:s[n-1],s[n+1]=s[n]+nt.distanceTo(rt);const o=new g.InstancedInterleavedBuffer(s,2,1);return t.setAttribute("instanceDistanceStart",new g.InterleavedBufferAttribute(o,1,0)),t.setAttribute("instanceDistanceEnd",new g.InterleavedBufferAttribute(o,1,1)),this}raycast(t,e){const i=this.material.worldUnits,s=t.camera;s===null&&!i&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const o=t.params.Line2!==void 0&&t.params.Line2.threshold||0;_=t.ray;const l=this.matrixWorld,n=this.geometry,a=this.material;L=a.linewidth+o,n.boundingSphere===null&&n.computeBoundingSphere(),U.copy(n.boundingSphere).applyMatrix4(l);let c;if(i)c=L*.5;else{const f=Math.max(s.near,U.distanceToPoint(_.origin));c=ot(s,f,a.resolution)}if(U.radius+=c,_.intersectsSphere(U)===!1)return;n.boundingBox===null&&n.computeBoundingBox(),R.copy(n.boundingBox).applyMatrix4(l);let d;if(i)d=L*.5;else{const f=Math.max(s.near,R.distanceToPoint(_.origin));d=ot(s,f,a.resolution)}R.expandByScalar(d),_.intersectsBox(R)!==!1&&(i?Ct(this,e):Dt(this,s,e))}onBeforeRender(t){const e=this.material.uniforms;e&&e.resolution&&(t.getViewport($),this.material.uniforms.resolution.value.set($.z,$.w))}}const lt=["encodings_fragment","colorspace_fragment"],Vt=`
3
+ ${a.vertexShader.replace("gl_PointSize = size;","gl_PointSize = size * scaleAtt;")}
4
+ `},new h.Points(e,s)};class ht extends B{constructor(){super(...arguments),this.objectType="BaseObject",this.userData={},this.prefab=!1,this.isInstantiate=!1,this.materialList={},this.useMaterialType="origin",this.onPointerIndex=[]}get parent(){const t=this.object3d.parent;return t&&this.lead.objMap.get(t)||null}get children(){return this.object3d.children.map(t=>this.lead.objMap.get(t)).filter(t=>!!t)}get position(){return this.object3d.position}get rotation(){return this.object3d.rotation}get scale(){return this.object3d.scale}get add(){return this.object3d.add.bind(this.object3d)}get remove(){return this.object3d.remove.bind(this.object3d)}get visible(){return this.object3d.visible}get visibleWithAncestors(){if(this.visible){let t=this.parent;for(;t;){if(!t.visible)return!1;t=t.parent}return!0}else return!1}create(){this.createGroup()}render(){}update(t,e){}resize(t,e){}show(){return this.object3d.visible=!0,this}hide(){return this.object3d.visible=!1,this}createMesh(...t){return this.object3d=new h.Mesh(...t),this}createGroup(){return this.object3d=new h.Group,this}createPoints(...t){return this.object3d=new h.Points(...t),this}createCSS2DObject(t){return this.object3d=new bt.CSS2DObject(t),this}createCSS3DObject(t){return this.object3d=new it.CSS3DObject(t),this}createCSS3DSprite(t){return this.object3d=new it.CSS3DSprite(t),this}createSprite(t){return this.object3d=new h.Sprite(t),this}attach(...t){return[...t].forEach(e=>{this.object3d.attach(e.object3d)}),this}getSize(){const t=new h.Box3().setFromObject(this.object3d);return{min:t.min,max:t.max,size:t.getSize(new h.Vector3),center:t.getCenter(new h.Vector3)}}traverse(t){t(this),this.children.forEach(e=>{e.traverse(t)})}clone(){return this.instantiate()}instantiate(t,e){return et(this,null,function*(){const i=t&&t.length>0,{objectType:s,objectOptions:a}=this,[,c]=s.split("#");let r=e==null?void 0:e.create;r===void 0&&(r=o=>{var d;if(this.object3d){if(i){const f=t.length;if(this.object3d instanceof h.Sprite)o.object3d=At(this.object3d,f);else{const u=this.object3d;o.object3d=new h.InstancedMesh(u.geometry,u.material,f),o.setMaterialList("instantiate","clone"),o.useMaterial("instantiate")}const m=new h.Object3D;t.forEach((u,v)=>{const p=H.parseVector3(u.position),y=H.parseVector3(u.scale||[1,1,1]);m.position.copy(p),m.scale.copy(y),m.updateMatrix(),o.setInstancedMatrix(v,m.matrix.clone())})}else o.object3d=this.object3d.clone(!1),o.setMaterialList("instantiate","clone"),o.useMaterial("instantiate");o.object3d.userData.bloom&&((d=this.pencil.composerController)==null||d.toggleBloomSelection(o.object3d,!0)),o.object3d.userData.prefab&&(o.object3d.userData.prefab=!1)}});const l=yield this.lead.draw(c,Z(k({},a||{}),{create:r,prefab:!1,target:(e==null?void 0:e.target)||(a==null?void 0:a.target)}));return yield Promise.all(this.children.map(o=>o.instantiate(void 0,{target:l}))),l.isInstantiate=!0,l})}setInstancedMatrix(t,e){if(this.object3d instanceof h.InstancedMesh||this.object3d.isInstantiate)this.object3d.setMatrixAt(t,e);else if(this.object3d instanceof h.Points||this.object3d.type==="Points"){const s=this.object3d.geometry,a=s.attributes.position.array,c=s.attributes.scaleAtt.array,r=new h.Vector3,l=new h.Vector3,o=new h.Quaternion,d=t*3,f=t*1;e.decompose(r,o,l),a[d]=r.x,a[d+1]=r.y,a[d+2]=r.z,c[f]=Math.max(l.x,l.y,l.z),s.attributes.position.needsUpdate=!0,s.attributes.scaleAtt.needsUpdate=!0}}erase(){this.dispose()}cloneMaterial(){const t=this.object3d;if(!t||!t.material)return;const e=t.material;if(Array.isArray(e))return e.map(i=>{const s=i.userData;i.userData={};const a=i.clone();return i.userData=s,a});{const i=e.userData;e.userData={};const s=e.clone();return e.userData=i,s}}setMaterialList(t,e,i=!0){const s=this.object3d;if(!s||!s.material)return;if(this.materialList.origin||(this.materialList.origin=s.material),this.materialList[t])if(i){const c=this.materialList[t],r=new B;r.track(c),r.dispose()}else return this.materialList[t];const a=e==="clone"?this.cloneMaterial():e;return this.materialList[t]=a,a}useMaterial(t){const e=this.object3d;!e||!e.material||this.useMaterialType===t||!this.materialList[t]||(this.useMaterialType=t,e.material=this.materialList[t])}setTop(t){this.object3d&&(this.object3d.renderOrder=t)}onPointerEvent(t,e){const i=this.lead.handlePick([this],t,e);this.onPointerIndex.push(i)}dispose(){this.onPointerIndex.forEach(t=>{this.lead.removePick(t)}),this.lead&&(this.lead.objects.delete(this.key),this.object3d&&this.lead.objMap.delete(this.object3d)),this.track(this),super.dispose()}disposeWithOutMaterial(){this.disposeWithMaterial=!1,this.dispose()}}class St extends ht{create(){this.createGroup()}}const $=new g.Vector4,rt=new g.Vector3,nt=new g.Vector3,x=new g.Vector4,M=new g.Vector4,I=new g.Vector4,N=new g.Vector3,Q=new g.Matrix4,w=new g.Line3,at=new g.Vector3,R=new g.Box3,U=new g.Sphere,T=new g.Vector4;let _,L;function ot(n,t,e){return T.set(0,0,-t,1).applyMatrix4(n.projectionMatrix),T.multiplyScalar(1/T.w),T.x=L/e.width,T.y=L/e.height,T.applyMatrix4(n.projectionMatrixInverse),T.multiplyScalar(1/T.w),Math.abs(Math.max(T.x,T.y))}function Ct(n,t){const e=n.matrixWorld,i=n.geometry,s=i.attributes.instanceStart,a=i.attributes.instanceEnd,c=Math.min(i.instanceCount,s.count);for(let r=0,l=c;r<l;r++){w.start.fromBufferAttribute(s,r),w.end.fromBufferAttribute(a,r),w.applyMatrix4(e);const o=new g.Vector3,d=new g.Vector3;_.distanceSqToSegment(w.start,w.end,d,o),d.distanceTo(o)<L*.5&&t.push({point:d,pointOnLine:o,distance:_.origin.distanceTo(d),object:n,face:null,faceIndex:r,uv:null,uv1:null})}}function Dt(n,t,e){const i=t.projectionMatrix,a=n.material.resolution,c=n.matrixWorld,r=n.geometry,l=r.attributes.instanceStart,o=r.attributes.instanceEnd,d=Math.min(r.instanceCount,l.count),f=-t.near;_.at(1,I),I.w=1,I.applyMatrix4(t.matrixWorldInverse),I.applyMatrix4(i),I.multiplyScalar(1/I.w),I.x*=a.x/2,I.y*=a.y/2,I.z=0,N.copy(I),Q.multiplyMatrices(t.matrixWorldInverse,c);for(let m=0,u=d;m<u;m++){if(x.fromBufferAttribute(l,m),M.fromBufferAttribute(o,m),x.w=1,M.w=1,x.applyMatrix4(Q),M.applyMatrix4(Q),x.z>f&&M.z>f)continue;if(x.z>f){const V=x.z-M.z,j=(x.z-f)/V;x.lerp(M,j)}else if(M.z>f){const V=M.z-x.z,j=(M.z-f)/V;M.lerp(x,j)}x.applyMatrix4(i),M.applyMatrix4(i),x.multiplyScalar(1/x.w),M.multiplyScalar(1/M.w),x.x*=a.x/2,x.y*=a.y/2,M.x*=a.x/2,M.y*=a.y/2,w.start.copy(x),w.start.z=0,w.end.copy(M),w.end.z=0;const p=w.closestPointToPointParameter(N,!0);w.at(p,at);const y=g.MathUtils.lerp(x.z,M.z,p),D=y>=-1&&y<=1,z=N.distanceTo(at)<L*.5;if(D&&z){w.start.fromBufferAttribute(l,m),w.end.fromBufferAttribute(o,m),w.start.applyMatrix4(c),w.end.applyMatrix4(c);const V=new g.Vector3,j=new g.Vector3;_.distanceSqToSegment(w.start,w.end,j,V),e.push({point:j,pointOnLine:V,distance:_.origin.distanceTo(j),object:n,face:null,faceIndex:m,uv:null,uv1:null})}}}class zt extends g.Mesh{constructor(t=new yt.LineSegmentsGeometry,e){super(t,e),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const t=this.geometry,e=t.attributes.instanceStart,i=t.attributes.instanceEnd,s=new Float32Array(2*e.count);for(let c=0,r=0,l=e.count;c<l;c++,r+=2)rt.fromBufferAttribute(e,c),nt.fromBufferAttribute(i,c),s[r]=r===0?0:s[r-1],s[r+1]=s[r]+rt.distanceTo(nt);const a=new g.InstancedInterleavedBuffer(s,2,1);return t.setAttribute("instanceDistanceStart",new g.InterleavedBufferAttribute(a,1,0)),t.setAttribute("instanceDistanceEnd",new g.InterleavedBufferAttribute(a,1,1)),this}raycast(t,e){const i=this.material.worldUnits,s=t.camera;s===null&&!i&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const a=t.params.Line2!==void 0&&t.params.Line2.threshold||0;_=t.ray;const c=this.matrixWorld,r=this.geometry,l=this.material;L=l.linewidth+a,r.boundingSphere===null&&r.computeBoundingSphere(),U.copy(r.boundingSphere).applyMatrix4(c);let o;if(i)o=L*.5;else{const f=Math.max(s.near,U.distanceToPoint(_.origin));o=ot(s,f,l.resolution)}if(U.radius+=o,_.intersectsSphere(U)===!1)return;r.boundingBox===null&&r.computeBoundingBox(),R.copy(r.boundingBox).applyMatrix4(c);let d;if(i)d=L*.5;else{const f=Math.max(s.near,R.distanceToPoint(_.origin));d=ot(s,f,l.resolution)}R.expandByScalar(d),_.intersectsBox(R)!==!1&&(i?Ct(this,e):Dt(this,s,e))}onBeforeRender(t){const e=this.material.uniforms;e&&e.resolution&&(t.getViewport($),this.material.uniforms.resolution.value.set($.z,$.w))}}const lt=["encodings_fragment","colorspace_fragment"],Vt=`
5
5
  #include <common>
6
6
  #include <logdepthbuf_pars_vertex>
7
7
  #include <fog_pars_vertex>
@@ -144,6 +144,6 @@
144
144
 
145
145
  #include <fog_fragment>
146
146
  #include <tonemapping_fragment>
147
- #include <${+u.REVISION<154?lt[0]:lt[1]}>
147
+ #include <${+h.REVISION<154?lt[0]:lt[1]}>
148
148
  }
149
- `;class Tt extends u.ShaderMaterial{constructor(t){super({uniforms:Z(k({},u.UniformsLib.fog),{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new u.Color(16777215)},opacity:{value:1},resolution:{value:new u.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},useDepth:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new u.Vector2(1,1)},offset:{value:new u.Vector2(0,0)},offsetLoop:{value:1},lineLightAnimation:{value:0},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new u.Vector2(0,0)},lightColor:{value:new u.Color(16777215)}}),vertexShader:Vt,fragmentShader:It}),this.type="MeshLineMaterial",Object.defineProperties(this,{lineWidth:{enumerable:!0,get(){return this.uniforms.lineWidth.value},set(e){this.uniforms.lineWidth.value=e}},map:{enumerable:!0,get(){return this.uniforms.map.value},set(e){this.uniforms.map.value=e}},useMap:{enumerable:!0,get(){return this.uniforms.useMap.value},set(e){this.uniforms.useMap.value=e}},alphaMap:{enumerable:!0,get(){return this.uniforms.alphaMap.value},set(e){this.uniforms.alphaMap.value=e}},useAlphaMap:{enumerable:!0,get(){return this.uniforms.useAlphaMap.value},set(e){this.uniforms.useAlphaMap.value=e}},color:{enumerable:!0,get(){return this.uniforms.color.value},set(e){this.uniforms.color.value=e}},opacity:{enumerable:!0,get(){return this.uniforms.opacity.value},set(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get(){return this.uniforms.resolution.value},set(e){this.uniforms.resolution.value.copy(e)}},sizeAttenuation:{enumerable:!0,get(){return this.uniforms.sizeAttenuation.value},set(e){this.uniforms.sizeAttenuation.value=e}},dashArray:{enumerable:!0,get(){return this.uniforms.dashArray.value},set(e){this.uniforms.dashArray.value=e,this.useDash=e!==0?1:0}},dashOffset:{enumerable:!0,get(){return this.uniforms.dashOffset.value},set(e){this.uniforms.dashOffset.value=e}},dashRatio:{enumerable:!0,get(){return this.uniforms.dashRatio.value},set(e){this.uniforms.dashRatio.value=e}},useDash:{enumerable:!0,get(){return this.uniforms.useDash.value},set(e){this.uniforms.useDash.value=e}},useDepth:{enumerable:!0,get(){return this.uniforms.useDepth.value},set(e){this.uniforms.useDepth.value=e}},visibility:{enumerable:!0,get(){return this.uniforms.visibility.value},set(e){this.uniforms.visibility.value=e}},alphaTest:{enumerable:!0,get(){return this.uniforms.alphaTest.value},set(e){this.uniforms.alphaTest.value=e}},repeat:{enumerable:!0,get(){return this.uniforms.repeat.value},set(e){this.uniforms.repeat.value.copy(e)}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(e){this.uniforms.lineLightAnimation.value=e}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(e){this.uniforms.time.value=e}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(e){this.uniforms.size.value=e}},speed:{enumerable:!0,get:function(){return this.uniforms.speed.value},set:function(e){this.uniforms.speed.value=e}},lightWidth:{enumerable:!0,get:function(){return this.uniforms.lightWidth.value},set:function(e){this.uniforms.lightWidth.value=e}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(e){this.uniforms.uCenter.value=e}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(e){e&&(this.uniforms.lightColor.value=e)}}}),this.setValues(t)}copy(t){return super.copy(t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.dashArray=t.dashArray,this.dashOffset=t.dashOffset,this.dashRatio=t.dashRatio,this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this}}function _t(r,t){return r.map(e=>{const i=[];let s;return e.forEach(o=>{if(s){const l=E.geoDistance(o,s)*180/Math.PI;if(l>t){const n=E.geoInterpolate(s,o),a=1/Math.ceil(l/t);let c=a;for(;c<1;)i.push(n(c)),c+=a}}i.push(s=o)}),i})}function Ot(r,{minLng:t,maxLng:e,minLat:i,maxLat:s}={}){const o=Math.round(tt(360/r,2)/Math.PI),l=(1+Math.sqrt(5))/2,n=h=>h/l*360%360-180,a=h=>Math.acos(2*h/o-1)/Math.PI*180-90,c=h=>o*(Math.cos((h+90)*Math.PI/180)+1)/2,d=[s!==void 0?Math.ceil(c(s)):0,i!==void 0?Math.floor(c(i)):o-1],f=t===void 0&&e===void 0?()=>!0:t===void 0?h=>h<=e:e===void 0?h=>h>=t:e>=t?h=>h>=t&&h<=e:h=>h>=t||h<=e,p=[];for(let h=d[0];h<=d[1];h++){const v=n(h);f(v)&&p.push([v,a(h)])}return p}function X(r,t,e=!1){return e?E.geoContains(t,r):wt(r,t)}function Lt(r,t){const e={type:"Polygon",coordinates:r},[[i,s],[o,l]]=E.geoBounds(e);if(Math.min(Math.abs(o-i),Math.abs(l-s))<t)return[];const n=i>o||l>=89||s<=-89;return Ot(t,{minLng:i,maxLng:o,minLat:s,maxLat:l}).filter(a=>X(a,e,n))}function Wt(r,{resolution:t=1/0,bbox:e,projection:i}={}){const s=_t(r,t),o=W.merge(s),l=Lt(r,t),n=[...o,...l],a={type:"Polygon",coordinates:r},[[c,d],[f,p]]=E.geoBounds(a),h=c>f||p>=89||d<=-89;let v=[];if(h){const b=Pt.geoVoronoi(n).triangles(),P=new Map(n.map(([A,S],O)=>[`${A}-${S}`,O]));b.features.forEach(A=>{const S=A.geometry.coordinates[0].slice(0,3).reverse(),O=[];if(S.forEach(([C,F])=>{const G=`${C}-${F}`;P.has(G)&&O.push(P.get(G))}),O.length===3){if(O.some(C=>C<o.length)){const C=A.properties.circumcenter;if(!X(C,a,h))return}v.push(...O)}})}else if(l.length){const b=Mt.from(n);for(let P=0,A=b.triangles.length;P<A;P+=3){const S=[2,1,0].map(C=>b.triangles[P+C]),O=S.map(C=>n[C]);if(S.some(C=>C<o.length)){const C=[0,1].map(F=>W.mean(O,G=>G[F]));if(!X(C,a,h))continue}v.push(...S)}}else{const{vertices:b,holes:P=[]}=K.flatten(s);v=K(b,P,2)}let m=e?[e[0],e[2]]:W.extent(n,b=>b[0]),y=e?[e[1],e[3]]:W.extent(n,b=>b[1]);if(i){const[b,P]=i([m[0],y[0]]),[A,S]=i([m[1],y[1]]);m=[b,A],y=[-P,-S]}const D=st.scaleLinear(m,[0,1]),z=st.scaleLinear(y,[0,1]),V=n.map(([b,P])=>{if(i){const[A,S]=i([b,P]);return[D(A),z(-S)]}else return[D(b),z(P)]});return{contour:s,triangles:{points:n,indices:v,uvs:V}}}const ct=new u.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function q(r,t,e,i){const s=r.map(o=>o.map(([l,n])=>{if(i){const[a,c]=i([l,n]);return[a,-c,t]}return e?H.polar2Cartesian(l,n,t):[l,n,t]}));return K.flatten(s)}function Bt(r,t,e,i,s){const{vertices:o,holes:l}=q(r,t,i,s),{vertices:n}=q(r,e,i,s),a=W.merge([n,o]),c=Math.round(n.length/3),d=new Set(l);let f=0;const p=[];for(let v=0;v<c;v++){let m=v+1;if(m===c)m=f;else if(d.has(m)){const y=m;m=f,f=y}p.push(v,v+c,m+c),p.push(m+c,m,v)}const h=[];for(let v=1;v>=0;v--)for(let m=0;m<c;m+=1)h.push(m/(c-1),v);return{indices:p,vertices:a,uvs:h,topVerts:n}}function ut(r,t,e,i,s,o){return{indices:i?r.indices:r.indices.slice().reverse(),vertices:q([r.points],t,s,o).vertices,uvs:e}}const ft=({polygonGeoJson:r,startHeight:t,endHeight:e,curvatureResolution:i=1,cartesian:s=!0,hasSide:o=!0,hasBottom:l=!1,hasTop:n=!1,projection:a,bbox:c})=>{r.forEach(D=>{xt(D)||D.reverse()});const{contour:d,triangles:f}=Wt(r,{resolution:i,bbox:c,projection:a});let p={},h;o&&(p=Bt(d,t!=null?t:e,e!=null?e:t,s,a),h=p.topVerts);let v=[];(l||n)&&(v=W.merge(f.uvs));let m={};l&&(m=ut(f,t,v,!1,s,a));let y={};return n&&(y=ut(f,e,v,!0,s,a)),{contour:d,triangles:f,sideTorso:p,bottomCap:m,topCap:y,topVerts:h}};class kt extends u.BufferGeometry{constructor(t,e={}){super(),this.type="PolygonBufferGeometry",this.parameters=k({polygonGeoJson:t,startHeight:0,endHeight:1,hasTop:!0,topFirst:!1,hasBottom:!0,hasSide:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},e);const{endHeight:i,hasTop:s,topFirst:o,hasBottom:l,hasSide:n,cartesian:a,userDataRsoOffset:c,projection:d}=this.parameters,{contour:f,sideTorso:p,topVerts:h,bottomCap:v,topCap:m}=ft(k({},this.parameters));let y=[],D=[],z=[],V=0;const j=b=>{const P=Math.round(y.length/3),A=z.length;y=y.concat(b.vertices),D=D.concat(b.uvs),z=z.concat(P?b.indices.map(S=>S+P):b.indices),this.addGroup(A,z.length-A,V++)};s&&o&&j(m),n&&(j(p),this.userData.topVerts=c?q(f,i+c,a,d).vertices:h),l&&j(v),s&&!o&&j(m),this.setIndex(z),this[ct]("position",new u.Float32BufferAttribute(y,3)),this[ct]("uv",new u.Float32BufferAttribute(D,2)),this.computeVertexNormals()}}exports.BaseObject=ht;exports.Group=St;exports.LineSegments2=zt;exports.MeshLineMaterial=Tt;exports.PolygonGeometry=kt;exports.ResourceTracker=B;exports.getMetas=ft;
149
+ `;class Tt extends h.ShaderMaterial{constructor(t){super({uniforms:Z(k({},h.UniformsLib.fog),{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new h.Color(16777215)},opacity:{value:1},resolution:{value:new h.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},useDepth:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new h.Vector2(1,1)},offset:{value:new h.Vector2(0,0)},offsetLoop:{value:1},lineLightAnimation:{value:0},time:{value:0},size:{value:300},speed:{value:.3},lightWidth:{value:.1},uCenter:{value:new h.Vector2(0,0)},lightColor:{value:new h.Color(16777215)}}),vertexShader:Vt,fragmentShader:It}),this.type="MeshLineMaterial",Object.defineProperties(this,{lineWidth:{enumerable:!0,get(){return this.uniforms.lineWidth.value},set(e){this.uniforms.lineWidth.value=e}},map:{enumerable:!0,get(){return this.uniforms.map.value},set(e){this.uniforms.map.value=e}},useMap:{enumerable:!0,get(){return this.uniforms.useMap.value},set(e){this.uniforms.useMap.value=e}},alphaMap:{enumerable:!0,get(){return this.uniforms.alphaMap.value},set(e){this.uniforms.alphaMap.value=e}},useAlphaMap:{enumerable:!0,get(){return this.uniforms.useAlphaMap.value},set(e){this.uniforms.useAlphaMap.value=e}},color:{enumerable:!0,get(){return this.uniforms.color.value},set(e){this.uniforms.color.value=e}},opacity:{enumerable:!0,get(){return this.uniforms.opacity.value},set(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get(){return this.uniforms.resolution.value},set(e){this.uniforms.resolution.value.copy(e)}},sizeAttenuation:{enumerable:!0,get(){return this.uniforms.sizeAttenuation.value},set(e){this.uniforms.sizeAttenuation.value=e}},dashArray:{enumerable:!0,get(){return this.uniforms.dashArray.value},set(e){this.uniforms.dashArray.value=e,this.useDash=e!==0?1:0}},dashOffset:{enumerable:!0,get(){return this.uniforms.dashOffset.value},set(e){this.uniforms.dashOffset.value=e}},dashRatio:{enumerable:!0,get(){return this.uniforms.dashRatio.value},set(e){this.uniforms.dashRatio.value=e}},useDash:{enumerable:!0,get(){return this.uniforms.useDash.value},set(e){this.uniforms.useDash.value=e}},useDepth:{enumerable:!0,get(){return this.uniforms.useDepth.value},set(e){this.uniforms.useDepth.value=e}},visibility:{enumerable:!0,get(){return this.uniforms.visibility.value},set(e){this.uniforms.visibility.value=e}},alphaTest:{enumerable:!0,get(){return this.uniforms.alphaTest.value},set(e){this.uniforms.alphaTest.value=e}},repeat:{enumerable:!0,get(){return this.uniforms.repeat.value},set(e){this.uniforms.repeat.value.copy(e)}},lineLightAnimation:{enumerable:!0,get:function(){return this.uniforms.lineLightAnimation.value},set:function(e){this.uniforms.lineLightAnimation.value=e}},time:{enumerable:!0,get:function(){return this.uniforms.time.value},set:function(e){this.uniforms.time.value=e}},size:{enumerable:!0,get:function(){return this.uniforms.size.value},set:function(e){this.uniforms.size.value=e}},speed:{enumerable:!0,get:function(){return this.uniforms.speed.value},set:function(e){this.uniforms.speed.value=e}},lightWidth:{enumerable:!0,get:function(){return this.uniforms.lightWidth.value},set:function(e){this.uniforms.lightWidth.value=e}},uCenter:{enumerable:!0,get:function(){return this.uniforms.uCenter.value},set:function(e){this.uniforms.uCenter.value=e}},lightColor:{enumerable:!0,get:function(){return this.uniforms.lightColor.value},set:function(e){e&&(this.uniforms.lightColor.value=e)}}}),this.setValues(t)}copy(t){return super.copy(t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.dashArray=t.dashArray,this.dashOffset=t.dashOffset,this.dashRatio=t.dashRatio,this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this}}function _t(n,t){return n.map(e=>{const i=[];let s;return e.forEach(a=>{if(s){const c=E.geoDistance(a,s)*180/Math.PI;if(c>t){const r=E.geoInterpolate(s,a),l=1/Math.ceil(c/t);let o=l;for(;o<1;)i.push(r(o)),o+=l}}i.push(s=a)}),i})}function Ot(n,{minLng:t,maxLng:e,minLat:i,maxLat:s}={}){const a=Math.round(tt(360/n,2)/Math.PI),c=(1+Math.sqrt(5))/2,r=u=>u/c*360%360-180,l=u=>Math.acos(2*u/a-1)/Math.PI*180-90,o=u=>a*(Math.cos((u+90)*Math.PI/180)+1)/2,d=[s!==void 0?Math.ceil(o(s)):0,i!==void 0?Math.floor(o(i)):a-1],f=t===void 0&&e===void 0?()=>!0:t===void 0?u=>u<=e:e===void 0?u=>u>=t:e>=t?u=>u>=t&&u<=e:u=>u>=t||u<=e,m=[];for(let u=d[0];u<=d[1];u++){const v=r(u);f(v)&&m.push([v,l(u)])}return m}function X(n,t,e=!1){return e?E.geoContains(t,n):wt(n,t)}function Lt(n,t){const e={type:"Polygon",coordinates:n},[[i,s],[a,c]]=E.geoBounds(e);if(Math.min(Math.abs(a-i),Math.abs(c-s))<t)return[];const r=i>a||c>=89||s<=-89;return Ot(t,{minLng:i,maxLng:a,minLat:s,maxLat:c}).filter(l=>X(l,e,r))}function Wt(n,{resolution:t=1/0,bbox:e,projection:i}={}){const s=_t(n,t),a=W.merge(s),c=Lt(n,t),r=[...a,...c],l={type:"Polygon",coordinates:n},[[o,d],[f,m]]=E.geoBounds(l),u=o>f||m>=89||d<=-89;let v=[];if(u){const b=Pt.geoVoronoi(r).triangles(),P=new Map(r.map(([A,S],O)=>[`${A}-${S}`,O]));b.features.forEach(A=>{const S=A.geometry.coordinates[0].slice(0,3).reverse(),O=[];if(S.forEach(([C,F])=>{const G=`${C}-${F}`;P.has(G)&&O.push(P.get(G))}),O.length===3){if(O.some(C=>C<a.length)){const C=A.properties.circumcenter;if(!X(C,l,u))return}v.push(...O)}})}else if(c.length){const b=Mt.from(r);for(let P=0,A=b.triangles.length;P<A;P+=3){const S=[2,1,0].map(C=>b.triangles[P+C]),O=S.map(C=>r[C]);if(S.some(C=>C<a.length)){const C=[0,1].map(F=>W.mean(O,G=>G[F]));if(!X(C,l,u))continue}v.push(...S)}}else{const{vertices:b,holes:P=[]}=K.flatten(s);v=K(b,P,2)}let p=e?[e[0],e[2]]:W.extent(r,b=>b[0]),y=e?[e[1],e[3]]:W.extent(r,b=>b[1]);if(i){const[b,P]=i([p[0],y[0]]),[A,S]=i([p[1],y[1]]);p=[b,A],y=[-P,-S]}const D=st.scaleLinear(p,[0,1]),z=st.scaleLinear(y,[0,1]),V=r.map(([b,P])=>{if(i){const[A,S]=i([b,P]);return[D(A),z(-S)]}else return[D(b),z(P)]});return{contour:s,triangles:{points:r,indices:v,uvs:V}}}const ct=new h.BufferGeometry().setAttribute?"setAttribute":"addAttribute";function q(n,t,e,i){const s=n.map(a=>a.map(([c,r])=>{if(i){const[l,o]=i([c,r]);return[l,-o,t]}return e?H.polar2Cartesian(c,r,t):[c,r,t]}));return K.flatten(s)}function Bt(n,t,e,i,s){const{vertices:a,holes:c}=q(n,t,i,s),{vertices:r}=q(n,e,i,s),l=W.merge([r,a]),o=Math.round(r.length/3),d=new Set(c);let f=0;const m=[];for(let v=0;v<o;v++){let p=v+1;if(p===o)p=f;else if(d.has(p)){const y=p;p=f,f=y}m.push(v,v+o,p+o),m.push(p+o,p,v)}const u=[];for(let v=1;v>=0;v--)for(let p=0;p<o;p+=1)u.push(p/(o-1),v);return{indices:m,vertices:l,uvs:u,topVerts:r}}function ut(n,t,e,i,s,a){return{indices:i?n.indices:n.indices.slice().reverse(),vertices:q([n.points],t,s,a).vertices,uvs:e}}const ft=({polygonGeoJson:n,startHeight:t,endHeight:e,curvatureResolution:i=1,cartesian:s=!0,hasSide:a=!0,hasBottom:c=!1,hasTop:r=!1,projection:l,bbox:o})=>{n.forEach(D=>{xt(D)||D.reverse()});const{contour:d,triangles:f}=Wt(n,{resolution:i,bbox:o,projection:l});let m={},u;a&&(m=Bt(d,t!=null?t:e,e!=null?e:t,s,l),u=m.topVerts);let v=[];(c||r)&&(v=W.merge(f.uvs));let p={};c&&(p=ut(f,t,v,!1,s,l));let y={};return r&&(y=ut(f,e,v,!0,s,l)),{contour:d,triangles:f,sideTorso:m,bottomCap:p,topCap:y,topVerts:u}};class kt extends h.BufferGeometry{constructor(t,e={}){super(),this.type="PolygonBufferGeometry",this.parameters=k({polygonGeoJson:t,startHeight:0,endHeight:1,hasTop:!0,topFirst:!1,hasBottom:!0,hasSide:!0,curvatureResolution:1,cartesian:!0,userDataRsoOffset:0},e);const{endHeight:i,hasTop:s,topFirst:a,hasBottom:c,hasSide:r,cartesian:l,userDataRsoOffset:o,projection:d}=this.parameters,{contour:f,sideTorso:m,topVerts:u,bottomCap:v,topCap:p}=ft(k({},this.parameters));let y=[],D=[],z=[],V=0;const j=b=>{const P=Math.round(y.length/3),A=z.length;y=y.concat(b.vertices),D=D.concat(b.uvs),z=z.concat(P?b.indices.map(S=>S+P):b.indices),this.addGroup(A,z.length-A,V++)};s&&a&&j(p),r&&(j(m),this.userData.topVerts=o?q(f,i+o,l,d).vertices:u),c&&j(v),s&&!a&&j(p),this.setIndex(z),this[ct]("position",new h.Float32BufferAttribute(y,3)),this[ct]("uv",new h.Float32BufferAttribute(D,2)),this.computeVertexNormals()}}exports.BaseObject=ht;exports.Group=St;exports.LineSegments2=zt;exports.MeshLineMaterial=Tt;exports.PolygonGeometry=kt;exports.ResourceTracker=B;exports.getMetas=ft;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gl-draw",
3
- "version": "0.14.16",
3
+ "version": "0.14.18",
4
4
  "author": "gitplus <hstits@gmail.com>",
5
5
  "scripts": {
6
6
  "start": "bundler-dev",