gl-draw 0.14.35 → 0.14.36

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.
Files changed (64) hide show
  1. package/dist/core/BaseObject.d.ts +19 -19
  2. package/dist/core/CSSRenderer/index.d.ts +2 -2
  3. package/dist/core/Camera.d.ts +10 -10
  4. package/dist/core/Composer.d.ts +9 -9
  5. package/dist/core/Controls.d.ts +2 -2
  6. package/dist/core/Helper.d.ts +3 -3
  7. package/dist/core/Lead/Lead.d.ts +5 -5
  8. package/dist/core/Lead/index.d.ts +2 -2
  9. package/dist/core/Loader/GzipJSONLoader.d.ts +4 -4
  10. package/dist/core/Loader/Loader.d.ts +22 -22
  11. package/dist/core/Loader/TextureLoader.d.ts +4 -4
  12. package/dist/core/Loader/index.d.ts +2 -2
  13. package/dist/core/Pencil.d.ts +11 -11
  14. package/dist/core/Renderer.d.ts +3 -3
  15. package/dist/core/ResourceTracker.d.ts +4 -4
  16. package/dist/core/Scene.d.ts +5 -5
  17. package/dist/core/TransformControls/index.d.ts +5 -5
  18. package/dist/core/WebGPURenderer.d.ts +2 -2
  19. package/dist/effect/index.js +3 -3
  20. package/dist/effect/index.module.js +41 -41
  21. package/dist/effect/scan.d.ts +3 -3
  22. package/dist/effect/scan2.d.ts +3 -3
  23. package/dist/index.js +3 -3
  24. package/dist/index.module.js +526 -557
  25. package/dist/index.module2.js +251 -255
  26. package/dist/index2.js +5 -5
  27. package/dist/objects/conicPolygon/index.d.ts +3 -3
  28. package/dist/objects/extrudePolygon/ExtrudeGeometry.d.ts +23 -3
  29. package/dist/objects/extrudePolygon/ExtrudeGeometry2.d.ts +2 -2
  30. package/dist/objects/extrudePolygon/createGeometry.d.ts +22 -22
  31. package/dist/objects/extrudePolygon/getSplitTexture.d.ts +2 -2
  32. package/dist/objects/extrudePolygon/index.d.ts +9 -9
  33. package/dist/objects/index.d.ts +1 -1
  34. package/dist/objects/index.js +1 -1
  35. package/dist/objects/index.module.js +539 -565
  36. package/dist/objects/light/index.d.ts +6 -6
  37. package/dist/objects/line/index.d.ts +4 -4
  38. package/dist/objects/line/meshLine/MeshLineGeometry.d.ts +15 -15
  39. package/dist/objects/line/meshLine/MeshLineMaterial.d.ts +14 -14
  40. package/dist/objects/line/meshLine/index.d.ts +0 -1
  41. package/dist/objects/line2/createGeometry.d.ts +3 -3
  42. package/dist/objects/line2/index.d.ts +5 -5
  43. package/dist/objects/node/index.d.ts +3 -3
  44. package/dist/objects/pie/index.d.ts +67 -4
  45. package/dist/objects/scene/index.d.ts +2 -2
  46. package/dist/parseVector.js +1 -1
  47. package/dist/parseVector.module.js +10 -10
  48. package/dist/plugins/Worker/createGeometry.d.ts +2 -2
  49. package/dist/plugins/Worker/getAttributes/coords2Vector.d.ts +2 -2
  50. package/dist/plugins/Worker/getAttributes/extrudePolygon.d.ts +1 -2
  51. package/dist/plugins/Worker/getAttributes/line2.d.ts +1 -2
  52. package/dist/plugins/Worker/getAttributes/splitPolygonsByLongitudeDifference.d.ts +2 -2
  53. package/dist/plugins/Worker/index.d.ts +8 -8
  54. package/dist/plugins/index.js +1 -1
  55. package/dist/plugins/index.module.js +91 -91
  56. package/dist/utils/Sprite2Points.d.ts +2 -2
  57. package/dist/utils/colorCorrection.d.ts +4 -4
  58. package/dist/utils/parseVector.d.ts +3 -3
  59. package/dist/utils/uvGenerator.d.ts +4 -4
  60. package/dist/uvGenerator.js +1 -1
  61. package/dist/uvGenerator.module.js +46 -67
  62. package/package.json +1 -1
  63. package/dist/objects/fix.d.ts +0 -5
  64. package/dist/objects/line/meshLine/raycast.d.ts +0 -3
@@ -1,16 +1,16 @@
1
- var dt = Object.defineProperty, pt = Object.defineProperties;
2
- var mt = Object.getOwnPropertyDescriptors;
3
- var X = Object.getOwnPropertySymbols;
4
- var vt = Object.prototype.hasOwnProperty, gt = Object.prototype.propertyIsEnumerable;
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) => {
1
+ var At = Object.defineProperty, jt = Object.defineProperties;
2
+ var St = Object.getOwnPropertyDescriptors;
3
+ var tt = Object.getOwnPropertySymbols;
4
+ var Ct = Object.prototype.hasOwnProperty, zt = Object.prototype.propertyIsEnumerable;
5
+ var it = Math.pow, et = (a, t, e) => t in a ? At(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e, L = (a, t) => {
6
6
  for (var e in t || (t = {}))
7
- vt.call(t, e) && Y(a, e, t[e]);
8
- if (X)
9
- for (var e of X(t))
10
- gt.call(t, e) && Y(a, e, t[e]);
7
+ Ct.call(t, e) && et(a, e, t[e]);
8
+ if (tt)
9
+ for (var e of tt(t))
10
+ zt.call(t, e) && et(a, e, t[e]);
11
11
  return a;
12
- }, Z = (a, t) => pt(a, mt(t));
13
- var J = (a, t, e) => new Promise((i, s) => {
12
+ }, q = (a, t) => jt(a, St(t));
13
+ var st = (a, t, e) => new Promise((i, s) => {
14
14
  var r = (l) => {
15
15
  try {
16
16
  n(e.next(l));
@@ -26,22 +26,21 @@ var J = (a, t, e) => new Promise((i, s) => {
26
26
  }, n = (l) => l.done ? i(l.value) : Promise.resolve(l.value).then(r, o);
27
27
  n((e = e.apply(a, t)).next());
28
28
  });
29
- import * as h from "three";
30
- import { Vector4 as k, Vector3 as _, Matrix4 as bt, Line3 as yt, Box3 as xt, Sphere as Mt, Mesh as wt, InstancedInterleavedBuffer as Pt, InterleavedBufferAttribute as tt, MathUtils as At } from "three";
31
- import { CSS2DObject as jt } from "three/examples/jsm/renderers/CSS2DRenderer";
32
- import { CSS3DObject as St, CSS3DSprite as Ct } from "three/examples/jsm/renderers/CSS3DRenderer";
33
- import { geoBounds as ht, geoContains as zt, geoDistance as Dt, geoInterpolate as Bt } from "d3-geo";
29
+ import { Material as nt, Object3D as G, Texture as rt, BufferGeometry as J, Float32BufferAttribute as F, PointsMaterial as Dt, Points as X, Mesh as xt, Group as It, Sprite as at, Box3 as Mt, Vector3 as C, InstancedMesh as ot, Quaternion as Wt, Vector4 as V, Matrix4 as Bt, Line3 as _t, Sphere as Tt, InstancedInterleavedBuffer as Lt, InterleavedBufferAttribute as lt, MathUtils as Ot, ShaderMaterial as Vt, UniformsLib as kt, Color as ct, Vector2 as U, REVISION as Ut } from "three";
30
+ import { CSS2DObject as Et } from "three/examples/jsm/renderers/CSS2DRenderer";
31
+ import { CSS3DObject as Rt, CSS3DSprite as Gt } from "three/examples/jsm/renderers/CSS3DRenderer";
32
+ import { geoBounds as wt, geoContains as Ft, geoDistance as Zt, geoInterpolate as $t } from "d3-geo";
34
33
  import "d3-geo-projection";
35
- import { p as et, a as It } from "./parseVector.module.js";
36
- import { LineSegmentsGeometry as Tt } from "three/examples/jsm/lines/LineSegmentsGeometry";
37
- import { merge as K, mean as Wt, extent as it } from "d3-array";
38
- import _t, { flatten as ft } from "earcut";
39
- import Lt from "@turf/boolean-clockwise";
40
- import Ot from "delaunator";
41
- import Vt from "@turf/boolean-point-in-polygon";
42
- import { geoVoronoi as kt } from "d3-geo-voronoi";
43
- import { scaleLinear as st } from "d3-scale";
44
- class V {
34
+ import { p as ut, a as qt } from "./parseVector.module.js";
35
+ import { LineSegmentsGeometry as Nt } from "three/examples/jsm/lines/LineSegmentsGeometry";
36
+ import { merge as H, mean as Qt, extent as ht } from "d3-array";
37
+ import Kt, { flatten as Pt } from "earcut";
38
+ import Xt from "@turf/boolean-clockwise";
39
+ import Yt from "delaunator";
40
+ import Jt from "@turf/boolean-point-in-polygon";
41
+ import { geoVoronoi as Ht } from "d3-geo-voronoi";
42
+ import { scaleLinear as ft } from "d3-scale";
43
+ class O {
45
44
  constructor() {
46
45
  this.resources = /* @__PURE__ */ new Set(), this.disposeWithMaterial = !0, this.materialList = {}, this.disposeTrack = !0;
47
46
  }
@@ -50,22 +49,22 @@ class V {
50
49
  return t;
51
50
  if (Array.isArray(t))
52
51
  return t.forEach((e) => this.track(e)), t;
53
- if (!this.disposeWithMaterial && t instanceof h.Material)
52
+ if (!this.disposeWithMaterial && t instanceof nt)
54
53
  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 h.Object3D || Reflect.has(t, "dispose")) && this.resources.add(t), t instanceof V)
54
+ if (t instanceof O ? (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 G || Reflect.has(t, "dispose")) && this.resources.add(t), t instanceof O)
56
55
  this.track(t.children);
57
- else if (t instanceof h.Object3D) {
56
+ else if (t instanceof G) {
58
57
  const e = t;
59
58
  this.track(e.geometry), this.track(e.material), this.track(e.children);
60
- } else if (t instanceof h.Material) {
59
+ } else if (t instanceof nt) {
61
60
  for (const i of Object.values(t))
62
- i instanceof h.Texture && this.track(i);
61
+ i instanceof rt && this.track(i);
63
62
  const e = t;
64
63
  if (e.uniforms) {
65
64
  for (const i of Object.values(e.uniforms))
66
65
  if (i) {
67
66
  const s = i.value;
68
- (s instanceof h.Texture || Array.isArray(s)) && this.track(s);
67
+ (s instanceof rt || Array.isArray(s)) && this.track(s);
69
68
  }
70
69
  }
71
70
  }
@@ -74,22 +73,22 @@ class V {
74
73
  dispose() {
75
74
  const t = [];
76
75
  for (const e of this.resources)
77
- e instanceof h.Object3D && t.push(e), Reflect.has(e, "dispose") && e.dispose();
76
+ e instanceof G && t.push(e), Reflect.has(e, "dispose") && e.dispose();
78
77
  t.forEach((e) => {
79
78
  e.removeFromParent();
80
79
  }), t.length = 0, this.resources.clear();
81
80
  }
82
81
  }
83
- const Et = (a, t = 1) => {
84
- const e = new h.BufferGeometry();
82
+ const te = (a, t = 1) => {
83
+ const e = new J();
85
84
  e.setAttribute(
86
85
  "position",
87
- new h.Float32BufferAttribute(new Array(t * 3).fill(0), 3)
86
+ new F(new Array(t * 3).fill(0), 3)
88
87
  ), e.setAttribute(
89
88
  "scaleAtt",
90
- new h.Float32BufferAttribute(new Array(t).fill(1), 1)
89
+ new F(new Array(t).fill(1), 1)
91
90
  );
92
- const i = a.material, s = new h.PointsMaterial({
91
+ const i = a.material, s = new Dt({
93
92
  size: 10,
94
93
  map: i.map,
95
94
  alphaMap: i.alphaMap,
@@ -110,9 +109,9 @@ const Et = (a, t = 1) => {
110
109
  "gl_PointSize = size * scaleAtt;"
111
110
  )}
112
111
  `;
113
- }, new h.Points(e, s);
112
+ }, new X(e, s);
114
113
  };
115
- class Rt extends V {
114
+ class ee extends O {
116
115
  constructor() {
117
116
  super(...arguments), this.objectType = "BaseObject", this.userData = {}, this.prefab = !1, this.isInstantiate = !1, this.isBloom = !1, this.materialList = {}, this.useMaterialType = "origin", this.onPointerIndex = [];
118
117
  }
@@ -169,25 +168,25 @@ class Rt extends V {
169
168
  return this.object3d.visible = !1, this;
170
169
  }
171
170
  createMesh(...t) {
172
- return this.object3d = new h.Mesh(...t), this;
171
+ return this.object3d = new xt(...t), this;
173
172
  }
174
173
  createGroup() {
175
- return this.object3d = new h.Group(), this;
174
+ return this.object3d = new It(), this;
176
175
  }
177
176
  createPoints(...t) {
178
- return this.object3d = new h.Points(...t), this;
177
+ return this.object3d = new X(...t), this;
179
178
  }
180
179
  createCSS2DObject(t) {
181
- return this.object3d = new jt(t), this;
180
+ return this.object3d = new Et(t), this;
182
181
  }
183
182
  createCSS3DObject(t) {
184
- return this.object3d = new St(t), this;
183
+ return this.object3d = new Rt(t), this;
185
184
  }
186
185
  createCSS3DSprite(t) {
187
- return this.object3d = new Ct(t), this;
186
+ return this.object3d = new Gt(t), this;
188
187
  }
189
188
  createSprite(t) {
190
- return this.object3d = new h.Sprite(t), this;
189
+ return this.object3d = new at(t), this;
191
190
  }
192
191
  attach(...t) {
193
192
  return [...t].forEach((e) => {
@@ -195,12 +194,12 @@ class Rt extends V {
195
194
  }), this;
196
195
  }
197
196
  getSize() {
198
- const t = new h.Box3().setFromObject(this.object3d);
197
+ const t = new Mt().setFromObject(this.object3d);
199
198
  return {
200
199
  min: t.min,
201
200
  max: t.max,
202
- size: t.getSize(new h.Vector3()),
203
- center: t.getCenter(new h.Vector3())
201
+ size: t.getSize(new C()),
202
+ center: t.getCenter(new C())
204
203
  };
205
204
  }
206
205
  traverse(t) {
@@ -212,35 +211,35 @@ class Rt extends V {
212
211
  return this.instantiate();
213
212
  }
214
213
  instantiate(t, e) {
215
- return J(this, null, function* () {
216
- var p;
217
- const i = t && t.length > 0, s = (p = e == null ? void 0 : e.recursive) != null ? p : !0, { objectType: r, objectOptions: o } = this, [, n] = r.split("#");
214
+ return st(this, null, function* () {
215
+ var d;
216
+ const i = t && t.length > 0, s = (d = e == null ? void 0 : e.recursive) != null ? d : !0, { objectType: r, objectOptions: o } = this, [, n] = r.split("#");
218
217
  let l = e == null ? void 0 : e.create;
219
218
  l === void 0 && (l = (u) => {
220
219
  if (this.object3d) {
221
220
  if (i) {
222
- const v = t.length;
223
- if (this.object3d instanceof h.Sprite)
224
- u.object3d = Et(this.object3d, v);
221
+ const m = t.length;
222
+ if (this.object3d instanceof at)
223
+ u.object3d = te(this.object3d, m);
225
224
  else {
226
- const d = this.object3d;
227
- u.object3d = new h.InstancedMesh(
228
- d.geometry,
229
- d.material,
230
- v
225
+ const f = this.object3d;
226
+ u.object3d = new ot(
227
+ f.geometry,
228
+ f.material,
229
+ m
231
230
  ), u.setMaterialList("instantiate", "clone"), u.useMaterial("instantiate");
232
231
  }
233
- const f = new h.Object3D();
234
- t.forEach((d, m) => {
235
- const b = et(d.position), P = et(d.scale || [1, 1, 1]);
236
- f.position.copy(b), f.scale.copy(P), f.updateMatrix(), u.setInstancedMatrix(m, f.matrix.clone());
232
+ const h = new G();
233
+ t.forEach((f, p) => {
234
+ const g = ut(f.position), w = ut(f.scale || [1, 1, 1]);
235
+ h.position.copy(g), h.scale.copy(w), h.updateMatrix(), u.setInstancedMatrix(p, h.matrix.clone());
237
236
  });
238
237
  } else
239
238
  u.object3d = this.object3d.clone(!1), u.setMaterialList("instantiate", "clone"), u.useMaterial("instantiate");
240
239
  u.object3d.userData.prefab && delete u.object3d.userData.prefab;
241
240
  }
242
241
  });
243
- const c = yield this.lead.draw(n, Z(O({}, o || {}), {
242
+ const c = yield this.lead.draw(n, q(L({}, o || {}), {
244
243
  create: l,
245
244
  prefab: !1,
246
245
  key: (e == null ? void 0 : e.key) || (o == null ? void 0 : o.key),
@@ -256,11 +255,11 @@ class Rt extends V {
256
255
  });
257
256
  }
258
257
  setInstancedMatrix(t, e) {
259
- if (this.object3d instanceof h.InstancedMesh || this.object3d.isInstantiate)
258
+ if (this.object3d instanceof ot || this.object3d.isInstantiate)
260
259
  this.object3d.setMatrixAt(t, e);
261
- else if (this.object3d instanceof h.Points || this.object3d.type === "Points") {
262
- const s = this.object3d.geometry, r = s.attributes.position.array, o = s.attributes.scaleAtt.array, n = new h.Vector3(), l = new h.Vector3(), c = new h.Quaternion(), p = t * 3, u = t * 1;
263
- e.decompose(n, c, l), r[p] = n.x, r[p + 1] = n.y, r[p + 2] = n.z, o[u] = Math.max(l.x, l.y, l.z), s.attributes.position.needsUpdate = !0, s.attributes.scaleAtt.needsUpdate = !0;
260
+ else if (this.object3d instanceof X || this.object3d.type === "Points") {
261
+ const s = this.object3d.geometry, r = s.attributes.position.array, o = s.attributes.scaleAtt.array, n = new C(), l = new C(), c = new Wt(), d = t * 3, u = t * 1;
262
+ e.decompose(n, c, l), r[d] = n.x, r[d + 1] = n.y, r[d + 2] = n.z, o[u] = Math.max(l.x, l.y, l.z), s.attributes.position.needsUpdate = !0, s.attributes.scaleAtt.needsUpdate = !0;
264
263
  }
265
264
  }
266
265
  erase() {
@@ -291,7 +290,7 @@ class Rt extends V {
291
290
  return;
292
291
  if (this.materialList.origin || (this.materialList.origin = s.material), this.materialList[t])
293
292
  if (i) {
294
- const o = this.materialList[t], n = new V();
293
+ const o = this.materialList[t], n = new O();
295
294
  n.track(o), n.dispose();
296
295
  } else
297
296
  return this.materialList[t];
@@ -327,25 +326,25 @@ class Rt extends V {
327
326
  this.disposeWithMaterial = !1, this.dispose();
328
327
  }
329
328
  }
330
- class fe extends Rt {
329
+ class Ce extends ee {
331
330
  create() {
332
331
  this.createGroup();
333
332
  }
334
333
  }
335
- const $ = new k(), nt = new _(), rt = new _(), y = new k(), x = new k(), B = new k(), q = new _(), N = new bt(), M = new yt(), at = new _(), R = new xt(), U = new Mt(), I = new k();
336
- let T, L;
337
- function ot(a, t, e) {
338
- return I.set(0, 0, -t, 1).applyMatrix4(a.projectionMatrix), I.multiplyScalar(1 / I.w), I.x = L / e.width, I.y = L / e.height, I.applyMatrix4(a.projectionMatrixInverse), I.multiplyScalar(1 / I.w), Math.abs(Math.max(I.x, I.y));
334
+ const N = new V(), dt = new C(), pt = new C(), b = new V(), y = new V(), I = new V(), Q = new C(), K = new Bt(), x = new _t(), mt = new C(), E = new Mt(), R = new Tt(), W = new V();
335
+ let B, T;
336
+ function vt(a, t, e) {
337
+ return W.set(0, 0, -t, 1).applyMatrix4(a.projectionMatrix), W.multiplyScalar(1 / W.w), W.x = T / e.width, W.y = T / e.height, W.applyMatrix4(a.projectionMatrixInverse), W.multiplyScalar(1 / W.w), Math.abs(Math.max(W.x, W.y));
339
338
  }
340
- function Ut(a, t) {
339
+ function ie(a, t) {
341
340
  const e = a.matrixWorld, i = a.geometry, s = i.attributes.instanceStart, r = i.attributes.instanceEnd, o = Math.min(i.instanceCount, s.count);
342
341
  for (let n = 0, l = o; n < l; n++) {
343
- M.start.fromBufferAttribute(s, n), M.end.fromBufferAttribute(r, n), M.applyMatrix4(e);
344
- const c = new _(), p = new _();
345
- T.distanceSqToSegment(M.start, M.end, p, c), p.distanceTo(c) < L * 0.5 && t.push({
346
- point: p,
342
+ x.start.fromBufferAttribute(s, n), x.end.fromBufferAttribute(r, n), x.applyMatrix4(e);
343
+ const c = new C(), d = new C();
344
+ B.distanceSqToSegment(x.start, x.end, d, c), d.distanceTo(c) < T * 0.5 && t.push({
345
+ point: d,
347
346
  pointOnLine: c,
348
- distance: T.origin.distanceTo(p),
347
+ distance: B.origin.distanceTo(d),
349
348
  object: a,
350
349
  face: null,
351
350
  faceIndex: n,
@@ -354,59 +353,59 @@ function Ut(a, t) {
354
353
  });
355
354
  }
356
355
  }
357
- function Gt(a, t, e) {
358
- const i = t.projectionMatrix, r = a.material.resolution, o = a.matrixWorld, n = a.geometry, l = n.attributes.instanceStart, c = n.attributes.instanceEnd, p = Math.min(n.instanceCount, l.count), u = -t.near;
359
- T.at(1, B), B.w = 1, B.applyMatrix4(t.matrixWorldInverse), B.applyMatrix4(i), B.multiplyScalar(1 / B.w), B.x *= r.x / 2, B.y *= r.y / 2, B.z = 0, q.copy(B), N.multiplyMatrices(t.matrixWorldInverse, o);
360
- for (let v = 0, f = p; v < f; v++) {
361
- if (y.fromBufferAttribute(l, v), x.fromBufferAttribute(c, v), y.w = 1, x.w = 1, y.applyMatrix4(N), x.applyMatrix4(N), y.z > u && x.z > u)
356
+ function se(a, t, e) {
357
+ const i = t.projectionMatrix, r = a.material.resolution, o = a.matrixWorld, n = a.geometry, l = n.attributes.instanceStart, c = n.attributes.instanceEnd, d = Math.min(n.instanceCount, l.count), u = -t.near;
358
+ B.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), K.multiplyMatrices(t.matrixWorldInverse, o);
359
+ for (let m = 0, h = d; m < h; m++) {
360
+ if (b.fromBufferAttribute(l, m), y.fromBufferAttribute(c, m), b.w = 1, y.w = 1, b.applyMatrix4(K), y.applyMatrix4(K), b.z > u && y.z > u)
362
361
  continue;
363
- if (y.z > u) {
364
- const D = y.z - x.z, A = (y.z - u) / D;
365
- y.lerp(x, A);
366
- } else if (x.z > u) {
367
- const D = x.z - y.z, A = (x.z - u) / D;
368
- x.lerp(y, A);
362
+ if (b.z > u) {
363
+ const D = b.z - y.z, P = (b.z - u) / D;
364
+ b.lerp(y, P);
365
+ } else if (y.z > u) {
366
+ const D = y.z - b.z, P = (y.z - u) / D;
367
+ y.lerp(b, P);
369
368
  }
370
- 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;
371
- const m = M.closestPointToPointParameter(q, !0);
372
- M.at(m, at);
373
- const b = At.lerp(y.z, x.z, m), P = b >= -1 && b <= 1, z = q.distanceTo(at) < L * 0.5;
374
- if (P && z) {
375
- M.start.fromBufferAttribute(l, v), M.end.fromBufferAttribute(c, v), M.start.applyMatrix4(o), M.end.applyMatrix4(o);
376
- const D = new _(), A = new _();
377
- T.distanceSqToSegment(M.start, M.end, A, D), e.push({
378
- point: A,
369
+ b.applyMatrix4(i), y.applyMatrix4(i), b.multiplyScalar(1 / b.w), y.multiplyScalar(1 / y.w), b.x *= r.x / 2, b.y *= r.y / 2, y.x *= r.x / 2, y.y *= r.y / 2, x.start.copy(b), x.start.z = 0, x.end.copy(y), x.end.z = 0;
370
+ const p = x.closestPointToPointParameter(Q, !0);
371
+ x.at(p, mt);
372
+ const g = Ot.lerp(b.z, y.z, p), w = g >= -1 && g <= 1, z = Q.distanceTo(mt) < T * 0.5;
373
+ if (w && z) {
374
+ x.start.fromBufferAttribute(l, m), x.end.fromBufferAttribute(c, m), x.start.applyMatrix4(o), x.end.applyMatrix4(o);
375
+ const D = new C(), P = new C();
376
+ B.distanceSqToSegment(x.start, x.end, P, D), e.push({
377
+ point: P,
379
378
  pointOnLine: D,
380
- distance: T.origin.distanceTo(A),
379
+ distance: B.origin.distanceTo(P),
381
380
  object: a,
382
381
  face: null,
383
- faceIndex: v,
382
+ faceIndex: m,
384
383
  uv: null,
385
384
  uv1: null
386
385
  });
387
386
  }
388
387
  }
389
388
  }
390
- class de extends wt {
391
- constructor(t = new Tt(), e) {
389
+ class ze extends xt {
390
+ constructor(t = new Nt(), e) {
392
391
  super(t, e), this.isLineSegments2 = !0, this.type = "LineSegments2";
393
392
  }
394
393
  // for backwards-compatibility, but could be a method of LineSegmentsGeometry...
395
394
  computeLineDistances() {
396
395
  const t = this.geometry, e = t.attributes.instanceStart, i = t.attributes.instanceEnd, s = new Float32Array(2 * e.count);
397
396
  for (let o = 0, n = 0, l = e.count; o < l; o++, n += 2)
398
- nt.fromBufferAttribute(e, o), rt.fromBufferAttribute(i, o), s[n] = n === 0 ? 0 : s[n - 1], s[n + 1] = s[n] + nt.distanceTo(rt);
399
- const r = new Pt(
397
+ dt.fromBufferAttribute(e, o), pt.fromBufferAttribute(i, o), s[n] = n === 0 ? 0 : s[n - 1], s[n + 1] = s[n] + dt.distanceTo(pt);
398
+ const r = new Lt(
400
399
  s,
401
400
  2,
402
401
  1
403
402
  );
404
403
  return t.setAttribute(
405
404
  "instanceDistanceStart",
406
- new tt(r, 1, 0)
405
+ new lt(r, 1, 0)
407
406
  ), t.setAttribute(
408
407
  "instanceDistanceEnd",
409
- new tt(r, 1, 1)
408
+ new lt(r, 1, 1)
410
409
  ), this;
411
410
  }
412
411
  raycast(t, e) {
@@ -415,48 +414,48 @@ class de extends wt {
415
414
  'LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.'
416
415
  );
417
416
  const r = t.params.Line2 !== void 0 && t.params.Line2.threshold || 0;
418
- T = t.ray;
417
+ B = t.ray;
419
418
  const o = this.matrixWorld, n = this.geometry, l = this.material;
420
- L = l.linewidth + r, n.boundingSphere === null && n.computeBoundingSphere(), U.copy(n.boundingSphere).applyMatrix4(o);
419
+ T = l.linewidth + r, n.boundingSphere === null && n.computeBoundingSphere(), R.copy(n.boundingSphere).applyMatrix4(o);
421
420
  let c;
422
421
  if (i)
423
- c = L * 0.5;
422
+ c = T * 0.5;
424
423
  else {
425
424
  const u = Math.max(
426
425
  s.near,
427
- U.distanceToPoint(T.origin)
426
+ R.distanceToPoint(B.origin)
428
427
  );
429
- c = ot(
428
+ c = vt(
430
429
  s,
431
430
  u,
432
431
  l.resolution
433
432
  );
434
433
  }
435
- if (U.radius += c, T.intersectsSphere(U) === !1)
434
+ if (R.radius += c, B.intersectsSphere(R) === !1)
436
435
  return;
437
- n.boundingBox === null && n.computeBoundingBox(), R.copy(n.boundingBox).applyMatrix4(o);
438
- let p;
436
+ n.boundingBox === null && n.computeBoundingBox(), E.copy(n.boundingBox).applyMatrix4(o);
437
+ let d;
439
438
  if (i)
440
- p = L * 0.5;
439
+ d = T * 0.5;
441
440
  else {
442
441
  const u = Math.max(
443
442
  s.near,
444
- R.distanceToPoint(T.origin)
443
+ E.distanceToPoint(B.origin)
445
444
  );
446
- p = ot(
445
+ d = vt(
447
446
  s,
448
447
  u,
449
448
  l.resolution
450
449
  );
451
450
  }
452
- R.expandByScalar(p), T.intersectsBox(R) !== !1 && (i ? Ut(this, e) : Gt(this, s, e));
451
+ E.expandByScalar(d), B.intersectsBox(E) !== !1 && (i ? ie(this, e) : se(this, s, e));
453
452
  }
454
453
  onBeforeRender(t) {
455
454
  const e = this.material.uniforms;
456
- e && e.resolution && (t.getViewport($), this.material.uniforms.resolution.value.set($.z, $.w));
455
+ e && e.resolution && (t.getViewport(N), this.material.uniforms.resolution.value.set(N.z, N.w));
457
456
  }
458
457
  }
459
- const lt = ["encodings_fragment", "colorspace_fragment"], Ft = (
458
+ const gt = ["encodings_fragment", "colorspace_fragment"], ne = (
460
459
  /* glsl */
461
460
  `
462
461
  #include <common>
@@ -552,7 +551,7 @@ const lt = ["encodings_fragment", "colorspace_fragment"], Ft = (
552
551
  #include <fog_vertex>
553
552
  }
554
553
  `
555
- ), Zt = (
554
+ ), re = (
556
555
  /* glsl */
557
556
  `
558
557
  #include <packing>
@@ -604,22 +603,22 @@ const lt = ["encodings_fragment", "colorspace_fragment"], Ft = (
604
603
 
605
604
  #include <fog_fragment>
606
605
  #include <tonemapping_fragment>
607
- #include <${+h.REVISION < 154 ? lt[0] : lt[1]}>
606
+ #include <${+Ut < 154 ? gt[0] : gt[1]}>
608
607
  }
609
608
  `
610
609
  );
611
- class pe extends h.ShaderMaterial {
610
+ class De extends Vt {
612
611
  constructor(t) {
613
612
  super({
614
- uniforms: Z(O({}, h.UniformsLib.fog), {
613
+ uniforms: q(L({}, kt.fog), {
615
614
  lineWidth: { value: 1 },
616
615
  map: { value: null },
617
616
  useMap: { value: 0 },
618
617
  alphaMap: { value: null },
619
618
  useAlphaMap: { value: 0 },
620
- color: { value: new h.Color(16777215) },
619
+ color: { value: new ct(16777215) },
621
620
  opacity: { value: 1 },
622
- resolution: { value: new h.Vector2(1, 1) },
621
+ resolution: { value: new U(1, 1) },
623
622
  sizeAttenuation: { value: 1 },
624
623
  dashArray: { value: 0 },
625
624
  dashOffset: { value: 0 },
@@ -628,19 +627,19 @@ class pe extends h.ShaderMaterial {
628
627
  useDepth: { value: 0 },
629
628
  visibility: { value: 1 },
630
629
  alphaTest: { value: 0 },
631
- repeat: { value: new h.Vector2(1, 1) },
632
- offset: { value: new h.Vector2(0, 0) },
630
+ repeat: { value: new U(1, 1) },
631
+ offset: { value: new U(0, 0) },
633
632
  offsetLoop: { value: 1 },
634
633
  lineLightAnimation: { value: 0 },
635
634
  time: { value: 0 },
636
635
  size: { value: 300 },
637
636
  speed: { value: 0.3 },
638
637
  lightWidth: { value: 0.1 },
639
- uCenter: { value: new h.Vector2(0, 0) },
640
- lightColor: { value: new h.Color(16777215) }
638
+ uCenter: { value: new U(0, 0) },
639
+ lightColor: { value: new ct(16777215) }
641
640
  }),
642
- vertexShader: Ft,
643
- fragmentShader: Zt
641
+ vertexShader: ne,
642
+ fragmentShader: re
644
643
  }), this.type = "MeshLineMaterial", Object.defineProperties(this, {
645
644
  lineWidth: {
646
645
  enumerable: !0,
@@ -864,15 +863,15 @@ class pe extends h.ShaderMaterial {
864
863
  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;
865
864
  }
866
865
  }
867
- function $t(a, t) {
866
+ function ae(a, t) {
868
867
  return a.map((e) => {
869
868
  const i = [];
870
869
  let s;
871
870
  return e.forEach((r) => {
872
871
  if (s) {
873
- const o = Dt(r, s) * 180 / Math.PI;
872
+ const o = Zt(r, s) * 180 / Math.PI;
874
873
  if (o > t) {
875
- const n = Bt(s, r), l = 1 / Math.ceil(o / t);
874
+ const n = $t(s, r), l = 1 / Math.ceil(o / t);
876
875
  let c = l;
877
876
  for (; c < 1; )
878
877
  i.push(n(c)), c += l;
@@ -882,142 +881,142 @@ function $t(a, t) {
882
881
  }), i;
883
882
  });
884
883
  }
885
- function qt(a, { minLng: t, maxLng: e, minLat: i, maxLat: s } = {}) {
886
- const r = Math.round(H(360 / a, 2) / Math.PI), o = (1 + Math.sqrt(5)) / 2, n = (f) => f / o * 360 % 360 - 180, l = (f) => Math.acos(2 * f / r - 1) / Math.PI * 180 - 90, c = (f) => r * (Math.cos((f + 90) * Math.PI / 180) + 1) / 2, p = [
884
+ function oe(a, { minLng: t, maxLng: e, minLat: i, maxLat: s } = {}) {
885
+ const r = Math.round(it(360 / a, 2) / Math.PI), o = (1 + Math.sqrt(5)) / 2, n = (h) => h / o * 360 % 360 - 180, l = (h) => Math.acos(2 * h / r - 1) / Math.PI * 180 - 90, c = (h) => r * (Math.cos((h + 90) * Math.PI / 180) + 1) / 2, d = [
887
886
  s !== void 0 ? Math.ceil(c(s)) : 0,
888
887
  i !== void 0 ? Math.floor(c(i)) : r - 1
889
- ], u = t === void 0 && e === void 0 ? () => !0 : t === void 0 ? (f) => f <= e : e === void 0 ? (f) => f >= t : e >= t ? (f) => f >= t && f <= e : (f) => f >= t || f <= e, v = [];
890
- for (let f = p[0]; f <= p[1]; f++) {
891
- const d = n(f);
892
- u(d) && v.push([d, l(f)]);
888
+ ], u = 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, m = [];
889
+ for (let h = d[0]; h <= d[1]; h++) {
890
+ const f = n(h);
891
+ u(f) && m.push([f, l(h)]);
893
892
  }
894
- return v;
893
+ return m;
895
894
  }
896
- function Q(a, t, e = !1) {
897
- return e ? zt(t, a) : Vt(a, t);
895
+ function Y(a, t, e = !1) {
896
+ return e ? Ft(t, a) : Jt(a, t);
898
897
  }
899
- function Nt(a, t) {
900
- const e = { type: "Polygon", coordinates: a }, [[i, s], [r, o]] = ht(e);
898
+ function le(a, t) {
899
+ const e = { type: "Polygon", coordinates: a }, [[i, s], [r, o]] = wt(e);
901
900
  if (Math.min(Math.abs(r - i), Math.abs(o - s)) < t)
902
901
  return [];
903
902
  const n = i > r || o >= 89 || s <= -89;
904
- return qt(t, {
903
+ return oe(t, {
905
904
  minLng: i,
906
905
  maxLng: r,
907
906
  minLat: s,
908
907
  maxLat: o
909
908
  }).filter(
910
- (l) => Q(l, e, n)
909
+ (l) => Y(l, e, n)
911
910
  );
912
911
  }
913
- function Qt(a, { resolution: t = 1 / 0, bbox: e, projection: i } = {}) {
914
- const s = $t(a, t), r = K(s), o = Nt(a, t), n = [...r, ...o], l = { type: "Polygon", coordinates: a }, [[c, p], [u, v]] = ht(l), f = c > u || // crosses antimeridian
915
- v >= 89 || // crosses north pole
916
- p <= -89;
917
- let d = [];
918
- if (f) {
919
- const g = kt(n).triangles(), w = new Map(
920
- n.map(([j, S], W) => [`${j}-${S}`, W])
912
+ function ce(a, { resolution: t = 1 / 0, bbox: e, projection: i } = {}) {
913
+ const s = ae(a, t), r = H(s), o = le(a, t), n = [...r, ...o], l = { type: "Polygon", coordinates: a }, [[c, d], [u, m]] = wt(l), h = c > u || // crosses antimeridian
914
+ m >= 89 || // crosses north pole
915
+ d <= -89;
916
+ let f = [];
917
+ if (h) {
918
+ const v = Ht(n).triangles(), M = new Map(
919
+ n.map(([A, j], _) => [`${A}-${j}`, _])
921
920
  );
922
- g.features.forEach((j) => {
923
- const S = j.geometry.coordinates[0].slice(0, 3).reverse(), W = [];
924
- if (S.forEach(([C, F]) => {
925
- const E = `${C}-${F}`;
926
- w.has(E) && W.push(w.get(E));
927
- }), W.length === 3) {
928
- if (W.some((C) => C < r.length)) {
929
- const C = j.properties.circumcenter;
930
- if (!Q(
931
- C,
921
+ v.features.forEach((A) => {
922
+ const j = A.geometry.coordinates[0].slice(0, 3).reverse(), _ = [];
923
+ if (j.forEach(([S, $]) => {
924
+ const k = `${S}-${$}`;
925
+ M.has(k) && _.push(M.get(k));
926
+ }), _.length === 3) {
927
+ if (_.some((S) => S < r.length)) {
928
+ const S = A.properties.circumcenter;
929
+ if (!Y(
930
+ S,
932
931
  l,
933
- f
932
+ h
934
933
  ))
935
934
  return;
936
935
  }
937
- d.push(...W);
936
+ f.push(..._);
938
937
  }
939
938
  });
940
939
  } else if (o.length) {
941
- const g = Ot.from(n);
942
- for (let w = 0, j = g.triangles.length; w < j; w += 3) {
943
- const S = [2, 1, 0].map((C) => g.triangles[w + C]), W = S.map((C) => n[C]);
944
- if (S.some((C) => C < r.length)) {
945
- const C = [0, 1].map(
946
- (F) => Wt(W, (E) => E[F])
940
+ const v = Yt.from(n);
941
+ for (let M = 0, A = v.triangles.length; M < A; M += 3) {
942
+ const j = [2, 1, 0].map((S) => v.triangles[M + S]), _ = j.map((S) => n[S]);
943
+ if (j.some((S) => S < r.length)) {
944
+ const S = [0, 1].map(
945
+ ($) => Qt(_, (k) => k[$])
947
946
  );
948
- if (!Q(
949
- C,
947
+ if (!Y(
948
+ S,
950
949
  l,
951
- f
950
+ h
952
951
  ))
953
952
  continue;
954
953
  }
955
- d.push(...S);
954
+ f.push(...j);
956
955
  }
957
956
  } else {
958
- const { vertices: g, holes: w = [] } = ft(s);
959
- d = _t(g, w, 2);
957
+ const { vertices: v, holes: M = [] } = Pt(s);
958
+ f = Kt(v, M, 2);
960
959
  }
961
- let m = e ? [e[0], e[2]] : it(n, (g) => g[0]), b = e ? [e[1], e[3]] : it(n, (g) => g[1]);
960
+ let p = e ? [e[0], e[2]] : ht(n, (v) => v[0]), g = e ? [e[1], e[3]] : ht(n, (v) => v[1]);
962
961
  if (i) {
963
- const [g, w] = i([m[0], b[0]]), [j, S] = i([m[1], b[1]]);
964
- m = [g, j], b = [-w, -S];
962
+ const [v, M] = i([p[0], g[0]]), [A, j] = i([p[1], g[1]]);
963
+ p = [v, A], g = [-M, -j];
965
964
  }
966
- const P = st(m, [0, 1]), z = st(b, [0, 1]), D = n.map(([g, w]) => {
965
+ const w = ft(p, [0, 1]), z = ft(g, [0, 1]), D = n.map(([v, M]) => {
967
966
  if (i) {
968
- const [j, S] = i([g, w]);
969
- return [P(j), z(-S)];
967
+ const [A, j] = i([v, M]);
968
+ return [w(A), z(-j)];
970
969
  } else
971
- return [P(g), z(w)];
970
+ return [w(v), z(M)];
972
971
  });
973
- return { contour: s, triangles: { points: n, indices: d, uvs: D } };
972
+ return { contour: s, triangles: { points: n, indices: f, uvs: D } };
974
973
  }
975
- const ct = new h.BufferGeometry().setAttribute ? "setAttribute" : "addAttribute";
976
- function G(a, t, e, i) {
974
+ const bt = new J().setAttribute ? "setAttribute" : "addAttribute";
975
+ function Z(a, t, e, i) {
977
976
  const s = a.map(
978
977
  (r) => r.map(([o, n]) => {
979
978
  if (i) {
980
979
  const [l, c] = i([o, n]);
981
980
  return [l, -c, t];
982
981
  }
983
- return e ? It(o, n, t) : [o, n, t];
982
+ return e ? qt(o, n, t) : [o, n, t];
984
983
  })
985
984
  );
986
- return ft(s);
985
+ return Pt(s);
987
986
  }
988
- function Kt(a, t, e, i, s) {
989
- const { vertices: r, holes: o } = G(
987
+ function ue(a, t, e, i, s) {
988
+ const { vertices: r, holes: o } = Z(
990
989
  a,
991
990
  t,
992
991
  i,
993
992
  s
994
- ), { vertices: n } = G(
993
+ ), { vertices: n } = Z(
995
994
  a,
996
995
  e,
997
996
  i,
998
997
  s
999
- ), l = K([n, r]), c = Math.round(n.length / 3), p = new Set(o);
998
+ ), l = H([n, r]), c = Math.round(n.length / 3), d = new Set(o);
1000
999
  let u = 0;
1001
- const v = [];
1002
- for (let d = 0; d < c; d++) {
1003
- let m = d + 1;
1004
- if (m === c)
1005
- m = u;
1006
- else if (p.has(m)) {
1007
- const b = m;
1008
- m = u, u = b;
1000
+ const m = [];
1001
+ for (let f = 0; f < c; f++) {
1002
+ let p = f + 1;
1003
+ if (p === c)
1004
+ p = u;
1005
+ else if (d.has(p)) {
1006
+ const g = p;
1007
+ p = u, u = g;
1009
1008
  }
1010
- v.push(d, d + c, m + c), v.push(m + c, m, d);
1009
+ m.push(f, f + c, p + c), m.push(p + c, p, f);
1011
1010
  }
1012
- const f = [];
1013
- for (let d = 1; d >= 0; d--)
1014
- for (let m = 0; m < c; m += 1) f.push(m / (c - 1), d);
1015
- return { indices: v, vertices: l, uvs: f, topVerts: n };
1011
+ const h = [];
1012
+ for (let f = 1; f >= 0; f--)
1013
+ for (let p = 0; p < c; p += 1) h.push(p / (c - 1), f);
1014
+ return { indices: m, vertices: l, uvs: h, topVerts: n };
1016
1015
  }
1017
- function ut(a, t, e, i, s, r) {
1016
+ function yt(a, t, e, i, s, r) {
1018
1017
  return {
1019
1018
  indices: i ? a.indices : a.indices.slice().reverse(),
1020
- vertices: G(
1019
+ vertices: Z(
1021
1020
  [a.points],
1022
1021
  t,
1023
1022
  s,
@@ -1026,7 +1025,7 @@ function ut(a, t, e, i, s, r) {
1026
1025
  uvs: e
1027
1026
  };
1028
1027
  }
1029
- const Xt = ({
1028
+ const he = ({
1030
1029
  polygonGeoJson: a,
1031
1030
  startHeight: t,
1032
1031
  endHeight: e,
@@ -1038,46 +1037,46 @@ const Xt = ({
1038
1037
  projection: l,
1039
1038
  bbox: c
1040
1039
  }) => {
1041
- a.forEach((P) => {
1042
- Lt(P) || P.reverse();
1040
+ a.forEach((w) => {
1041
+ Xt(w) || w.reverse();
1043
1042
  });
1044
- const { contour: p, triangles: u } = Qt(a, {
1043
+ const { contour: d, triangles: u } = ce(a, {
1045
1044
  resolution: i,
1046
1045
  bbox: c,
1047
1046
  projection: l
1048
1047
  });
1049
- let v = {}, f;
1050
- r && (v = Kt(
1051
- p,
1048
+ let m = {}, h;
1049
+ r && (m = ue(
1050
+ d,
1052
1051
  t != null ? t : e,
1053
1052
  e != null ? e : t,
1054
1053
  s,
1055
1054
  l
1056
- ), f = v.topVerts);
1057
- let d = [];
1058
- (o || n) && (d = K(u.uvs));
1059
- let m = {};
1060
- o && (m = ut(
1055
+ ), h = m.topVerts);
1056
+ let f = [];
1057
+ (o || n) && (f = H(u.uvs));
1058
+ let p = {};
1059
+ o && (p = yt(
1061
1060
  u,
1062
1061
  t,
1063
- d,
1062
+ f,
1064
1063
  !1,
1065
1064
  s,
1066
1065
  l
1067
1066
  ));
1068
- let b = {};
1069
- return n && (b = ut(
1067
+ let g = {};
1068
+ return n && (g = yt(
1070
1069
  u,
1071
1070
  e,
1072
- d,
1071
+ f,
1073
1072
  !0,
1074
1073
  s,
1075
1074
  l
1076
- )), { contour: p, triangles: u, sideTorso: v, bottomCap: m, topCap: b, topVerts: f };
1075
+ )), { contour: d, triangles: u, sideTorso: m, bottomCap: p, topCap: g, topVerts: h };
1077
1076
  };
1078
- class me extends h.BufferGeometry {
1077
+ class Ie extends J {
1079
1078
  constructor(t, e = {}) {
1080
- super(), this.type = "PolygonBufferGeometry", this.parameters = O({
1079
+ super(), this.type = "PolygonBufferGeometry", this.parameters = L({
1081
1080
  polygonGeoJson: t,
1082
1081
  startHeight: 0,
1083
1082
  endHeight: 1,
@@ -1097,32 +1096,29 @@ class me extends h.BufferGeometry {
1097
1096
  hasSide: n,
1098
1097
  cartesian: l,
1099
1098
  userDataRsoOffset: c,
1100
- projection: p
1101
- } = this.parameters, { contour: u, sideTorso: v, topVerts: f, bottomCap: d, topCap: m } = Xt(O({}, this.parameters));
1102
- let b = [], P = [], z = [], D = 0;
1103
- const A = (g) => {
1104
- const w = Math.round(b.length / 3), j = z.length;
1105
- b = b.concat(g.vertices), P = P.concat(g.uvs), z = z.concat(
1106
- w ? g.indices.map((S) => S + w) : g.indices
1107
- ), this.addGroup(j, z.length - j, D++);
1099
+ projection: d
1100
+ } = this.parameters, { contour: u, sideTorso: m, topVerts: h, bottomCap: f, topCap: p } = he(L({}, this.parameters));
1101
+ let g = [], w = [], z = [], D = 0;
1102
+ const P = (v) => {
1103
+ const M = Math.round(g.length / 3), A = z.length;
1104
+ g = g.concat(v.vertices), w = w.concat(v.uvs), z = z.concat(
1105
+ M ? v.indices.map((j) => j + M) : v.indices
1106
+ ), this.addGroup(A, z.length - A, D++);
1108
1107
  };
1109
- s && r && A(m), n && (A(v), this.userData.topVerts = c ? G(
1108
+ s && r && P(p), n && (P(m), this.userData.topVerts = c ? Z(
1110
1109
  u,
1111
1110
  i + c,
1112
1111
  l,
1113
- p
1114
- ).vertices : f), o && A(d), s && !r && A(m), this.setIndex(z), this[ct](
1115
- "position",
1116
- new h.Float32BufferAttribute(b, 3)
1117
- ), this[ct]("uv", new h.Float32BufferAttribute(P, 2)), this.computeVertexNormals();
1112
+ d
1113
+ ).vertices : h), o && P(f), s && !r && P(p), this.setIndex(z), this[bt]("position", new F(g, 3)), this[bt]("uv", new F(w, 2)), this.computeVertexNormals();
1118
1114
  }
1119
1115
  }
1120
1116
  export {
1121
- Rt as B,
1122
- fe as G,
1123
- de as L,
1124
- pe as M,
1125
- me as P,
1126
- V as R,
1127
- Xt as g
1117
+ ee as B,
1118
+ Ce as G,
1119
+ ze as L,
1120
+ De as M,
1121
+ Ie as P,
1122
+ O as R,
1123
+ he as g
1128
1124
  };