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