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