gl-draw 0.15.0-beta.9 → 0.15.1
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 +2 -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 +6 -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 +882 -810
- package/dist/index.module2.js +270 -266
- package/dist/index2.js +4 -4
- package/dist/objects/extrudePolygon/createGeometry.d.ts +5 -1
- package/dist/objects/index.js +1 -1
- package/dist/objects/index.module.js +63 -58
- package/dist/objects/pie/index.d.ts +5 -1
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/index.module.js +13 -13
- 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
|
+
}, Z = (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 Q, Mesh as Mt, Group as Bt, Sprite as st, Box3 as xt, Vector3 as C, InstancedMesh as nt, Quaternion as Lt, Object3D as R, Material as rt, Texture as at, VideoTexture as Dt, Vector4 as O, Matrix4 as Tt, Line3 as _t, 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 Nt, geoDistance as Zt, geoInterpolate as $t } from "d3-geo";
|
|
33
33
|
import "d3-geo-projection";
|
|
34
|
-
import { p as
|
|
34
|
+
import { p as ct, a as qt } from "./parseVector.module.js";
|
|
35
35
|
import { LineSegmentsGeometry as Kt } from "three/examples/jsm/lines/LineSegmentsGeometry";
|
|
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
|
|
36
|
+
import { merge as H, mean as Qt, 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
|
-
}, new
|
|
73
|
+
}, new Q(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
|
}
|
|
@@ -132,22 +132,22 @@ class X {
|
|
|
132
132
|
return this.object3d = new Mt(...t), this;
|
|
133
133
|
}
|
|
134
134
|
createGroup() {
|
|
135
|
-
return this.object3d = new
|
|
135
|
+
return this.object3d = new Bt(), this;
|
|
136
136
|
}
|
|
137
137
|
createPoints(...t) {
|
|
138
|
-
return this.object3d = new
|
|
138
|
+
return this.object3d = new Q(...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 xt().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, Z(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
|
-
else if (this.object3d instanceof
|
|
222
|
-
const s = this.object3d.geometry,
|
|
223
|
-
e.decompose(n, c,
|
|
217
|
+
else if (this.object3d instanceof Q || this.object3d.type === "Points") {
|
|
218
|
+
const s = this.object3d.geometry, r = s.attributes.position.array, l = s.attributes.scaleAtt.array, n = new C(), o = new C(), c = new Lt(), 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,30 @@ 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
|
+
useMListById(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
|
+
}
|
|
266
|
+
useMListByName(t, e) {
|
|
267
|
+
if (!this.mList)
|
|
268
|
+
return;
|
|
269
|
+
const i = this.mList.getKeyByName(t);
|
|
270
|
+
i && this.useMListById(i, e);
|
|
271
|
+
}
|
|
265
272
|
setTop(t) {
|
|
266
273
|
this.object3d && (this.object3d.renderOrder = t);
|
|
267
274
|
}
|
|
@@ -281,13 +288,17 @@ class X {
|
|
|
281
288
|
var t;
|
|
282
289
|
if (this.onPointerIndex.forEach((e) => {
|
|
283
290
|
this.lead.removePick(e);
|
|
284
|
-
}), this.
|
|
285
|
-
|
|
286
|
-
|
|
291
|
+
}), this.pencil.options.mList && this.mList.rmBaseObjectMap(
|
|
292
|
+
this,
|
|
293
|
+
void 0,
|
|
294
|
+
this.disposeMaterialIfNotUsed
|
|
295
|
+
), (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) {
|
|
296
|
+
const e = new ie();
|
|
297
|
+
e.disposeMaterial = !this.pencil.options.mList, e.track(this), e.dispose();
|
|
287
298
|
}
|
|
288
299
|
}
|
|
289
300
|
}
|
|
290
|
-
class
|
|
301
|
+
class ie {
|
|
291
302
|
constructor() {
|
|
292
303
|
this.resources = /* @__PURE__ */ new Set(), this.disposeMaterial = !0, this.disposeVideo = !0;
|
|
293
304
|
}
|
|
@@ -296,32 +307,31 @@ class dt {
|
|
|
296
307
|
return t;
|
|
297
308
|
if (Array.isArray(t))
|
|
298
309
|
return t.forEach((e) => this.track(e)), t;
|
|
299
|
-
if (!this.disposeMaterial && t instanceof
|
|
310
|
+
if (!this.disposeMaterial && t instanceof rt)
|
|
300
311
|
return t;
|
|
301
|
-
if (t instanceof
|
|
312
|
+
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
313
|
t.children.forEach((e) => {
|
|
303
314
|
e.disposeTrack = !1;
|
|
304
315
|
}), this.track(t.children);
|
|
305
316
|
else if (t instanceof R) {
|
|
306
317
|
const e = t;
|
|
307
318
|
this.track(e.geometry), this.track(e.material), this.track(e.children);
|
|
308
|
-
} else if (t instanceof
|
|
319
|
+
} else if (t instanceof rt) {
|
|
309
320
|
for (const i of Object.values(t))
|
|
310
|
-
i instanceof
|
|
321
|
+
i instanceof at && this.track(i);
|
|
311
322
|
const e = t;
|
|
312
323
|
if (e.uniforms) {
|
|
313
324
|
for (const i of Object.values(e.uniforms))
|
|
314
325
|
if (i) {
|
|
315
326
|
const s = i.value;
|
|
316
|
-
(s instanceof
|
|
327
|
+
(s instanceof at || Array.isArray(s)) && this.track(s);
|
|
317
328
|
}
|
|
318
329
|
}
|
|
319
|
-
} else this.disposeVideo && t instanceof
|
|
330
|
+
} else this.disposeVideo && t instanceof Dt && t.source.data && this.resources.add(t.source.data);
|
|
320
331
|
return t;
|
|
321
332
|
}
|
|
322
333
|
dispose() {
|
|
323
334
|
const t = [];
|
|
324
|
-
console.log("this.resources", this.resources);
|
|
325
335
|
for (const e of this.resources)
|
|
326
336
|
e instanceof R ? t.push(e) : e instanceof HTMLVideoElement && e.pause(), Reflect.has(e, "dispose") && e.dispose();
|
|
327
337
|
t.forEach((e) => {
|
|
@@ -329,26 +339,21 @@ class dt {
|
|
|
329
339
|
}), t.length = 0, this.resources.clear();
|
|
330
340
|
}
|
|
331
341
|
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
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();
|
|
338
|
-
let _, L;
|
|
339
|
-
function gt(r, t, e) {
|
|
340
|
-
return D.set(0, 0, -t, 1).applyMatrix4(r.projectionMatrix), D.multiplyScalar(1 / D.w), D.x = L / e.width, D.y = L / e.height, D.applyMatrix4(r.projectionMatrixInverse), D.multiplyScalar(1 / D.w), Math.abs(Math.max(D.x, D.y));
|
|
342
|
+
const $ = new O(), dt = new C(), pt = new C(), b = new O(), y = new O(), B = new O(), q = new C(), K = new Tt(), M = new _t(), mt = new C(), U = new xt(), E = new Wt(), L = new O();
|
|
343
|
+
let D, _;
|
|
344
|
+
function vt(a, t, e) {
|
|
345
|
+
return L.set(0, 0, -t, 1).applyMatrix4(a.projectionMatrix), L.multiplyScalar(1 / L.w), L.x = _ / e.width, L.y = _ / e.height, L.applyMatrix4(a.projectionMatrixInverse), L.multiplyScalar(1 / L.w), Math.abs(Math.max(L.x, L.y));
|
|
341
346
|
}
|
|
342
|
-
function se(
|
|
343
|
-
const e =
|
|
344
|
-
for (let n = 0,
|
|
345
|
-
|
|
346
|
-
const c = new C(),
|
|
347
|
-
|
|
348
|
-
point:
|
|
347
|
+
function se(a, t) {
|
|
348
|
+
const e = a.matrixWorld, i = a.geometry, s = i.attributes.instanceStart, r = i.attributes.instanceEnd, l = Math.min(i.instanceCount, s.count);
|
|
349
|
+
for (let n = 0, o = l; n < o; n++) {
|
|
350
|
+
M.start.fromBufferAttribute(s, n), M.end.fromBufferAttribute(r, n), M.applyMatrix4(e);
|
|
351
|
+
const c = new C(), p = new C();
|
|
352
|
+
D.distanceSqToSegment(M.start, M.end, p, c), p.distanceTo(c) < _ * 0.5 && t.push({
|
|
353
|
+
point: p,
|
|
349
354
|
pointOnLine: c,
|
|
350
|
-
distance:
|
|
351
|
-
object:
|
|
355
|
+
distance: D.origin.distanceTo(p),
|
|
356
|
+
object: a,
|
|
352
357
|
face: null,
|
|
353
358
|
faceIndex: n,
|
|
354
359
|
uv: null,
|
|
@@ -356,11 +361,11 @@ function se(r, t) {
|
|
|
356
361
|
});
|
|
357
362
|
}
|
|
358
363
|
}
|
|
359
|
-
function ne(
|
|
360
|
-
const i = t.projectionMatrix,
|
|
361
|
-
|
|
362
|
-
for (let m = 0, h =
|
|
363
|
-
if (b.fromBufferAttribute(
|
|
364
|
+
function ne(a, t, e) {
|
|
365
|
+
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;
|
|
366
|
+
D.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), K.multiplyMatrices(t.matrixWorldInverse, l);
|
|
367
|
+
for (let m = 0, h = p; m < h; m++) {
|
|
368
|
+
if (b.fromBufferAttribute(o, m), y.fromBufferAttribute(c, m), b.w = 1, y.w = 1, b.applyMatrix4(K), y.applyMatrix4(K), b.z > u && y.z > u)
|
|
364
369
|
continue;
|
|
365
370
|
if (b.z > u) {
|
|
366
371
|
const I = b.z - y.z, P = (b.z - u) / I;
|
|
@@ -369,18 +374,18 @@ function ne(r, t, e) {
|
|
|
369
374
|
const I = y.z - b.z, P = (y.z - u) / I;
|
|
370
375
|
y.lerp(b, P);
|
|
371
376
|
}
|
|
372
|
-
b.applyMatrix4(i), y.applyMatrix4(i), b.multiplyScalar(1 / b.w), y.multiplyScalar(1 / y.w), b.x *=
|
|
373
|
-
const
|
|
374
|
-
|
|
375
|
-
const g =
|
|
377
|
+
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, M.start.copy(b), M.start.z = 0, M.end.copy(y), M.end.z = 0;
|
|
378
|
+
const d = M.closestPointToPointParameter(q, !0);
|
|
379
|
+
M.at(d, mt);
|
|
380
|
+
const g = Vt.lerp(b.z, y.z, d), w = g >= -1 && g <= 1, z = q.distanceTo(mt) < _ * 0.5;
|
|
376
381
|
if (w && z) {
|
|
377
|
-
|
|
382
|
+
M.start.fromBufferAttribute(o, m), M.end.fromBufferAttribute(c, m), M.start.applyMatrix4(l), M.end.applyMatrix4(l);
|
|
378
383
|
const I = new C(), P = new C();
|
|
379
|
-
|
|
384
|
+
D.distanceSqToSegment(M.start, M.end, P, I), e.push({
|
|
380
385
|
point: P,
|
|
381
386
|
pointOnLine: I,
|
|
382
|
-
distance:
|
|
383
|
-
object:
|
|
387
|
+
distance: D.origin.distanceTo(P),
|
|
388
|
+
object: a,
|
|
384
389
|
face: null,
|
|
385
390
|
faceIndex: m,
|
|
386
391
|
uv: null,
|
|
@@ -389,26 +394,26 @@ function ne(r, t, e) {
|
|
|
389
394
|
}
|
|
390
395
|
}
|
|
391
396
|
}
|
|
392
|
-
class
|
|
397
|
+
class ze extends Mt {
|
|
393
398
|
constructor(t = new Kt(), e) {
|
|
394
399
|
super(t, e), this.isLineSegments2 = !0, this.type = "LineSegments2";
|
|
395
400
|
}
|
|
396
401
|
// for backwards-compatibility, but could be a method of LineSegmentsGeometry...
|
|
397
402
|
computeLineDistances() {
|
|
398
403
|
const t = this.geometry, e = t.attributes.instanceStart, i = t.attributes.instanceEnd, s = new Float32Array(2 * e.count);
|
|
399
|
-
for (let
|
|
400
|
-
|
|
401
|
-
const
|
|
404
|
+
for (let l = 0, n = 0, o = e.count; l < o; l++, n += 2)
|
|
405
|
+
dt.fromBufferAttribute(e, l), pt.fromBufferAttribute(i, l), s[n] = n === 0 ? 0 : s[n - 1], s[n + 1] = s[n] + dt.distanceTo(pt);
|
|
406
|
+
const r = new Ot(
|
|
402
407
|
s,
|
|
403
408
|
2,
|
|
404
409
|
1
|
|
405
410
|
);
|
|
406
411
|
return t.setAttribute(
|
|
407
412
|
"instanceDistanceStart",
|
|
408
|
-
new
|
|
413
|
+
new ot(r, 1, 0)
|
|
409
414
|
), t.setAttribute(
|
|
410
415
|
"instanceDistanceEnd",
|
|
411
|
-
new
|
|
416
|
+
new ot(r, 1, 1)
|
|
412
417
|
), this;
|
|
413
418
|
}
|
|
414
419
|
raycast(t, e) {
|
|
@@ -416,49 +421,49 @@ class Ie extends Mt {
|
|
|
416
421
|
s === null && !i && console.error(
|
|
417
422
|
'LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.'
|
|
418
423
|
);
|
|
419
|
-
const
|
|
420
|
-
|
|
421
|
-
const
|
|
422
|
-
|
|
424
|
+
const r = t.params.Line2 !== void 0 && t.params.Line2.threshold || 0;
|
|
425
|
+
D = t.ray;
|
|
426
|
+
const l = this.matrixWorld, n = this.geometry, o = this.material;
|
|
427
|
+
_ = o.linewidth + r, n.boundingSphere === null && n.computeBoundingSphere(), E.copy(n.boundingSphere).applyMatrix4(l);
|
|
423
428
|
let c;
|
|
424
429
|
if (i)
|
|
425
|
-
c =
|
|
430
|
+
c = _ * 0.5;
|
|
426
431
|
else {
|
|
427
432
|
const u = Math.max(
|
|
428
433
|
s.near,
|
|
429
|
-
E.distanceToPoint(
|
|
434
|
+
E.distanceToPoint(D.origin)
|
|
430
435
|
);
|
|
431
|
-
c =
|
|
436
|
+
c = vt(
|
|
432
437
|
s,
|
|
433
438
|
u,
|
|
434
|
-
|
|
439
|
+
o.resolution
|
|
435
440
|
);
|
|
436
441
|
}
|
|
437
|
-
if (E.radius += c,
|
|
442
|
+
if (E.radius += c, D.intersectsSphere(E) === !1)
|
|
438
443
|
return;
|
|
439
|
-
n.boundingBox === null && n.computeBoundingBox(), U.copy(n.boundingBox).applyMatrix4(
|
|
440
|
-
let
|
|
444
|
+
n.boundingBox === null && n.computeBoundingBox(), U.copy(n.boundingBox).applyMatrix4(l);
|
|
445
|
+
let p;
|
|
441
446
|
if (i)
|
|
442
|
-
|
|
447
|
+
p = _ * 0.5;
|
|
443
448
|
else {
|
|
444
449
|
const u = Math.max(
|
|
445
450
|
s.near,
|
|
446
|
-
U.distanceToPoint(
|
|
451
|
+
U.distanceToPoint(D.origin)
|
|
447
452
|
);
|
|
448
|
-
|
|
453
|
+
p = vt(
|
|
449
454
|
s,
|
|
450
455
|
u,
|
|
451
|
-
|
|
456
|
+
o.resolution
|
|
452
457
|
);
|
|
453
458
|
}
|
|
454
|
-
U.expandByScalar(
|
|
459
|
+
U.expandByScalar(p), D.intersectsBox(U) !== !1 && (i ? se(this, e) : ne(this, s, e));
|
|
455
460
|
}
|
|
456
461
|
onBeforeRender(t) {
|
|
457
462
|
const e = this.material.uniforms;
|
|
458
|
-
e && e.resolution && (t.getViewport(
|
|
463
|
+
e && e.resolution && (t.getViewport($), this.material.uniforms.resolution.value.set($.z, $.w));
|
|
459
464
|
}
|
|
460
465
|
}
|
|
461
|
-
const
|
|
466
|
+
const gt = ["encodings_fragment", "colorspace_fragment"], re = (
|
|
462
467
|
/* glsl */
|
|
463
468
|
`
|
|
464
469
|
#include <common>
|
|
@@ -606,20 +611,20 @@ const bt = ["encodings_fragment", "colorspace_fragment"], re = (
|
|
|
606
611
|
|
|
607
612
|
#include <fog_fragment>
|
|
608
613
|
#include <tonemapping_fragment>
|
|
609
|
-
#include <${+
|
|
614
|
+
#include <${+Et < 154 ? gt[0] : gt[1]}>
|
|
610
615
|
}
|
|
611
616
|
`
|
|
612
617
|
);
|
|
613
|
-
class
|
|
618
|
+
class Ie extends kt {
|
|
614
619
|
constructor(t) {
|
|
615
620
|
super({
|
|
616
|
-
uniforms:
|
|
621
|
+
uniforms: Z(W({}, Ut.fog), {
|
|
617
622
|
lineWidth: { value: 1 },
|
|
618
623
|
map: { value: null },
|
|
619
624
|
useMap: { value: 0 },
|
|
620
625
|
alphaMap: { value: null },
|
|
621
626
|
useAlphaMap: { value: 0 },
|
|
622
|
-
color: { value: new
|
|
627
|
+
color: { value: new lt(16777215) },
|
|
623
628
|
opacity: { value: 1 },
|
|
624
629
|
resolution: { value: new k(1, 1) },
|
|
625
630
|
sizeAttenuation: { value: 1 },
|
|
@@ -639,7 +644,7 @@ class Te extends Ut {
|
|
|
639
644
|
speed: { value: 0.3 },
|
|
640
645
|
lightWidth: { value: 0.1 },
|
|
641
646
|
uCenter: { value: new k(0, 0) },
|
|
642
|
-
lightColor: { value: new
|
|
647
|
+
lightColor: { value: new lt(16777215) }
|
|
643
648
|
}),
|
|
644
649
|
vertexShader: re,
|
|
645
650
|
fragmentShader: ae
|
|
@@ -866,90 +871,90 @@ class Te extends Ut {
|
|
|
866
871
|
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
872
|
}
|
|
868
873
|
}
|
|
869
|
-
function oe(
|
|
870
|
-
return
|
|
874
|
+
function oe(a, t) {
|
|
875
|
+
return a.map((e) => {
|
|
871
876
|
const i = [];
|
|
872
877
|
let s;
|
|
873
|
-
return e.forEach((
|
|
878
|
+
return e.forEach((r) => {
|
|
874
879
|
if (s) {
|
|
875
|
-
const
|
|
876
|
-
if (
|
|
877
|
-
const n =
|
|
878
|
-
let c =
|
|
880
|
+
const l = Zt(r, s) * 180 / Math.PI;
|
|
881
|
+
if (l > t) {
|
|
882
|
+
const n = $t(s, r), o = 1 / Math.ceil(l / t);
|
|
883
|
+
let c = o;
|
|
879
884
|
for (; c < 1; )
|
|
880
|
-
i.push(n(c)), c +=
|
|
885
|
+
i.push(n(c)), c += o;
|
|
881
886
|
}
|
|
882
887
|
}
|
|
883
|
-
i.push(s =
|
|
888
|
+
i.push(s = r);
|
|
884
889
|
}), i;
|
|
885
890
|
});
|
|
886
891
|
}
|
|
887
|
-
function le(
|
|
888
|
-
const
|
|
892
|
+
function le(a, { minLng: t, maxLng: e, minLat: i, maxLat: s } = {}) {
|
|
893
|
+
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
894
|
s !== void 0 ? Math.ceil(c(s)) : 0,
|
|
890
|
-
i !== void 0 ? Math.floor(c(i)) :
|
|
895
|
+
i !== void 0 ? Math.floor(c(i)) : r - 1
|
|
891
896
|
], 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 =
|
|
897
|
+
for (let h = p[0]; h <= p[1]; h++) {
|
|
893
898
|
const f = n(h);
|
|
894
|
-
u(f) && m.push([f,
|
|
899
|
+
u(f) && m.push([f, o(h)]);
|
|
895
900
|
}
|
|
896
901
|
return m;
|
|
897
902
|
}
|
|
898
|
-
function
|
|
899
|
-
return e ?
|
|
903
|
+
function X(a, t, e = !1) {
|
|
904
|
+
return e ? Nt(t, a) : Jt(a, t);
|
|
900
905
|
}
|
|
901
|
-
function ce(
|
|
902
|
-
const e = { type: "Polygon", coordinates:
|
|
903
|
-
if (Math.min(Math.abs(
|
|
906
|
+
function ce(a, t) {
|
|
907
|
+
const e = { type: "Polygon", coordinates: a }, [[i, s], [r, l]] = wt(e);
|
|
908
|
+
if (Math.min(Math.abs(r - i), Math.abs(l - s)) < t)
|
|
904
909
|
return [];
|
|
905
|
-
const n = i >
|
|
910
|
+
const n = i > r || l >= 89 || s <= -89;
|
|
906
911
|
return le(t, {
|
|
907
912
|
minLng: i,
|
|
908
|
-
maxLng:
|
|
913
|
+
maxLng: r,
|
|
909
914
|
minLat: s,
|
|
910
|
-
maxLat:
|
|
915
|
+
maxLat: l
|
|
911
916
|
}).filter(
|
|
912
|
-
(
|
|
917
|
+
(o) => X(o, e, n)
|
|
913
918
|
);
|
|
914
919
|
}
|
|
915
|
-
function ue(
|
|
916
|
-
const s = oe(
|
|
920
|
+
function ue(a, { resolution: t = 1 / 0, bbox: e, projection: i } = {}) {
|
|
921
|
+
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
922
|
m >= 89 || // crosses north pole
|
|
918
|
-
|
|
923
|
+
p <= -89;
|
|
919
924
|
let f = [];
|
|
920
925
|
if (h) {
|
|
921
|
-
const v =
|
|
922
|
-
n.map(([j, A],
|
|
926
|
+
const v = te(n).triangles(), x = new Map(
|
|
927
|
+
n.map(([j, A], T) => [`${j}-${A}`, T])
|
|
923
928
|
);
|
|
924
929
|
v.features.forEach((j) => {
|
|
925
|
-
const A = j.geometry.coordinates[0].slice(0, 3).reverse(),
|
|
926
|
-
if (A.forEach(([S,
|
|
927
|
-
const V = `${S}-${
|
|
928
|
-
|
|
929
|
-
}),
|
|
930
|
-
if (
|
|
930
|
+
const A = j.geometry.coordinates[0].slice(0, 3).reverse(), T = [];
|
|
931
|
+
if (A.forEach(([S, N]) => {
|
|
932
|
+
const V = `${S}-${N}`;
|
|
933
|
+
x.has(V) && T.push(x.get(V));
|
|
934
|
+
}), T.length === 3) {
|
|
935
|
+
if (T.some((S) => S < r.length)) {
|
|
931
936
|
const S = j.properties.circumcenter;
|
|
932
|
-
if (!
|
|
937
|
+
if (!X(
|
|
933
938
|
S,
|
|
934
|
-
|
|
939
|
+
o,
|
|
935
940
|
h
|
|
936
941
|
))
|
|
937
942
|
return;
|
|
938
943
|
}
|
|
939
|
-
f.push(...
|
|
944
|
+
f.push(...T);
|
|
940
945
|
}
|
|
941
946
|
});
|
|
942
|
-
} else if (
|
|
943
|
-
const v =
|
|
944
|
-
for (let
|
|
945
|
-
const A = [2, 1, 0].map((S) => v.triangles[
|
|
946
|
-
if (A.some((S) => S <
|
|
947
|
+
} else if (l.length) {
|
|
948
|
+
const v = Ht.from(n);
|
|
949
|
+
for (let x = 0, j = v.triangles.length; x < j; x += 3) {
|
|
950
|
+
const A = [2, 1, 0].map((S) => v.triangles[x + S]), T = A.map((S) => n[S]);
|
|
951
|
+
if (A.some((S) => S < r.length)) {
|
|
947
952
|
const S = [0, 1].map(
|
|
948
|
-
(
|
|
953
|
+
(N) => Qt(T, (V) => V[N])
|
|
949
954
|
);
|
|
950
|
-
if (!
|
|
955
|
+
if (!X(
|
|
951
956
|
S,
|
|
952
|
-
|
|
957
|
+
o,
|
|
953
958
|
h
|
|
954
959
|
))
|
|
955
960
|
continue;
|
|
@@ -957,127 +962,127 @@ function ue(r, { resolution: t = 1 / 0, bbox: e, projection: i } = {}) {
|
|
|
957
962
|
f.push(...A);
|
|
958
963
|
}
|
|
959
964
|
} else {
|
|
960
|
-
const { vertices: v, holes:
|
|
961
|
-
f =
|
|
965
|
+
const { vertices: v, holes: x = [] } = Pt(s);
|
|
966
|
+
f = Xt(v, x, 2);
|
|
962
967
|
}
|
|
963
|
-
let
|
|
968
|
+
let d = e ? [e[0], e[2]] : ut(n, (v) => v[0]), g = e ? [e[1], e[3]] : ut(n, (v) => v[1]);
|
|
964
969
|
if (i) {
|
|
965
|
-
const [v,
|
|
966
|
-
|
|
970
|
+
const [v, x] = i([d[0], g[0]]), [j, A] = i([d[1], g[1]]);
|
|
971
|
+
d = [v, j], g = [-x, -A];
|
|
967
972
|
}
|
|
968
|
-
const w =
|
|
973
|
+
const w = ht(d, [0, 1]), z = ht(g, [0, 1]), I = n.map(([v, x]) => {
|
|
969
974
|
if (i) {
|
|
970
|
-
const [j, A] = i([v,
|
|
975
|
+
const [j, A] = i([v, x]);
|
|
971
976
|
return [w(j), z(-A)];
|
|
972
977
|
} else
|
|
973
|
-
return [w(v), z(
|
|
978
|
+
return [w(v), z(x)];
|
|
974
979
|
});
|
|
975
980
|
return { contour: s, triangles: { points: n, indices: f, uvs: I } };
|
|
976
981
|
}
|
|
977
|
-
const
|
|
978
|
-
function F(
|
|
979
|
-
const s =
|
|
980
|
-
(
|
|
982
|
+
const bt = new Y().setAttribute ? "setAttribute" : "addAttribute";
|
|
983
|
+
function F(a, t, e, i) {
|
|
984
|
+
const s = a.map(
|
|
985
|
+
(r) => r.map(([l, n]) => {
|
|
981
986
|
if (i) {
|
|
982
|
-
const [
|
|
983
|
-
return [
|
|
987
|
+
const [o, c] = i([l, n]);
|
|
988
|
+
return [o, -c, t];
|
|
984
989
|
}
|
|
985
|
-
return e ?
|
|
990
|
+
return e ? qt(l, n, t) : [l, n, t];
|
|
986
991
|
})
|
|
987
992
|
);
|
|
988
|
-
return
|
|
993
|
+
return Pt(s);
|
|
989
994
|
}
|
|
990
|
-
function he(
|
|
991
|
-
const { vertices:
|
|
992
|
-
|
|
995
|
+
function he(a, t, e, i, s) {
|
|
996
|
+
const { vertices: r, holes: l } = F(
|
|
997
|
+
a,
|
|
993
998
|
t,
|
|
994
999
|
i,
|
|
995
1000
|
s
|
|
996
1001
|
), { vertices: n } = F(
|
|
997
|
-
|
|
1002
|
+
a,
|
|
998
1003
|
e,
|
|
999
1004
|
i,
|
|
1000
1005
|
s
|
|
1001
|
-
),
|
|
1006
|
+
), o = H([n, r]), c = Math.round(n.length / 3), p = new Set(l);
|
|
1002
1007
|
let u = 0;
|
|
1003
1008
|
const m = [];
|
|
1004
1009
|
for (let f = 0; f < c; f++) {
|
|
1005
|
-
let
|
|
1006
|
-
if (
|
|
1007
|
-
|
|
1008
|
-
else if (
|
|
1009
|
-
const g =
|
|
1010
|
-
|
|
1010
|
+
let d = f + 1;
|
|
1011
|
+
if (d === c)
|
|
1012
|
+
d = u;
|
|
1013
|
+
else if (p.has(d)) {
|
|
1014
|
+
const g = d;
|
|
1015
|
+
d = u, u = g;
|
|
1011
1016
|
}
|
|
1012
|
-
m.push(f, f + c,
|
|
1017
|
+
m.push(f, f + c, d + c), m.push(d + c, d, f);
|
|
1013
1018
|
}
|
|
1014
1019
|
const h = [];
|
|
1015
1020
|
for (let f = 1; f >= 0; f--)
|
|
1016
|
-
for (let
|
|
1017
|
-
return { indices: m, vertices:
|
|
1021
|
+
for (let d = 0; d < c; d += 1) h.push(d / (c - 1), f);
|
|
1022
|
+
return { indices: m, vertices: o, uvs: h, topVerts: n };
|
|
1018
1023
|
}
|
|
1019
|
-
function
|
|
1024
|
+
function yt(a, t, e, i, s, r) {
|
|
1020
1025
|
return {
|
|
1021
|
-
indices: i ?
|
|
1026
|
+
indices: i ? a.indices : a.indices.slice().reverse(),
|
|
1022
1027
|
vertices: F(
|
|
1023
|
-
[
|
|
1028
|
+
[a.points],
|
|
1024
1029
|
t,
|
|
1025
1030
|
s,
|
|
1026
|
-
|
|
1031
|
+
r
|
|
1027
1032
|
).vertices,
|
|
1028
1033
|
uvs: e
|
|
1029
1034
|
};
|
|
1030
1035
|
}
|
|
1031
1036
|
const fe = ({
|
|
1032
|
-
polygonGeoJson:
|
|
1037
|
+
polygonGeoJson: a,
|
|
1033
1038
|
startHeight: t,
|
|
1034
1039
|
endHeight: e,
|
|
1035
1040
|
curvatureResolution: i = 1,
|
|
1036
1041
|
cartesian: s = !0,
|
|
1037
|
-
hasSide:
|
|
1038
|
-
hasBottom:
|
|
1042
|
+
hasSide: r = !0,
|
|
1043
|
+
hasBottom: l = !1,
|
|
1039
1044
|
hasTop: n = !1,
|
|
1040
|
-
projection:
|
|
1045
|
+
projection: o,
|
|
1041
1046
|
bbox: c
|
|
1042
1047
|
}) => {
|
|
1043
|
-
|
|
1044
|
-
|
|
1048
|
+
a.forEach((w) => {
|
|
1049
|
+
Yt(w) || w.reverse();
|
|
1045
1050
|
});
|
|
1046
|
-
const { contour:
|
|
1051
|
+
const { contour: p, triangles: u } = ue(a, {
|
|
1047
1052
|
resolution: i,
|
|
1048
1053
|
bbox: c,
|
|
1049
|
-
projection:
|
|
1054
|
+
projection: o
|
|
1050
1055
|
});
|
|
1051
1056
|
let m = {}, h;
|
|
1052
|
-
|
|
1053
|
-
|
|
1057
|
+
r && (m = he(
|
|
1058
|
+
p,
|
|
1054
1059
|
t != null ? t : e,
|
|
1055
1060
|
e != null ? e : t,
|
|
1056
1061
|
s,
|
|
1057
|
-
|
|
1062
|
+
o
|
|
1058
1063
|
), h = m.topVerts);
|
|
1059
1064
|
let f = [];
|
|
1060
|
-
(
|
|
1061
|
-
let
|
|
1062
|
-
|
|
1065
|
+
(l || n) && (f = H(u.uvs));
|
|
1066
|
+
let d = {};
|
|
1067
|
+
l && (d = yt(
|
|
1063
1068
|
u,
|
|
1064
1069
|
t,
|
|
1065
1070
|
f,
|
|
1066
1071
|
!1,
|
|
1067
1072
|
s,
|
|
1068
|
-
|
|
1073
|
+
o
|
|
1069
1074
|
));
|
|
1070
1075
|
let g = {};
|
|
1071
|
-
return n && (g =
|
|
1076
|
+
return n && (g = yt(
|
|
1072
1077
|
u,
|
|
1073
1078
|
e,
|
|
1074
1079
|
f,
|
|
1075
1080
|
!0,
|
|
1076
1081
|
s,
|
|
1077
|
-
|
|
1078
|
-
)), { contour:
|
|
1082
|
+
o
|
|
1083
|
+
)), { contour: p, triangles: u, sideTorso: m, bottomCap: d, topCap: g, topVerts: h };
|
|
1079
1084
|
};
|
|
1080
|
-
class
|
|
1085
|
+
class Be extends Y {
|
|
1081
1086
|
constructor(t, e = {}) {
|
|
1082
1087
|
super(), this.type = "PolygonBufferGeometry", this.parameters = W({
|
|
1083
1088
|
polygonGeoJson: t,
|
|
@@ -1094,34 +1099,33 @@ class De extends H {
|
|
|
1094
1099
|
const {
|
|
1095
1100
|
endHeight: i,
|
|
1096
1101
|
hasTop: s,
|
|
1097
|
-
topFirst:
|
|
1098
|
-
hasBottom:
|
|
1102
|
+
topFirst: r,
|
|
1103
|
+
hasBottom: l,
|
|
1099
1104
|
hasSide: n,
|
|
1100
|
-
cartesian:
|
|
1105
|
+
cartesian: o,
|
|
1101
1106
|
userDataRsoOffset: c,
|
|
1102
|
-
projection:
|
|
1103
|
-
} = this.parameters, { contour: u, sideTorso: m, topVerts: h, bottomCap: f, topCap:
|
|
1107
|
+
projection: p
|
|
1108
|
+
} = this.parameters, { contour: u, sideTorso: m, topVerts: h, bottomCap: f, topCap: d } = fe(W({}, this.parameters));
|
|
1104
1109
|
let g = [], w = [], z = [], I = 0;
|
|
1105
1110
|
const P = (v) => {
|
|
1106
|
-
const
|
|
1111
|
+
const x = Math.round(g.length / 3), j = z.length;
|
|
1107
1112
|
g = g.concat(v.vertices), w = w.concat(v.uvs), z = z.concat(
|
|
1108
|
-
|
|
1113
|
+
x ? v.indices.map((A) => A + x) : v.indices
|
|
1109
1114
|
), this.addGroup(j, z.length - j, I++);
|
|
1110
1115
|
};
|
|
1111
|
-
s &&
|
|
1116
|
+
s && r && P(d), n && (P(m), this.userData.topVerts = c ? F(
|
|
1112
1117
|
u,
|
|
1113
1118
|
i + c,
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
).vertices : h),
|
|
1119
|
+
o,
|
|
1120
|
+
p
|
|
1121
|
+
).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
1122
|
}
|
|
1118
1123
|
}
|
|
1119
1124
|
export {
|
|
1120
|
-
|
|
1121
|
-
ze as
|
|
1122
|
-
Ie as
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
dt as R,
|
|
1125
|
+
ft as B,
|
|
1126
|
+
ze as L,
|
|
1127
|
+
Ie as M,
|
|
1128
|
+
Be as P,
|
|
1129
|
+
ie as R,
|
|
1126
1130
|
fe as g
|
|
1127
1131
|
};
|