gl-draw 0.14.41 → 0.15.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/BaseObject.d.ts +5 -3
- package/dist/core/Composer.d.ts +1 -0
- package/dist/core/Lead/Lead.d.ts +4 -1
- package/dist/core/Lead/index.d.ts +2 -1
- package/dist/core/MList/MList.d.ts +25 -0
- package/dist/core/MList/index.d.ts +18 -0
- package/dist/core/Pencil.d.ts +3 -0
- package/dist/core/ResourceTracker.d.ts +4 -6
- package/dist/index.js +3 -3
- package/dist/index.module.js +980 -793
- package/dist/index.module2.js +240 -242
- package/dist/index2.js +6 -6
- package/package.json +1 -1
package/dist/index.module2.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
var
|
|
1
|
+
var jt = Object.defineProperty, At = Object.defineProperties;
|
|
2
2
|
var St = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var tt = Object.getOwnPropertySymbols;
|
|
4
4
|
var Ct = Object.prototype.hasOwnProperty, zt = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var it = Math.pow, et = (
|
|
5
|
+
var it = Math.pow, et = (r, t, e) => t in r ? jt(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e, W = (r, t) => {
|
|
6
6
|
for (var e in t || (t = {}))
|
|
7
|
-
Ct.call(t, e) && et(
|
|
7
|
+
Ct.call(t, e) && et(r, e, t[e]);
|
|
8
8
|
if (tt)
|
|
9
9
|
for (var e of tt(t))
|
|
10
|
-
zt.call(t, e) && et(
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
var st = (
|
|
14
|
-
var
|
|
10
|
+
zt.call(t, e) && et(r, e, t[e]);
|
|
11
|
+
return r;
|
|
12
|
+
}, $ = (r, t) => At(r, St(t));
|
|
13
|
+
var st = (r, t, e) => new Promise((i, s) => {
|
|
14
|
+
var a = (o) => {
|
|
15
15
|
try {
|
|
16
|
-
n(e.next(
|
|
16
|
+
n(e.next(o));
|
|
17
17
|
} catch (c) {
|
|
18
18
|
s(c);
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, l = (o) => {
|
|
21
21
|
try {
|
|
22
|
-
n(e.throw(
|
|
22
|
+
n(e.throw(o));
|
|
23
23
|
} catch (c) {
|
|
24
24
|
s(c);
|
|
25
25
|
}
|
|
26
|
-
}, n = (
|
|
27
|
-
n((e = e.apply(
|
|
26
|
+
}, n = (o) => o.done ? i(o.value) : Promise.resolve(o.value).then(a, l);
|
|
27
|
+
n((e = e.apply(r, t)).next());
|
|
28
28
|
});
|
|
29
|
-
import {
|
|
29
|
+
import { BufferGeometry as H, Float32BufferAttribute as G, PointsMaterial as It, Points as K, Mesh as xt, Group as Dt, Sprite as nt, Box3 as Mt, Vector3 as C, InstancedMesh as rt, Quaternion as Tt, Object3D as R, Material as at, Texture as ot, VideoTexture as _t, Vector4 as O, Matrix4 as Bt, Line3 as Lt, Sphere as Wt, InstancedInterleavedBuffer as Ot, InterleavedBufferAttribute as lt, MathUtils as Vt, ShaderMaterial as kt, UniformsLib as Ut, Color as ct, Vector2 as k, REVISION as Et } from "three";
|
|
30
30
|
import { CSS2DObject as Rt } from "three/examples/jsm/renderers/CSS2DRenderer";
|
|
31
31
|
import { CSS3DObject as Gt, CSS3DSprite as Ft } from "three/examples/jsm/renderers/CSS3DRenderer";
|
|
32
|
-
import { geoBounds as wt, geoContains as Zt, geoDistance as $t, geoInterpolate as
|
|
32
|
+
import { geoBounds as wt, geoContains as Zt, geoDistance as $t, geoInterpolate as Nt } from "d3-geo";
|
|
33
33
|
import "d3-geo-projection";
|
|
34
|
-
import { p as ut, a as
|
|
34
|
+
import { p as ut, a as qt } from "./parseVector.module.js";
|
|
35
35
|
import { LineSegmentsGeometry as Qt } from "three/examples/jsm/lines/LineSegmentsGeometry";
|
|
36
36
|
import { merge as J, mean as Kt, extent as ht } from "d3-array";
|
|
37
37
|
import Xt, { flatten as Pt } from "earcut";
|
|
@@ -40,55 +40,16 @@ import Ht from "delaunator";
|
|
|
40
40
|
import Jt from "@turf/boolean-point-in-polygon";
|
|
41
41
|
import { geoVoronoi as te } from "d3-geo-voronoi";
|
|
42
42
|
import { scaleLinear as ft } from "d3-scale";
|
|
43
|
-
|
|
44
|
-
constructor() {
|
|
45
|
-
this.resources = /* @__PURE__ */ new Set(), this.disposeWithMaterial = !0, this.disposeVideo = !0, this.materialList = {}, this.disposeTrack = !0;
|
|
46
|
-
}
|
|
47
|
-
track(t) {
|
|
48
|
-
if (!t || this.disposeTrack === !1)
|
|
49
|
-
return t;
|
|
50
|
-
if (Array.isArray(t))
|
|
51
|
-
return t.forEach((e) => this.track(e)), t;
|
|
52
|
-
if (!this.disposeWithMaterial && t instanceof nt)
|
|
53
|
-
return t;
|
|
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)
|
|
55
|
-
this.track(t.children);
|
|
56
|
-
else if (t instanceof G) {
|
|
57
|
-
const e = t;
|
|
58
|
-
this.track(e.geometry), this.track(e.material), this.track(e.children);
|
|
59
|
-
} else if (t instanceof nt) {
|
|
60
|
-
for (const i of Object.values(t))
|
|
61
|
-
i instanceof rt && this.track(i);
|
|
62
|
-
const e = t;
|
|
63
|
-
if (e.uniforms) {
|
|
64
|
-
for (const i of Object.values(e.uniforms))
|
|
65
|
-
if (i) {
|
|
66
|
-
const s = i.value;
|
|
67
|
-
(s instanceof rt || Array.isArray(s)) && this.track(s);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
} else this.disposeVideo && t instanceof Dt && t.source.data && this.resources.add(t.source.data);
|
|
71
|
-
return t;
|
|
72
|
-
}
|
|
73
|
-
dispose() {
|
|
74
|
-
const t = [];
|
|
75
|
-
for (const e of this.resources)
|
|
76
|
-
e instanceof G ? t.push(e) : e instanceof HTMLVideoElement && e.pause(), Reflect.has(e, "dispose") && e.dispose();
|
|
77
|
-
t.forEach((e) => {
|
|
78
|
-
e.removeFromParent();
|
|
79
|
-
}), t.length = 0, this.resources.clear();
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
const ee = (a, t = 1) => {
|
|
43
|
+
const ee = (r, t = 1) => {
|
|
83
44
|
const e = new H();
|
|
84
45
|
e.setAttribute(
|
|
85
46
|
"position",
|
|
86
|
-
new
|
|
47
|
+
new G(new Array(t * 3).fill(0), 3)
|
|
87
48
|
), e.setAttribute(
|
|
88
49
|
"scaleAtt",
|
|
89
|
-
new
|
|
50
|
+
new G(new Array(t).fill(1), 1)
|
|
90
51
|
);
|
|
91
|
-
const i =
|
|
52
|
+
const i = r.material, s = new It({
|
|
92
53
|
size: 10,
|
|
93
54
|
map: i.map,
|
|
94
55
|
alphaMap: i.alphaMap,
|
|
@@ -101,19 +62,19 @@ const ee = (a, t = 1) => {
|
|
|
101
62
|
alphaTest: i.alphaTest,
|
|
102
63
|
sizeAttenuation: !1
|
|
103
64
|
});
|
|
104
|
-
return s.onBeforeCompile = (
|
|
105
|
-
|
|
65
|
+
return s.onBeforeCompile = (a) => {
|
|
66
|
+
a.vertexShader = `
|
|
106
67
|
attribute float scaleAtt;
|
|
107
|
-
${
|
|
68
|
+
${a.vertexShader.replace(
|
|
108
69
|
"gl_PointSize = size;",
|
|
109
70
|
"gl_PointSize = size * scaleAtt;"
|
|
110
71
|
)}
|
|
111
72
|
`;
|
|
112
|
-
}, new
|
|
73
|
+
}, new K(e, s);
|
|
113
74
|
};
|
|
114
|
-
class
|
|
75
|
+
class X {
|
|
115
76
|
constructor() {
|
|
116
|
-
|
|
77
|
+
this.objectType = "BaseObject", this.userData = {}, this.prefab = !1, this.isInstantiate = !1, this.isBloom = !1, this.materialList = {}, this.useMaterialType = "origin", this.onPointerIndex = [], this.disposeTrack = !0, this.disposeMaterialIfNotUsed = !0;
|
|
117
78
|
}
|
|
118
79
|
get parent() {
|
|
119
80
|
const t = this.object3d.parent;
|
|
@@ -171,10 +132,10 @@ class ie extends O {
|
|
|
171
132
|
return this.object3d = new xt(...t), this;
|
|
172
133
|
}
|
|
173
134
|
createGroup() {
|
|
174
|
-
return this.object3d = new
|
|
135
|
+
return this.object3d = new Dt(), this;
|
|
175
136
|
}
|
|
176
137
|
createPoints(...t) {
|
|
177
|
-
return this.object3d = new
|
|
138
|
+
return this.object3d = new K(...t), this;
|
|
178
139
|
}
|
|
179
140
|
createCSS2DObject(t) {
|
|
180
141
|
return this.object3d = new Rt(t), this;
|
|
@@ -186,7 +147,7 @@ class ie extends O {
|
|
|
186
147
|
return this.object3d = new Ft(t), this;
|
|
187
148
|
}
|
|
188
149
|
createSprite(t) {
|
|
189
|
-
return this.object3d = new
|
|
150
|
+
return this.object3d = new nt(t), this;
|
|
190
151
|
}
|
|
191
152
|
attach(...t) {
|
|
192
153
|
return [...t].forEach((e) => {
|
|
@@ -213,23 +174,23 @@ class ie extends O {
|
|
|
213
174
|
instantiate(t, e) {
|
|
214
175
|
return st(this, null, function* () {
|
|
215
176
|
var d;
|
|
216
|
-
const i = t && t.length > 0, s = (d = e == null ? void 0 : e.recursive) != null ? d : !0, { objectType:
|
|
217
|
-
let
|
|
218
|
-
|
|
177
|
+
const i = t && t.length > 0, s = (d = e == null ? void 0 : e.recursive) != null ? d : !0, { objectType: a, objectOptions: l } = this, [, n] = a.split("#");
|
|
178
|
+
let o = e == null ? void 0 : e.create;
|
|
179
|
+
o === void 0 && (o = (u) => {
|
|
219
180
|
if (this.object3d) {
|
|
220
181
|
if (i) {
|
|
221
182
|
const m = t.length;
|
|
222
|
-
if (this.object3d instanceof
|
|
183
|
+
if (this.object3d instanceof nt)
|
|
223
184
|
u.object3d = ee(this.object3d, m);
|
|
224
185
|
else {
|
|
225
186
|
const f = this.object3d;
|
|
226
|
-
u.object3d = new
|
|
187
|
+
u.object3d = new rt(
|
|
227
188
|
f.geometry,
|
|
228
189
|
f.material,
|
|
229
190
|
m
|
|
230
191
|
), u.setMaterialList("instantiate", "clone"), u.useMaterial("instantiate");
|
|
231
192
|
}
|
|
232
|
-
const h = new
|
|
193
|
+
const h = new R();
|
|
233
194
|
t.forEach((f, p) => {
|
|
234
195
|
const g = ut(f.position), w = ut(f.scale || [1, 1, 1]);
|
|
235
196
|
h.position.copy(g), h.scale.copy(w), h.updateMatrix(), u.setInstancedMatrix(p, h.matrix.clone());
|
|
@@ -239,11 +200,11 @@ class ie extends O {
|
|
|
239
200
|
u.object3d.userData.prefab && delete u.object3d.userData.prefab;
|
|
240
201
|
}
|
|
241
202
|
});
|
|
242
|
-
const c = yield this.lead.draw(n,
|
|
243
|
-
create:
|
|
203
|
+
const c = yield this.lead.draw(n, $(W({}, l || {}), {
|
|
204
|
+
create: o,
|
|
244
205
|
prefab: !1,
|
|
245
|
-
key: (e == null ? void 0 : e.key) || (
|
|
246
|
-
target: (e == null ? void 0 : e.target) || (
|
|
206
|
+
key: (e == null ? void 0 : e.key) || (l == null ? void 0 : l.key),
|
|
207
|
+
target: (e == null ? void 0 : e.target) || (l == null ? void 0 : l.target)
|
|
247
208
|
}));
|
|
248
209
|
return this.isBloom && c.enableBloom(), s && (yield Promise.all(
|
|
249
210
|
this.children.map(
|
|
@@ -255,11 +216,11 @@ class ie extends O {
|
|
|
255
216
|
});
|
|
256
217
|
}
|
|
257
218
|
setInstancedMatrix(t, e) {
|
|
258
|
-
if (this.object3d instanceof
|
|
219
|
+
if (this.object3d instanceof rt || this.object3d.isInstantiate)
|
|
259
220
|
this.object3d.setMatrixAt(t, e);
|
|
260
|
-
else if (this.object3d instanceof
|
|
261
|
-
const s = this.object3d.geometry,
|
|
262
|
-
e.decompose(n, c,
|
|
221
|
+
else if (this.object3d instanceof K || this.object3d.type === "Points") {
|
|
222
|
+
const s = this.object3d.geometry, a = s.attributes.position.array, l = s.attributes.scaleAtt.array, n = new C(), o = new C(), c = new Tt(), d = t * 3, u = t * 1;
|
|
223
|
+
e.decompose(n, c, o), a[d] = n.x, a[d + 1] = n.y, a[d + 2] = n.z, l[u] = Math.max(o.x, o.y, o.z), s.attributes.position.needsUpdate = !0, s.attributes.scaleAtt.needsUpdate = !0;
|
|
263
224
|
}
|
|
264
225
|
}
|
|
265
226
|
erase() {
|
|
@@ -274,8 +235,8 @@ class ie extends O {
|
|
|
274
235
|
return e.map((i) => {
|
|
275
236
|
const s = i.userData;
|
|
276
237
|
i.userData = {};
|
|
277
|
-
const
|
|
278
|
-
return i.userData = s,
|
|
238
|
+
const a = i.clone();
|
|
239
|
+
return i.userData = s, a;
|
|
279
240
|
});
|
|
280
241
|
{
|
|
281
242
|
const i = e.userData;
|
|
@@ -288,14 +249,10 @@ class ie extends O {
|
|
|
288
249
|
const s = this.object3d;
|
|
289
250
|
if (!s || !s.material)
|
|
290
251
|
return;
|
|
291
|
-
if (this.materialList.origin || (this.materialList.origin = s.material), this.materialList[t])
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
} else
|
|
296
|
-
return this.materialList[t];
|
|
297
|
-
const r = e === "clone" ? this.cloneMaterial() : e;
|
|
298
|
-
return this.materialList[t] = r, r;
|
|
252
|
+
if (this.materialList.origin || (this.materialList.origin = s.material), this.materialList[t] && !i)
|
|
253
|
+
return this.materialList[t];
|
|
254
|
+
const a = e === "clone" ? this.cloneMaterial() : e;
|
|
255
|
+
return this.materialList[t] = a, a;
|
|
299
256
|
}
|
|
300
257
|
useMaterial(t) {
|
|
301
258
|
const e = this.object3d;
|
|
@@ -318,34 +275,75 @@ class ie extends O {
|
|
|
318
275
|
}
|
|
319
276
|
dispose() {
|
|
320
277
|
var t;
|
|
321
|
-
this.onPointerIndex.forEach((e) => {
|
|
278
|
+
if (this.onPointerIndex.forEach((e) => {
|
|
322
279
|
this.lead.removePick(e);
|
|
323
|
-
}), (t = this.pencil.composerController) == null || t.bloomSelection.delete(this), this.lead && (this.lead.objects.delete(this.key), this.object3d && this.lead.objMap.delete(this.object3d)), this.
|
|
280
|
+
}), this.mList.rmBaseObjectMap(this, void 0, this.disposeMaterialIfNotUsed), (t = this.pencil.composerController) == null || t.bloomSelection.delete(this), this.lead && (this.lead.objects.delete(this.key), this.object3d && this.lead.objMap.delete(this.object3d)), this.disposeTrack) {
|
|
281
|
+
const e = new ie();
|
|
282
|
+
e.disposeMaterial = !1, e.track(this), e.dispose();
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
class ie {
|
|
287
|
+
constructor() {
|
|
288
|
+
this.resources = /* @__PURE__ */ new Set(), this.disposeMaterial = !0, this.disposeVideo = !0;
|
|
324
289
|
}
|
|
325
|
-
|
|
326
|
-
|
|
290
|
+
track(t) {
|
|
291
|
+
if (!t)
|
|
292
|
+
return t;
|
|
293
|
+
if (Array.isArray(t))
|
|
294
|
+
return t.forEach((e) => this.track(e)), t;
|
|
295
|
+
if (!this.disposeMaterial && t instanceof at)
|
|
296
|
+
return t;
|
|
297
|
+
if (t instanceof X ? (t.disposeTrack && t.object3d ? this.track(t.object3d) : this.resources.add(t), Object.values(t.materialList).map((e) => this.track(e))) : (t instanceof R || Reflect.has(t, "dispose")) && this.resources.add(t), t instanceof X)
|
|
298
|
+
t.children.forEach((e) => {
|
|
299
|
+
e.disposeTrack = !1;
|
|
300
|
+
}), this.track(t.children);
|
|
301
|
+
else if (t instanceof R) {
|
|
302
|
+
const e = t;
|
|
303
|
+
this.track(e.geometry), this.track(e.material), this.track(e.children);
|
|
304
|
+
} else if (t instanceof at) {
|
|
305
|
+
for (const i of Object.values(t))
|
|
306
|
+
i instanceof ot && this.track(i);
|
|
307
|
+
const e = t;
|
|
308
|
+
if (e.uniforms) {
|
|
309
|
+
for (const i of Object.values(e.uniforms))
|
|
310
|
+
if (i) {
|
|
311
|
+
const s = i.value;
|
|
312
|
+
(s instanceof ot || Array.isArray(s)) && this.track(s);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
} else this.disposeVideo && t instanceof _t && t.source.data && this.resources.add(t.source.data);
|
|
316
|
+
return t;
|
|
317
|
+
}
|
|
318
|
+
dispose() {
|
|
319
|
+
const t = [];
|
|
320
|
+
for (const e of this.resources)
|
|
321
|
+
e instanceof R ? t.push(e) : e instanceof HTMLVideoElement && e.pause(), Reflect.has(e, "dispose") && e.dispose();
|
|
322
|
+
t.forEach((e) => {
|
|
323
|
+
e.removeFromParent();
|
|
324
|
+
}), t.length = 0, this.resources.clear();
|
|
327
325
|
}
|
|
328
326
|
}
|
|
329
|
-
class ze extends
|
|
327
|
+
class ze extends X {
|
|
330
328
|
create() {
|
|
331
329
|
this.createGroup();
|
|
332
330
|
}
|
|
333
331
|
}
|
|
334
|
-
const N = new
|
|
335
|
-
let
|
|
336
|
-
function vt(
|
|
337
|
-
return T.set(0, 0, -t, 1).applyMatrix4(
|
|
332
|
+
const N = new O(), dt = new C(), pt = new C(), b = new O(), y = new O(), D = new O(), q = new C(), Q = new Bt(), x = new Lt(), mt = new C(), U = new Mt(), E = new Wt(), T = new O();
|
|
333
|
+
let _, L;
|
|
334
|
+
function vt(r, t, e) {
|
|
335
|
+
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));
|
|
338
336
|
}
|
|
339
|
-
function se(
|
|
340
|
-
const e =
|
|
341
|
-
for (let n = 0,
|
|
342
|
-
x.start.fromBufferAttribute(s, n), x.end.fromBufferAttribute(
|
|
337
|
+
function se(r, t) {
|
|
338
|
+
const e = r.matrixWorld, i = r.geometry, s = i.attributes.instanceStart, a = i.attributes.instanceEnd, l = Math.min(i.instanceCount, s.count);
|
|
339
|
+
for (let n = 0, o = l; n < o; n++) {
|
|
340
|
+
x.start.fromBufferAttribute(s, n), x.end.fromBufferAttribute(a, n), x.applyMatrix4(e);
|
|
343
341
|
const c = new C(), d = new C();
|
|
344
|
-
|
|
342
|
+
_.distanceSqToSegment(x.start, x.end, d, c), d.distanceTo(c) < L * 0.5 && t.push({
|
|
345
343
|
point: d,
|
|
346
344
|
pointOnLine: c,
|
|
347
|
-
distance:
|
|
348
|
-
object:
|
|
345
|
+
distance: _.origin.distanceTo(d),
|
|
346
|
+
object: r,
|
|
349
347
|
face: null,
|
|
350
348
|
faceIndex: n,
|
|
351
349
|
uv: null,
|
|
@@ -353,31 +351,31 @@ function se(a, t) {
|
|
|
353
351
|
});
|
|
354
352
|
}
|
|
355
353
|
}
|
|
356
|
-
function ne(
|
|
357
|
-
const i = t.projectionMatrix,
|
|
358
|
-
|
|
354
|
+
function ne(r, t, e) {
|
|
355
|
+
const i = t.projectionMatrix, a = r.material.resolution, l = r.matrixWorld, n = r.geometry, o = n.attributes.instanceStart, c = n.attributes.instanceEnd, d = Math.min(n.instanceCount, o.count), u = -t.near;
|
|
356
|
+
_.at(1, D), D.w = 1, D.applyMatrix4(t.matrixWorldInverse), D.applyMatrix4(i), D.multiplyScalar(1 / D.w), D.x *= a.x / 2, D.y *= a.y / 2, D.z = 0, q.copy(D), Q.multiplyMatrices(t.matrixWorldInverse, l);
|
|
359
357
|
for (let m = 0, h = d; m < h; m++) {
|
|
360
|
-
if (b.fromBufferAttribute(
|
|
358
|
+
if (b.fromBufferAttribute(o, m), y.fromBufferAttribute(c, m), b.w = 1, y.w = 1, b.applyMatrix4(Q), y.applyMatrix4(Q), b.z > u && y.z > u)
|
|
361
359
|
continue;
|
|
362
360
|
if (b.z > u) {
|
|
363
|
-
const
|
|
361
|
+
const I = b.z - y.z, P = (b.z - u) / I;
|
|
364
362
|
b.lerp(y, P);
|
|
365
363
|
} else if (y.z > u) {
|
|
366
|
-
const
|
|
364
|
+
const I = y.z - b.z, P = (y.z - u) / I;
|
|
367
365
|
y.lerp(b, P);
|
|
368
366
|
}
|
|
369
|
-
b.applyMatrix4(i), y.applyMatrix4(i), b.multiplyScalar(1 / b.w), y.multiplyScalar(1 / y.w), b.x *=
|
|
370
|
-
const p = x.closestPointToPointParameter(
|
|
367
|
+
b.applyMatrix4(i), y.applyMatrix4(i), b.multiplyScalar(1 / b.w), y.multiplyScalar(1 / y.w), b.x *= a.x / 2, b.y *= a.y / 2, y.x *= a.x / 2, y.y *= a.y / 2, x.start.copy(b), x.start.z = 0, x.end.copy(y), x.end.z = 0;
|
|
368
|
+
const p = x.closestPointToPointParameter(q, !0);
|
|
371
369
|
x.at(p, mt);
|
|
372
|
-
const g = Vt.lerp(b.z, y.z, p), w = g >= -1 && g <= 1, z =
|
|
370
|
+
const g = Vt.lerp(b.z, y.z, p), w = g >= -1 && g <= 1, z = q.distanceTo(mt) < L * 0.5;
|
|
373
371
|
if (w && z) {
|
|
374
|
-
x.start.fromBufferAttribute(
|
|
375
|
-
const
|
|
376
|
-
|
|
372
|
+
x.start.fromBufferAttribute(o, m), x.end.fromBufferAttribute(c, m), x.start.applyMatrix4(l), x.end.applyMatrix4(l);
|
|
373
|
+
const I = new C(), P = new C();
|
|
374
|
+
_.distanceSqToSegment(x.start, x.end, P, I), e.push({
|
|
377
375
|
point: P,
|
|
378
|
-
pointOnLine:
|
|
379
|
-
distance:
|
|
380
|
-
object:
|
|
376
|
+
pointOnLine: I,
|
|
377
|
+
distance: _.origin.distanceTo(P),
|
|
378
|
+
object: r,
|
|
381
379
|
face: null,
|
|
382
380
|
faceIndex: m,
|
|
383
381
|
uv: null,
|
|
@@ -386,26 +384,26 @@ function ne(a, t, e) {
|
|
|
386
384
|
}
|
|
387
385
|
}
|
|
388
386
|
}
|
|
389
|
-
class
|
|
387
|
+
class Ie extends xt {
|
|
390
388
|
constructor(t = new Qt(), e) {
|
|
391
389
|
super(t, e), this.isLineSegments2 = !0, this.type = "LineSegments2";
|
|
392
390
|
}
|
|
393
391
|
// for backwards-compatibility, but could be a method of LineSegmentsGeometry...
|
|
394
392
|
computeLineDistances() {
|
|
395
393
|
const t = this.geometry, e = t.attributes.instanceStart, i = t.attributes.instanceEnd, s = new Float32Array(2 * e.count);
|
|
396
|
-
for (let
|
|
397
|
-
dt.fromBufferAttribute(e,
|
|
398
|
-
const
|
|
394
|
+
for (let l = 0, n = 0, o = e.count; l < o; l++, n += 2)
|
|
395
|
+
dt.fromBufferAttribute(e, l), pt.fromBufferAttribute(i, l), s[n] = n === 0 ? 0 : s[n - 1], s[n + 1] = s[n] + dt.distanceTo(pt);
|
|
396
|
+
const a = new Ot(
|
|
399
397
|
s,
|
|
400
398
|
2,
|
|
401
399
|
1
|
|
402
400
|
);
|
|
403
401
|
return t.setAttribute(
|
|
404
402
|
"instanceDistanceStart",
|
|
405
|
-
new lt(
|
|
403
|
+
new lt(a, 1, 0)
|
|
406
404
|
), t.setAttribute(
|
|
407
405
|
"instanceDistanceEnd",
|
|
408
|
-
new lt(
|
|
406
|
+
new lt(a, 1, 1)
|
|
409
407
|
), this;
|
|
410
408
|
}
|
|
411
409
|
raycast(t, e) {
|
|
@@ -413,42 +411,42 @@ class De extends xt {
|
|
|
413
411
|
s === null && !i && console.error(
|
|
414
412
|
'LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.'
|
|
415
413
|
);
|
|
416
|
-
const
|
|
417
|
-
|
|
418
|
-
const
|
|
419
|
-
|
|
414
|
+
const a = t.params.Line2 !== void 0 && t.params.Line2.threshold || 0;
|
|
415
|
+
_ = t.ray;
|
|
416
|
+
const l = this.matrixWorld, n = this.geometry, o = this.material;
|
|
417
|
+
L = o.linewidth + a, n.boundingSphere === null && n.computeBoundingSphere(), E.copy(n.boundingSphere).applyMatrix4(l);
|
|
420
418
|
let c;
|
|
421
419
|
if (i)
|
|
422
|
-
c =
|
|
420
|
+
c = L * 0.5;
|
|
423
421
|
else {
|
|
424
422
|
const u = Math.max(
|
|
425
423
|
s.near,
|
|
426
|
-
|
|
424
|
+
E.distanceToPoint(_.origin)
|
|
427
425
|
);
|
|
428
426
|
c = vt(
|
|
429
427
|
s,
|
|
430
428
|
u,
|
|
431
|
-
|
|
429
|
+
o.resolution
|
|
432
430
|
);
|
|
433
431
|
}
|
|
434
|
-
if (
|
|
432
|
+
if (E.radius += c, _.intersectsSphere(E) === !1)
|
|
435
433
|
return;
|
|
436
|
-
n.boundingBox === null && n.computeBoundingBox(), U.copy(n.boundingBox).applyMatrix4(
|
|
434
|
+
n.boundingBox === null && n.computeBoundingBox(), U.copy(n.boundingBox).applyMatrix4(l);
|
|
437
435
|
let d;
|
|
438
436
|
if (i)
|
|
439
|
-
d =
|
|
437
|
+
d = L * 0.5;
|
|
440
438
|
else {
|
|
441
439
|
const u = Math.max(
|
|
442
440
|
s.near,
|
|
443
|
-
U.distanceToPoint(
|
|
441
|
+
U.distanceToPoint(_.origin)
|
|
444
442
|
);
|
|
445
443
|
d = vt(
|
|
446
444
|
s,
|
|
447
445
|
u,
|
|
448
|
-
|
|
446
|
+
o.resolution
|
|
449
447
|
);
|
|
450
448
|
}
|
|
451
|
-
U.expandByScalar(d),
|
|
449
|
+
U.expandByScalar(d), _.intersectsBox(U) !== !1 && (i ? se(this, e) : ne(this, s, e));
|
|
452
450
|
}
|
|
453
451
|
onBeforeRender(t) {
|
|
454
452
|
const e = this.material.uniforms;
|
|
@@ -603,14 +601,14 @@ const gt = ["encodings_fragment", "colorspace_fragment"], re = (
|
|
|
603
601
|
|
|
604
602
|
#include <fog_fragment>
|
|
605
603
|
#include <tonemapping_fragment>
|
|
606
|
-
#include <${+
|
|
604
|
+
#include <${+Et < 154 ? gt[0] : gt[1]}>
|
|
607
605
|
}
|
|
608
606
|
`
|
|
609
607
|
);
|
|
610
|
-
class
|
|
608
|
+
class De extends kt {
|
|
611
609
|
constructor(t) {
|
|
612
610
|
super({
|
|
613
|
-
uniforms:
|
|
611
|
+
uniforms: $(W({}, Ut.fog), {
|
|
614
612
|
lineWidth: { value: 1 },
|
|
615
613
|
map: { value: null },
|
|
616
614
|
useMap: { value: 0 },
|
|
@@ -618,7 +616,7 @@ class Ie extends kt {
|
|
|
618
616
|
useAlphaMap: { value: 0 },
|
|
619
617
|
color: { value: new ct(16777215) },
|
|
620
618
|
opacity: { value: 1 },
|
|
621
|
-
resolution: { value: new
|
|
619
|
+
resolution: { value: new k(1, 1) },
|
|
622
620
|
sizeAttenuation: { value: 1 },
|
|
623
621
|
dashArray: { value: 0 },
|
|
624
622
|
dashOffset: { value: 0 },
|
|
@@ -627,15 +625,15 @@ class Ie extends kt {
|
|
|
627
625
|
useDepth: { value: 0 },
|
|
628
626
|
visibility: { value: 1 },
|
|
629
627
|
alphaTest: { value: 0 },
|
|
630
|
-
repeat: { value: new
|
|
631
|
-
offset: { value: new
|
|
628
|
+
repeat: { value: new k(1, 1) },
|
|
629
|
+
offset: { value: new k(0, 0) },
|
|
632
630
|
offsetLoop: { value: 1 },
|
|
633
631
|
lineLightAnimation: { value: 0 },
|
|
634
632
|
time: { value: 0 },
|
|
635
633
|
size: { value: 300 },
|
|
636
634
|
speed: { value: 0.3 },
|
|
637
635
|
lightWidth: { value: 0.1 },
|
|
638
|
-
uCenter: { value: new
|
|
636
|
+
uCenter: { value: new k(0, 0) },
|
|
639
637
|
lightColor: { value: new ct(16777215) }
|
|
640
638
|
}),
|
|
641
639
|
vertexShader: re,
|
|
@@ -863,72 +861,72 @@ class Ie extends kt {
|
|
|
863
861
|
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;
|
|
864
862
|
}
|
|
865
863
|
}
|
|
866
|
-
function oe(
|
|
867
|
-
return
|
|
864
|
+
function oe(r, t) {
|
|
865
|
+
return r.map((e) => {
|
|
868
866
|
const i = [];
|
|
869
867
|
let s;
|
|
870
|
-
return e.forEach((
|
|
868
|
+
return e.forEach((a) => {
|
|
871
869
|
if (s) {
|
|
872
|
-
const
|
|
873
|
-
if (
|
|
874
|
-
const n =
|
|
875
|
-
let c =
|
|
870
|
+
const l = $t(a, s) * 180 / Math.PI;
|
|
871
|
+
if (l > t) {
|
|
872
|
+
const n = Nt(s, a), o = 1 / Math.ceil(l / t);
|
|
873
|
+
let c = o;
|
|
876
874
|
for (; c < 1; )
|
|
877
|
-
i.push(n(c)), c +=
|
|
875
|
+
i.push(n(c)), c += o;
|
|
878
876
|
}
|
|
879
877
|
}
|
|
880
|
-
i.push(s =
|
|
878
|
+
i.push(s = a);
|
|
881
879
|
}), i;
|
|
882
880
|
});
|
|
883
881
|
}
|
|
884
|
-
function le(
|
|
885
|
-
const
|
|
882
|
+
function le(r, { minLng: t, maxLng: e, minLat: i, maxLat: s } = {}) {
|
|
883
|
+
const a = Math.round(it(360 / r, 2) / Math.PI), l = (1 + Math.sqrt(5)) / 2, n = (h) => h / l * 360 % 360 - 180, o = (h) => Math.acos(2 * h / a - 1) / Math.PI * 180 - 90, c = (h) => a * (Math.cos((h + 90) * Math.PI / 180) + 1) / 2, d = [
|
|
886
884
|
s !== void 0 ? Math.ceil(c(s)) : 0,
|
|
887
|
-
i !== void 0 ? Math.floor(c(i)) :
|
|
885
|
+
i !== void 0 ? Math.floor(c(i)) : a - 1
|
|
888
886
|
], 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
887
|
for (let h = d[0]; h <= d[1]; h++) {
|
|
890
888
|
const f = n(h);
|
|
891
|
-
u(f) && m.push([f,
|
|
889
|
+
u(f) && m.push([f, o(h)]);
|
|
892
890
|
}
|
|
893
891
|
return m;
|
|
894
892
|
}
|
|
895
|
-
function Y(
|
|
896
|
-
return e ? Zt(t,
|
|
893
|
+
function Y(r, t, e = !1) {
|
|
894
|
+
return e ? Zt(t, r) : Jt(r, t);
|
|
897
895
|
}
|
|
898
|
-
function ce(
|
|
899
|
-
const e = { type: "Polygon", coordinates:
|
|
900
|
-
if (Math.min(Math.abs(
|
|
896
|
+
function ce(r, t) {
|
|
897
|
+
const e = { type: "Polygon", coordinates: r }, [[i, s], [a, l]] = wt(e);
|
|
898
|
+
if (Math.min(Math.abs(a - i), Math.abs(l - s)) < t)
|
|
901
899
|
return [];
|
|
902
|
-
const n = i >
|
|
900
|
+
const n = i > a || l >= 89 || s <= -89;
|
|
903
901
|
return le(t, {
|
|
904
902
|
minLng: i,
|
|
905
|
-
maxLng:
|
|
903
|
+
maxLng: a,
|
|
906
904
|
minLat: s,
|
|
907
|
-
maxLat:
|
|
905
|
+
maxLat: l
|
|
908
906
|
}).filter(
|
|
909
|
-
(
|
|
907
|
+
(o) => Y(o, e, n)
|
|
910
908
|
);
|
|
911
909
|
}
|
|
912
|
-
function ue(
|
|
913
|
-
const s = oe(
|
|
910
|
+
function ue(r, { resolution: t = 1 / 0, bbox: e, projection: i } = {}) {
|
|
911
|
+
const s = oe(r, t), a = J(s), l = ce(r, t), n = [...a, ...l], o = { type: "Polygon", coordinates: r }, [[c, d], [u, m]] = wt(o), h = c > u || // crosses antimeridian
|
|
914
912
|
m >= 89 || // crosses north pole
|
|
915
913
|
d <= -89;
|
|
916
914
|
let f = [];
|
|
917
915
|
if (h) {
|
|
918
916
|
const v = te(n).triangles(), M = new Map(
|
|
919
|
-
n.map(([
|
|
917
|
+
n.map(([j, A], B) => [`${j}-${A}`, B])
|
|
920
918
|
);
|
|
921
|
-
v.features.forEach((
|
|
922
|
-
const
|
|
923
|
-
if (
|
|
924
|
-
const
|
|
925
|
-
M.has(
|
|
919
|
+
v.features.forEach((j) => {
|
|
920
|
+
const A = j.geometry.coordinates[0].slice(0, 3).reverse(), B = [];
|
|
921
|
+
if (A.forEach(([S, Z]) => {
|
|
922
|
+
const V = `${S}-${Z}`;
|
|
923
|
+
M.has(V) && B.push(M.get(V));
|
|
926
924
|
}), B.length === 3) {
|
|
927
|
-
if (B.some((S) => S <
|
|
928
|
-
const S =
|
|
925
|
+
if (B.some((S) => S < a.length)) {
|
|
926
|
+
const S = j.properties.circumcenter;
|
|
929
927
|
if (!Y(
|
|
930
928
|
S,
|
|
931
|
-
|
|
929
|
+
o,
|
|
932
930
|
h
|
|
933
931
|
))
|
|
934
932
|
return;
|
|
@@ -936,22 +934,22 @@ function ue(a, { resolution: t = 1 / 0, bbox: e, projection: i } = {}) {
|
|
|
936
934
|
f.push(...B);
|
|
937
935
|
}
|
|
938
936
|
});
|
|
939
|
-
} else if (
|
|
937
|
+
} else if (l.length) {
|
|
940
938
|
const v = Ht.from(n);
|
|
941
|
-
for (let M = 0,
|
|
942
|
-
const
|
|
943
|
-
if (
|
|
939
|
+
for (let M = 0, j = v.triangles.length; M < j; M += 3) {
|
|
940
|
+
const A = [2, 1, 0].map((S) => v.triangles[M + S]), B = A.map((S) => n[S]);
|
|
941
|
+
if (A.some((S) => S < a.length)) {
|
|
944
942
|
const S = [0, 1].map(
|
|
945
|
-
(
|
|
943
|
+
(Z) => Kt(B, (V) => V[Z])
|
|
946
944
|
);
|
|
947
945
|
if (!Y(
|
|
948
946
|
S,
|
|
949
|
-
|
|
947
|
+
o,
|
|
950
948
|
h
|
|
951
949
|
))
|
|
952
950
|
continue;
|
|
953
951
|
}
|
|
954
|
-
f.push(...
|
|
952
|
+
f.push(...A);
|
|
955
953
|
}
|
|
956
954
|
} else {
|
|
957
955
|
const { vertices: v, holes: M = [] } = Pt(s);
|
|
@@ -959,43 +957,43 @@ function ue(a, { resolution: t = 1 / 0, bbox: e, projection: i } = {}) {
|
|
|
959
957
|
}
|
|
960
958
|
let p = e ? [e[0], e[2]] : ht(n, (v) => v[0]), g = e ? [e[1], e[3]] : ht(n, (v) => v[1]);
|
|
961
959
|
if (i) {
|
|
962
|
-
const [v, M] = i([p[0], g[0]]), [
|
|
963
|
-
p = [v,
|
|
960
|
+
const [v, M] = i([p[0], g[0]]), [j, A] = i([p[1], g[1]]);
|
|
961
|
+
p = [v, j], g = [-M, -A];
|
|
964
962
|
}
|
|
965
|
-
const w = ft(p, [0, 1]), z = ft(g, [0, 1]),
|
|
963
|
+
const w = ft(p, [0, 1]), z = ft(g, [0, 1]), I = n.map(([v, M]) => {
|
|
966
964
|
if (i) {
|
|
967
|
-
const [
|
|
968
|
-
return [w(
|
|
965
|
+
const [j, A] = i([v, M]);
|
|
966
|
+
return [w(j), z(-A)];
|
|
969
967
|
} else
|
|
970
968
|
return [w(v), z(M)];
|
|
971
969
|
});
|
|
972
|
-
return { contour: s, triangles: { points: n, indices: f, uvs:
|
|
970
|
+
return { contour: s, triangles: { points: n, indices: f, uvs: I } };
|
|
973
971
|
}
|
|
974
972
|
const bt = new H().setAttribute ? "setAttribute" : "addAttribute";
|
|
975
|
-
function
|
|
976
|
-
const s =
|
|
977
|
-
(
|
|
973
|
+
function F(r, t, e, i) {
|
|
974
|
+
const s = r.map(
|
|
975
|
+
(a) => a.map(([l, n]) => {
|
|
978
976
|
if (i) {
|
|
979
|
-
const [
|
|
980
|
-
return [
|
|
977
|
+
const [o, c] = i([l, n]);
|
|
978
|
+
return [o, -c, t];
|
|
981
979
|
}
|
|
982
|
-
return e ?
|
|
980
|
+
return e ? qt(l, n, t) : [l, n, t];
|
|
983
981
|
})
|
|
984
982
|
);
|
|
985
983
|
return Pt(s);
|
|
986
984
|
}
|
|
987
|
-
function he(
|
|
988
|
-
const { vertices:
|
|
989
|
-
|
|
985
|
+
function he(r, t, e, i, s) {
|
|
986
|
+
const { vertices: a, holes: l } = F(
|
|
987
|
+
r,
|
|
990
988
|
t,
|
|
991
989
|
i,
|
|
992
990
|
s
|
|
993
|
-
), { vertices: n } =
|
|
994
|
-
|
|
991
|
+
), { vertices: n } = F(
|
|
992
|
+
r,
|
|
995
993
|
e,
|
|
996
994
|
i,
|
|
997
995
|
s
|
|
998
|
-
),
|
|
996
|
+
), o = J([n, a]), c = Math.round(n.length / 3), d = new Set(l);
|
|
999
997
|
let u = 0;
|
|
1000
998
|
const m = [];
|
|
1001
999
|
for (let f = 0; f < c; f++) {
|
|
@@ -1011,58 +1009,58 @@ function he(a, t, e, i, s) {
|
|
|
1011
1009
|
const h = [];
|
|
1012
1010
|
for (let f = 1; f >= 0; f--)
|
|
1013
1011
|
for (let p = 0; p < c; p += 1) h.push(p / (c - 1), f);
|
|
1014
|
-
return { indices: m, vertices:
|
|
1012
|
+
return { indices: m, vertices: o, uvs: h, topVerts: n };
|
|
1015
1013
|
}
|
|
1016
|
-
function yt(
|
|
1014
|
+
function yt(r, t, e, i, s, a) {
|
|
1017
1015
|
return {
|
|
1018
|
-
indices: i ?
|
|
1019
|
-
vertices:
|
|
1020
|
-
[
|
|
1016
|
+
indices: i ? r.indices : r.indices.slice().reverse(),
|
|
1017
|
+
vertices: F(
|
|
1018
|
+
[r.points],
|
|
1021
1019
|
t,
|
|
1022
1020
|
s,
|
|
1023
|
-
|
|
1021
|
+
a
|
|
1024
1022
|
).vertices,
|
|
1025
1023
|
uvs: e
|
|
1026
1024
|
};
|
|
1027
1025
|
}
|
|
1028
1026
|
const fe = ({
|
|
1029
|
-
polygonGeoJson:
|
|
1027
|
+
polygonGeoJson: r,
|
|
1030
1028
|
startHeight: t,
|
|
1031
1029
|
endHeight: e,
|
|
1032
1030
|
curvatureResolution: i = 1,
|
|
1033
1031
|
cartesian: s = !0,
|
|
1034
|
-
hasSide:
|
|
1035
|
-
hasBottom:
|
|
1032
|
+
hasSide: a = !0,
|
|
1033
|
+
hasBottom: l = !1,
|
|
1036
1034
|
hasTop: n = !1,
|
|
1037
|
-
projection:
|
|
1035
|
+
projection: o,
|
|
1038
1036
|
bbox: c
|
|
1039
1037
|
}) => {
|
|
1040
|
-
|
|
1038
|
+
r.forEach((w) => {
|
|
1041
1039
|
Yt(w) || w.reverse();
|
|
1042
1040
|
});
|
|
1043
|
-
const { contour: d, triangles: u } = ue(
|
|
1041
|
+
const { contour: d, triangles: u } = ue(r, {
|
|
1044
1042
|
resolution: i,
|
|
1045
1043
|
bbox: c,
|
|
1046
|
-
projection:
|
|
1044
|
+
projection: o
|
|
1047
1045
|
});
|
|
1048
1046
|
let m = {}, h;
|
|
1049
|
-
|
|
1047
|
+
a && (m = he(
|
|
1050
1048
|
d,
|
|
1051
1049
|
t != null ? t : e,
|
|
1052
1050
|
e != null ? e : t,
|
|
1053
1051
|
s,
|
|
1054
|
-
|
|
1052
|
+
o
|
|
1055
1053
|
), h = m.topVerts);
|
|
1056
1054
|
let f = [];
|
|
1057
|
-
(
|
|
1055
|
+
(l || n) && (f = J(u.uvs));
|
|
1058
1056
|
let p = {};
|
|
1059
|
-
|
|
1057
|
+
l && (p = yt(
|
|
1060
1058
|
u,
|
|
1061
1059
|
t,
|
|
1062
1060
|
f,
|
|
1063
1061
|
!1,
|
|
1064
1062
|
s,
|
|
1065
|
-
|
|
1063
|
+
o
|
|
1066
1064
|
));
|
|
1067
1065
|
let g = {};
|
|
1068
1066
|
return n && (g = yt(
|
|
@@ -1071,12 +1069,12 @@ const fe = ({
|
|
|
1071
1069
|
f,
|
|
1072
1070
|
!0,
|
|
1073
1071
|
s,
|
|
1074
|
-
|
|
1072
|
+
o
|
|
1075
1073
|
)), { contour: d, triangles: u, sideTorso: m, bottomCap: p, topCap: g, topVerts: h };
|
|
1076
1074
|
};
|
|
1077
1075
|
class Te extends H {
|
|
1078
1076
|
constructor(t, e = {}) {
|
|
1079
|
-
super(), this.type = "PolygonBufferGeometry", this.parameters =
|
|
1077
|
+
super(), this.type = "PolygonBufferGeometry", this.parameters = W({
|
|
1080
1078
|
polygonGeoJson: t,
|
|
1081
1079
|
startHeight: 0,
|
|
1082
1080
|
endHeight: 1,
|
|
@@ -1091,34 +1089,34 @@ class Te extends H {
|
|
|
1091
1089
|
const {
|
|
1092
1090
|
endHeight: i,
|
|
1093
1091
|
hasTop: s,
|
|
1094
|
-
topFirst:
|
|
1095
|
-
hasBottom:
|
|
1092
|
+
topFirst: a,
|
|
1093
|
+
hasBottom: l,
|
|
1096
1094
|
hasSide: n,
|
|
1097
|
-
cartesian:
|
|
1095
|
+
cartesian: o,
|
|
1098
1096
|
userDataRsoOffset: c,
|
|
1099
1097
|
projection: d
|
|
1100
|
-
} = this.parameters, { contour: u, sideTorso: m, topVerts: h, bottomCap: f, topCap: p } = fe(
|
|
1101
|
-
let g = [], w = [], z = [],
|
|
1098
|
+
} = this.parameters, { contour: u, sideTorso: m, topVerts: h, bottomCap: f, topCap: p } = fe(W({}, this.parameters));
|
|
1099
|
+
let g = [], w = [], z = [], I = 0;
|
|
1102
1100
|
const P = (v) => {
|
|
1103
|
-
const M = Math.round(g.length / 3),
|
|
1101
|
+
const M = Math.round(g.length / 3), j = z.length;
|
|
1104
1102
|
g = g.concat(v.vertices), w = w.concat(v.uvs), z = z.concat(
|
|
1105
|
-
M ? v.indices.map((
|
|
1106
|
-
), this.addGroup(
|
|
1103
|
+
M ? v.indices.map((A) => A + M) : v.indices
|
|
1104
|
+
), this.addGroup(j, z.length - j, I++);
|
|
1107
1105
|
};
|
|
1108
|
-
s &&
|
|
1106
|
+
s && a && P(p), n && (P(m), this.userData.topVerts = c ? F(
|
|
1109
1107
|
u,
|
|
1110
1108
|
i + c,
|
|
1111
|
-
|
|
1109
|
+
o,
|
|
1112
1110
|
d
|
|
1113
|
-
).vertices : h),
|
|
1111
|
+
).vertices : h), l && P(f), s && !a && P(p), this.setIndex(z), this[bt]("position", new G(g, 3)), this[bt]("uv", new G(w, 2)), this.computeVertexNormals();
|
|
1114
1112
|
}
|
|
1115
1113
|
}
|
|
1116
1114
|
export {
|
|
1117
|
-
|
|
1115
|
+
X as B,
|
|
1118
1116
|
ze as G,
|
|
1119
|
-
|
|
1120
|
-
|
|
1117
|
+
Ie as L,
|
|
1118
|
+
De as M,
|
|
1121
1119
|
Te as P,
|
|
1122
|
-
|
|
1120
|
+
ie as R,
|
|
1123
1121
|
fe as g
|
|
1124
1122
|
};
|