gl-draw 0.13.2 → 0.13.4
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 -2
- package/dist/core/Camera.d.ts +5 -12
- package/dist/core/Composer.d.ts +0 -3
- package/dist/core/Controls.d.ts +5 -9
- package/dist/{plugins/Draw.d.ts → core/Lead/Lead.d.ts} +11 -11
- package/dist/core/Lead/index.d.ts +18 -0
- package/dist/core/Loader/Loader.d.ts +0 -1
- package/dist/core/Loader/index.d.ts +4 -9
- package/dist/core/Pages/Pages.d.ts +12 -0
- package/dist/core/Pages/index.d.ts +12 -0
- package/dist/core/Pencil.d.ts +9 -9
- package/dist/core/Scene.d.ts +4 -10
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/index.module.js +1076 -856
- package/dist/index.module2.js +516 -266
- package/dist/index2.js +7 -4
- package/dist/objects/index.js +1 -1
- package/dist/objects/index.module.js +38 -40
- package/dist/objects/node/index.d.ts +1 -1
- package/dist/parseVector.js +1 -1
- package/dist/parseVector.module.js +23 -11
- package/dist/plugins/index.d.ts +0 -1
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/index.module.js +89 -406
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.module.js +15 -16
- package/package.json +1 -2
- package/dist/BaseObject.js +0 -4
- package/dist/BaseObject.module.js +0 -253
- package/dist/core/GUIObject.d.ts +0 -24
- package/dist/index.module3.js +0 -9
- package/dist/index3.js +0 -1
- package/dist/polar2Cartesian.js +0 -1
- package/dist/polar2Cartesian.module.js +0 -14
package/dist/index.module2.js
CHANGED
|
@@ -1,152 +1,400 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var ft = Object.defineProperty, pt = Object.defineProperties;
|
|
2
|
+
var dt = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var K = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var mt = Object.prototype.hasOwnProperty, vt = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var Y = Math.pow, X = (o, t, e) => t in o ? ft(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e, E = (o, t) => {
|
|
6
6
|
for (var e in t || (t = {}))
|
|
7
|
-
|
|
7
|
+
mt.call(t, e) && X(o, e, t[e]);
|
|
8
8
|
if (K)
|
|
9
9
|
for (var e of K(t))
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
import * as
|
|
14
|
-
import { Vector4 as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import {
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
10
|
+
vt.call(t, e) && X(o, e, t[e]);
|
|
11
|
+
return o;
|
|
12
|
+
}, H = (o, t) => pt(o, dt(t));
|
|
13
|
+
import * as h from "three";
|
|
14
|
+
import { Vector4 as V, Vector3 as W, Matrix4 as gt, Line3 as bt, Box3 as yt, Sphere as xt, Mesh as Mt, InstancedInterleavedBuffer as wt, InterleavedBufferAttribute as J, MathUtils as Pt } from "three";
|
|
15
|
+
import { makePromiseCreator as At } from "esus-lite";
|
|
16
|
+
import { CSS2DObject as Ct } from "three/examples/jsm/renderers/CSS2DRenderer";
|
|
17
|
+
import { CSS3DObject as St, CSS3DSprite as jt } from "three/examples/jsm/renderers/CSS3DRenderer";
|
|
18
|
+
import { p as tt, d as U, a as zt } from "./parseVector.module.js";
|
|
19
|
+
import { geoBounds as ct, geoContains as It, geoDistance as Dt, geoInterpolate as _t } from "d3-geo";
|
|
20
|
+
import "d3-geo-projection";
|
|
21
|
+
import { LineSegmentsGeometry as Bt } from "three/examples/jsm/lines/LineSegmentsGeometry";
|
|
22
|
+
import { merge as Q, mean as Lt, extent as et } from "d3-array";
|
|
23
|
+
import Wt, { flatten as ht } from "earcut";
|
|
24
|
+
import Tt from "@turf/boolean-clockwise";
|
|
25
|
+
import Vt from "delaunator";
|
|
26
|
+
import Ot from "@turf/boolean-point-in-polygon";
|
|
27
|
+
import { geoVoronoi as Et } from "d3-geo-voronoi";
|
|
28
|
+
import { scaleLinear as it } from "d3-scale";
|
|
29
|
+
const Ut = (o, t = 1) => {
|
|
30
|
+
const e = new h.BufferGeometry();
|
|
31
|
+
e.setAttribute(
|
|
32
|
+
"position",
|
|
33
|
+
new h.Float32BufferAttribute(new Array(t * 3).fill(0), 3)
|
|
34
|
+
), e.setAttribute(
|
|
35
|
+
"scaleAtt",
|
|
36
|
+
new h.Float32BufferAttribute(new Array(t).fill(1), 1)
|
|
37
|
+
);
|
|
38
|
+
const i = o.material, r = new h.PointsMaterial({
|
|
39
|
+
size: 10,
|
|
40
|
+
map: i.map,
|
|
41
|
+
alphaMap: i.alphaMap,
|
|
42
|
+
color: i.color,
|
|
43
|
+
blending: i.blending,
|
|
44
|
+
depthTest: i.depthTest,
|
|
45
|
+
depthWrite: !1,
|
|
46
|
+
opacity: i.opacity,
|
|
47
|
+
transparent: !0,
|
|
48
|
+
alphaTest: i.alphaTest,
|
|
49
|
+
sizeAttenuation: !1
|
|
50
|
+
});
|
|
51
|
+
return r.onBeforeCompile = (n) => {
|
|
52
|
+
n.vertexShader = `
|
|
53
|
+
attribute float scaleAtt;
|
|
54
|
+
${n.vertexShader.replace(
|
|
55
|
+
"gl_PointSize = size;",
|
|
56
|
+
"gl_PointSize = size * scaleAtt;"
|
|
57
|
+
)}
|
|
58
|
+
`;
|
|
59
|
+
}, new h.Points(e, r);
|
|
60
|
+
};
|
|
61
|
+
class Gt {
|
|
62
|
+
constructor() {
|
|
63
|
+
this.objectType = "BaseObject", this.userData = {}, this.prefab = !1, this.isInstantiate = !1, this.pm = At(), this.materialList = {}, this.useMaterialType = "origin", this.onPointerIndex = [];
|
|
64
|
+
}
|
|
65
|
+
get parent() {
|
|
66
|
+
const t = this.object3d.parent;
|
|
67
|
+
return t ? this.drawController.objMap.get(t) || this.pencil.scene : null;
|
|
68
|
+
}
|
|
69
|
+
get children() {
|
|
70
|
+
return this.object3d.children.map((t) => this.drawController.objMap.get(t)).filter((t) => !!t);
|
|
71
|
+
}
|
|
72
|
+
get position() {
|
|
73
|
+
return this.object3d.position;
|
|
74
|
+
}
|
|
75
|
+
get rotation() {
|
|
76
|
+
return this.object3d.rotation;
|
|
77
|
+
}
|
|
78
|
+
get scale() {
|
|
79
|
+
return this.object3d.scale;
|
|
80
|
+
}
|
|
81
|
+
get add() {
|
|
82
|
+
return this.object3d.add.bind(this.object3d);
|
|
83
|
+
}
|
|
84
|
+
get remove() {
|
|
85
|
+
return this.object3d.remove.bind(this.object3d);
|
|
86
|
+
}
|
|
87
|
+
get visible() {
|
|
88
|
+
return this.object3d.visible;
|
|
89
|
+
}
|
|
90
|
+
get visibleWithAncestors() {
|
|
91
|
+
if (this.visible) {
|
|
92
|
+
let t = this.parent;
|
|
93
|
+
for (; t; ) {
|
|
94
|
+
if (!t.visible)
|
|
95
|
+
return !1;
|
|
96
|
+
t = t.parent;
|
|
97
|
+
}
|
|
98
|
+
return !0;
|
|
99
|
+
} else
|
|
100
|
+
return !1;
|
|
101
|
+
}
|
|
102
|
+
create() {
|
|
103
|
+
this.createGroup();
|
|
104
|
+
}
|
|
105
|
+
render() {
|
|
106
|
+
}
|
|
107
|
+
update(t, e) {
|
|
108
|
+
}
|
|
109
|
+
resize(t, e) {
|
|
110
|
+
}
|
|
111
|
+
show() {
|
|
112
|
+
return this.object3d.visible = !0, this;
|
|
113
|
+
}
|
|
114
|
+
hide() {
|
|
115
|
+
return this.object3d.visible = !1, this;
|
|
116
|
+
}
|
|
117
|
+
createMesh(...t) {
|
|
118
|
+
return this.object3d = new h.Mesh(...t), this;
|
|
119
|
+
}
|
|
120
|
+
createGroup() {
|
|
121
|
+
return this.object3d = new h.Group(), this;
|
|
122
|
+
}
|
|
123
|
+
createPoints(...t) {
|
|
124
|
+
return this.object3d = new h.Points(...t), this;
|
|
125
|
+
}
|
|
126
|
+
createCSS2DObject(t) {
|
|
127
|
+
return this.object3d = new Ct(t), this;
|
|
128
|
+
}
|
|
129
|
+
createCSS3DObject(t) {
|
|
130
|
+
return this.object3d = new St(t), this;
|
|
131
|
+
}
|
|
132
|
+
createCSS3DSprite(t) {
|
|
133
|
+
return this.object3d = new jt(t), this;
|
|
134
|
+
}
|
|
135
|
+
createSprite(t) {
|
|
136
|
+
return this.object3d = new h.Sprite(t), this;
|
|
137
|
+
}
|
|
138
|
+
attach(...t) {
|
|
139
|
+
return [...t].forEach((e) => {
|
|
140
|
+
this.object3d.attach(e.object3d);
|
|
141
|
+
}), this;
|
|
142
|
+
}
|
|
143
|
+
getSize() {
|
|
144
|
+
const t = new h.Box3().setFromObject(this.object3d);
|
|
145
|
+
return {
|
|
146
|
+
min: t.min,
|
|
147
|
+
max: t.max,
|
|
148
|
+
size: t.getSize(new h.Vector3()),
|
|
149
|
+
center: t.getCenter(new h.Vector3())
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
traverse(t) {
|
|
153
|
+
t(this), this.children.forEach((e) => {
|
|
154
|
+
e.traverse(t);
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
clone() {
|
|
158
|
+
return this.instantiate();
|
|
159
|
+
}
|
|
160
|
+
instantiate(t) {
|
|
161
|
+
const e = t && t.length > 0;
|
|
162
|
+
return this.drawController.instantiate(this, {
|
|
163
|
+
create: (i) => {
|
|
164
|
+
var r;
|
|
165
|
+
if (this.object3d) {
|
|
166
|
+
if (e) {
|
|
167
|
+
const n = t.length;
|
|
168
|
+
if (this.object3d instanceof h.Sprite)
|
|
169
|
+
i.object3d = Ut(this.object3d, n);
|
|
170
|
+
else {
|
|
171
|
+
const s = this.object3d;
|
|
172
|
+
i.object3d = new h.InstancedMesh(
|
|
173
|
+
s.geometry,
|
|
174
|
+
s.material,
|
|
175
|
+
n
|
|
176
|
+
), i.setMaterialList("instantiate", "clone"), i.useMaterial("instantiate");
|
|
177
|
+
}
|
|
178
|
+
const a = new h.Object3D();
|
|
179
|
+
t.forEach((s, l) => {
|
|
180
|
+
const u = tt(s.position), f = tt(s.scale || [1, 1, 1]);
|
|
181
|
+
a.position.copy(u), a.scale.copy(f), a.updateMatrix(), i.setInstancedMatrix(l, a.matrix.clone());
|
|
182
|
+
});
|
|
183
|
+
} else
|
|
184
|
+
i.object3d = this.object3d.clone(!0), i.position.set(0, 0, 0), i.rotation.set(0, 0, 0), i.setMaterialList("instantiate", "clone"), i.useMaterial("instantiate");
|
|
185
|
+
i.object3d.userData.bloom && ((r = this.pencil.composerController) == null || r.toggleBloomSelection(
|
|
186
|
+
i.object3d,
|
|
187
|
+
!0
|
|
188
|
+
)), i.object3d.userData.prefab && (i.object3d.userData.prefab = !1);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
setInstancedMatrix(t, e) {
|
|
194
|
+
if (this.object3d instanceof h.InstancedMesh || this.object3d.isInstantiate)
|
|
195
|
+
this.object3d.setMatrixAt(t, e);
|
|
196
|
+
else if (this.object3d instanceof h.Points || this.object3d.type === "Points") {
|
|
197
|
+
const r = this.object3d.geometry, n = r.attributes.position.array, a = r.attributes.scaleAtt.array, s = new h.Vector3(), l = new h.Vector3(), u = new h.Quaternion(), f = t * 3, p = t * 1;
|
|
198
|
+
e.decompose(s, u, l), n[f] = s.x, n[f + 1] = s.y, n[f + 2] = s.z, a[p] = Math.max(l.x, l.y, l.z), r.attributes.position.needsUpdate = !0, r.attributes.scaleAtt.needsUpdate = !0;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
erase() {
|
|
202
|
+
this.drawController.erase(this);
|
|
203
|
+
}
|
|
204
|
+
cloneMaterial() {
|
|
205
|
+
const t = this.object3d;
|
|
206
|
+
if (!t || !t.material)
|
|
207
|
+
return;
|
|
208
|
+
const e = t.material;
|
|
209
|
+
if (Array.isArray(e))
|
|
210
|
+
return e.map((i) => {
|
|
211
|
+
const r = i.userData;
|
|
212
|
+
i.userData = {};
|
|
213
|
+
const n = i.clone();
|
|
214
|
+
return i.userData = r, n;
|
|
215
|
+
});
|
|
216
|
+
{
|
|
217
|
+
const i = e.userData;
|
|
218
|
+
e.userData = {};
|
|
219
|
+
const r = e.clone();
|
|
220
|
+
return e.userData = i, r;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
setMaterialList(t, e, i = !0) {
|
|
224
|
+
const r = this.object3d;
|
|
225
|
+
if (!r || !r.material)
|
|
226
|
+
return;
|
|
227
|
+
if (this.materialList.origin || (this.materialList.origin = r.material), this.materialList[t])
|
|
228
|
+
if (i) {
|
|
229
|
+
const a = this.materialList[t];
|
|
230
|
+
U({
|
|
231
|
+
material: a
|
|
232
|
+
});
|
|
233
|
+
} else
|
|
234
|
+
return this.materialList[t];
|
|
235
|
+
const n = e === "clone" ? this.cloneMaterial() : e;
|
|
236
|
+
return this.materialList[t] = n, n;
|
|
237
|
+
}
|
|
238
|
+
useMaterial(t) {
|
|
239
|
+
const e = this.object3d;
|
|
240
|
+
!e || !e.material || this.useMaterialType === t || !this.materialList[t] || (this.useMaterialType = t, e.material = this.materialList[t]);
|
|
241
|
+
}
|
|
242
|
+
setTop(t) {
|
|
243
|
+
this.object3d && (this.object3d.renderOrder = t);
|
|
244
|
+
}
|
|
245
|
+
onPointerEvent(t, e) {
|
|
246
|
+
const i = this.drawController.handlePick([this], t, e);
|
|
247
|
+
this.onPointerIndex.push(i);
|
|
248
|
+
}
|
|
249
|
+
dispose() {
|
|
250
|
+
this.onPointerIndex.forEach((t) => {
|
|
251
|
+
this.drawController.removePick(t);
|
|
252
|
+
}), this.object3d && U(this.object3d), Object.keys(this.materialList).forEach((t) => {
|
|
253
|
+
if (t !== this.useMaterialType) {
|
|
254
|
+
if (this.isInstantiate && t === "origin")
|
|
255
|
+
return;
|
|
256
|
+
U({
|
|
257
|
+
material: this.materialList[t]
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
disposeWithOutMaterial() {
|
|
263
|
+
this.onPointerIndex.forEach((t) => {
|
|
264
|
+
this.drawController.removePick(t);
|
|
265
|
+
}), this.object3d && U(this.object3d, !1);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
class pe extends Gt {
|
|
269
|
+
create() {
|
|
270
|
+
this.createGroup();
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
const Z = new V(), rt = new W(), st = new W(), y = new V(), x = new V(), D = new V(), $ = new W(), q = new gt(), M = new bt(), nt = new W(), G = new yt(), R = new xt(), _ = new V();
|
|
274
|
+
let B, T;
|
|
275
|
+
function ot(o, t, e) {
|
|
276
|
+
return _.set(0, 0, -t, 1).applyMatrix4(o.projectionMatrix), _.multiplyScalar(1 / _.w), _.x = T / e.width, _.y = T / e.height, _.applyMatrix4(o.projectionMatrixInverse), _.multiplyScalar(1 / _.w), Math.abs(Math.max(_.x, _.y));
|
|
29
277
|
}
|
|
30
|
-
function
|
|
31
|
-
const e =
|
|
32
|
-
for (let
|
|
33
|
-
M.start.fromBufferAttribute(r,
|
|
34
|
-
const u = new
|
|
35
|
-
|
|
36
|
-
point:
|
|
278
|
+
function Rt(o, t) {
|
|
279
|
+
const e = o.matrixWorld, i = o.geometry, r = i.attributes.instanceStart, n = i.attributes.instanceEnd, a = Math.min(i.instanceCount, r.count);
|
|
280
|
+
for (let s = 0, l = a; s < l; s++) {
|
|
281
|
+
M.start.fromBufferAttribute(r, s), M.end.fromBufferAttribute(n, s), M.applyMatrix4(e);
|
|
282
|
+
const u = new W(), f = new W();
|
|
283
|
+
B.distanceSqToSegment(M.start, M.end, f, u), f.distanceTo(u) < T * 0.5 && t.push({
|
|
284
|
+
point: f,
|
|
37
285
|
pointOnLine: u,
|
|
38
|
-
distance:
|
|
39
|
-
object:
|
|
286
|
+
distance: B.origin.distanceTo(f),
|
|
287
|
+
object: o,
|
|
40
288
|
face: null,
|
|
41
|
-
faceIndex:
|
|
289
|
+
faceIndex: s,
|
|
42
290
|
uv: null,
|
|
43
291
|
uv1: null
|
|
44
292
|
});
|
|
45
293
|
}
|
|
46
294
|
}
|
|
47
|
-
function
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
for (let
|
|
51
|
-
if (y.fromBufferAttribute(
|
|
295
|
+
function Ft(o, t, e) {
|
|
296
|
+
const i = t.projectionMatrix, n = o.material.resolution, a = o.matrixWorld, s = o.geometry, l = s.attributes.instanceStart, u = s.attributes.instanceEnd, f = Math.min(s.instanceCount, l.count), p = -t.near;
|
|
297
|
+
B.at(1, D), D.w = 1, D.applyMatrix4(t.matrixWorldInverse), D.applyMatrix4(i), D.multiplyScalar(1 / D.w), D.x *= n.x / 2, D.y *= n.y / 2, D.z = 0, $.copy(D), q.multiplyMatrices(t.matrixWorldInverse, a);
|
|
298
|
+
for (let v = 0, c = f; v < c; v++) {
|
|
299
|
+
if (y.fromBufferAttribute(l, v), x.fromBufferAttribute(u, v), y.w = 1, x.w = 1, y.applyMatrix4(q), x.applyMatrix4(q), y.z > p && x.z > p)
|
|
52
300
|
continue;
|
|
53
|
-
if (y.z >
|
|
54
|
-
const
|
|
55
|
-
y.lerp(x,
|
|
56
|
-
} else if (x.z >
|
|
57
|
-
const
|
|
58
|
-
x.lerp(y,
|
|
301
|
+
if (y.z > p) {
|
|
302
|
+
const I = y.z - x.z, P = (y.z - p) / I;
|
|
303
|
+
y.lerp(x, P);
|
|
304
|
+
} else if (x.z > p) {
|
|
305
|
+
const I = x.z - y.z, P = (x.z - p) / I;
|
|
306
|
+
x.lerp(y, P);
|
|
59
307
|
}
|
|
60
|
-
y.applyMatrix4(
|
|
61
|
-
const
|
|
62
|
-
M.at(
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
65
|
-
M.start.fromBufferAttribute(
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
point:
|
|
69
|
-
pointOnLine:
|
|
70
|
-
distance:
|
|
71
|
-
object:
|
|
308
|
+
y.applyMatrix4(i), x.applyMatrix4(i), y.multiplyScalar(1 / y.w), x.multiplyScalar(1 / x.w), y.x *= n.x / 2, y.y *= n.y / 2, x.x *= n.x / 2, x.y *= n.y / 2, M.start.copy(y), M.start.z = 0, M.end.copy(x), M.end.z = 0;
|
|
309
|
+
const d = M.closestPointToPointParameter($, !0);
|
|
310
|
+
M.at(d, nt);
|
|
311
|
+
const b = Pt.lerp(y.z, x.z, d), j = b >= -1 && b <= 1, z = $.distanceTo(nt) < T * 0.5;
|
|
312
|
+
if (j && z) {
|
|
313
|
+
M.start.fromBufferAttribute(l, v), M.end.fromBufferAttribute(u, v), M.start.applyMatrix4(a), M.end.applyMatrix4(a);
|
|
314
|
+
const I = new W(), P = new W();
|
|
315
|
+
B.distanceSqToSegment(M.start, M.end, P, I), e.push({
|
|
316
|
+
point: P,
|
|
317
|
+
pointOnLine: I,
|
|
318
|
+
distance: B.origin.distanceTo(P),
|
|
319
|
+
object: o,
|
|
72
320
|
face: null,
|
|
73
|
-
faceIndex:
|
|
321
|
+
faceIndex: v,
|
|
74
322
|
uv: null,
|
|
75
323
|
uv1: null
|
|
76
324
|
});
|
|
77
325
|
}
|
|
78
326
|
}
|
|
79
327
|
}
|
|
80
|
-
class
|
|
81
|
-
constructor(t = new
|
|
328
|
+
class de extends Mt {
|
|
329
|
+
constructor(t = new Bt(), e) {
|
|
82
330
|
super(t, e), this.isLineSegments2 = !0, this.type = "LineSegments2";
|
|
83
331
|
}
|
|
84
332
|
// for backwards-compatibility, but could be a method of LineSegmentsGeometry...
|
|
85
333
|
computeLineDistances() {
|
|
86
|
-
const t = this.geometry, e = t.attributes.instanceStart,
|
|
87
|
-
for (let a = 0,
|
|
88
|
-
|
|
89
|
-
const
|
|
334
|
+
const t = this.geometry, e = t.attributes.instanceStart, i = t.attributes.instanceEnd, r = new Float32Array(2 * e.count);
|
|
335
|
+
for (let a = 0, s = 0, l = e.count; a < l; a++, s += 2)
|
|
336
|
+
rt.fromBufferAttribute(e, a), st.fromBufferAttribute(i, a), r[s] = s === 0 ? 0 : r[s - 1], r[s + 1] = r[s] + rt.distanceTo(st);
|
|
337
|
+
const n = new wt(
|
|
90
338
|
r,
|
|
91
339
|
2,
|
|
92
340
|
1
|
|
93
341
|
);
|
|
94
342
|
return t.setAttribute(
|
|
95
343
|
"instanceDistanceStart",
|
|
96
|
-
new
|
|
344
|
+
new J(n, 1, 0)
|
|
97
345
|
), t.setAttribute(
|
|
98
346
|
"instanceDistanceEnd",
|
|
99
|
-
new
|
|
347
|
+
new J(n, 1, 1)
|
|
100
348
|
), this;
|
|
101
349
|
}
|
|
102
350
|
raycast(t, e) {
|
|
103
|
-
const
|
|
104
|
-
r === null && !
|
|
351
|
+
const i = this.material.worldUnits, r = t.camera;
|
|
352
|
+
r === null && !i && console.error(
|
|
105
353
|
'LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.'
|
|
106
354
|
);
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
const a = this.matrixWorld,
|
|
110
|
-
|
|
355
|
+
const n = t.params.Line2 !== void 0 && t.params.Line2.threshold || 0;
|
|
356
|
+
B = t.ray;
|
|
357
|
+
const a = this.matrixWorld, s = this.geometry, l = this.material;
|
|
358
|
+
T = l.linewidth + n, s.boundingSphere === null && s.computeBoundingSphere(), R.copy(s.boundingSphere).applyMatrix4(a);
|
|
111
359
|
let u;
|
|
112
|
-
if (
|
|
113
|
-
u =
|
|
360
|
+
if (i)
|
|
361
|
+
u = T * 0.5;
|
|
114
362
|
else {
|
|
115
|
-
const
|
|
363
|
+
const p = Math.max(
|
|
116
364
|
r.near,
|
|
117
|
-
|
|
365
|
+
R.distanceToPoint(B.origin)
|
|
118
366
|
);
|
|
119
|
-
u =
|
|
367
|
+
u = ot(
|
|
120
368
|
r,
|
|
121
|
-
|
|
122
|
-
|
|
369
|
+
p,
|
|
370
|
+
l.resolution
|
|
123
371
|
);
|
|
124
372
|
}
|
|
125
|
-
if (
|
|
373
|
+
if (R.radius += u, B.intersectsSphere(R) === !1)
|
|
126
374
|
return;
|
|
127
|
-
|
|
128
|
-
let
|
|
129
|
-
if (
|
|
130
|
-
|
|
375
|
+
s.boundingBox === null && s.computeBoundingBox(), G.copy(s.boundingBox).applyMatrix4(a);
|
|
376
|
+
let f;
|
|
377
|
+
if (i)
|
|
378
|
+
f = T * 0.5;
|
|
131
379
|
else {
|
|
132
|
-
const
|
|
380
|
+
const p = Math.max(
|
|
133
381
|
r.near,
|
|
134
|
-
|
|
382
|
+
G.distanceToPoint(B.origin)
|
|
135
383
|
);
|
|
136
|
-
|
|
384
|
+
f = ot(
|
|
137
385
|
r,
|
|
138
|
-
|
|
139
|
-
|
|
386
|
+
p,
|
|
387
|
+
l.resolution
|
|
140
388
|
);
|
|
141
389
|
}
|
|
142
|
-
|
|
390
|
+
G.expandByScalar(f), B.intersectsBox(G) !== !1 && (i ? Rt(this, e) : Ft(this, r, e));
|
|
143
391
|
}
|
|
144
392
|
onBeforeRender(t) {
|
|
145
393
|
const e = this.material.uniforms;
|
|
146
|
-
e && e.resolution && (t.getViewport(
|
|
394
|
+
e && e.resolution && (t.getViewport(Z), this.material.uniforms.resolution.value.set(Z.z, Z.w));
|
|
147
395
|
}
|
|
148
396
|
}
|
|
149
|
-
const
|
|
397
|
+
const at = ["encodings_fragment", "colorspace_fragment"], kt = (
|
|
150
398
|
/* glsl */
|
|
151
399
|
`
|
|
152
400
|
#include <common>
|
|
@@ -242,7 +490,7 @@ const se = ["encodings_fragment", "colorspace_fragment"], Le = (
|
|
|
242
490
|
#include <fog_vertex>
|
|
243
491
|
}
|
|
244
492
|
`
|
|
245
|
-
),
|
|
493
|
+
), Zt = (
|
|
246
494
|
/* glsl */
|
|
247
495
|
`
|
|
248
496
|
#include <packing>
|
|
@@ -294,22 +542,22 @@ const se = ["encodings_fragment", "colorspace_fragment"], Le = (
|
|
|
294
542
|
|
|
295
543
|
#include <fog_fragment>
|
|
296
544
|
#include <tonemapping_fragment>
|
|
297
|
-
#include <${+
|
|
545
|
+
#include <${+h.REVISION < 154 ? at[0] : at[1]}>
|
|
298
546
|
}
|
|
299
547
|
`
|
|
300
548
|
);
|
|
301
|
-
class
|
|
549
|
+
class me extends h.ShaderMaterial {
|
|
302
550
|
constructor(t) {
|
|
303
551
|
super({
|
|
304
|
-
uniforms:
|
|
552
|
+
uniforms: H(E({}, h.UniformsLib.fog), {
|
|
305
553
|
lineWidth: { value: 1 },
|
|
306
554
|
map: { value: null },
|
|
307
555
|
useMap: { value: 0 },
|
|
308
556
|
alphaMap: { value: null },
|
|
309
557
|
useAlphaMap: { value: 0 },
|
|
310
|
-
color: { value: new
|
|
558
|
+
color: { value: new h.Color(16777215) },
|
|
311
559
|
opacity: { value: 1 },
|
|
312
|
-
resolution: { value: new
|
|
560
|
+
resolution: { value: new h.Vector2(1, 1) },
|
|
313
561
|
sizeAttenuation: { value: 1 },
|
|
314
562
|
dashArray: { value: 0 },
|
|
315
563
|
dashOffset: { value: 0 },
|
|
@@ -318,19 +566,19 @@ class it extends _.ShaderMaterial {
|
|
|
318
566
|
useDepth: { value: 0 },
|
|
319
567
|
visibility: { value: 1 },
|
|
320
568
|
alphaTest: { value: 0 },
|
|
321
|
-
repeat: { value: new
|
|
322
|
-
offset: { value: new
|
|
569
|
+
repeat: { value: new h.Vector2(1, 1) },
|
|
570
|
+
offset: { value: new h.Vector2(0, 0) },
|
|
323
571
|
offsetLoop: { value: 1 },
|
|
324
572
|
lineLightAnimation: { value: 0 },
|
|
325
573
|
time: { value: 0 },
|
|
326
574
|
size: { value: 300 },
|
|
327
575
|
speed: { value: 0.3 },
|
|
328
576
|
lightWidth: { value: 0.1 },
|
|
329
|
-
uCenter: { value: new
|
|
330
|
-
lightColor: { value: new
|
|
577
|
+
uCenter: { value: new h.Vector2(0, 0) },
|
|
578
|
+
lightColor: { value: new h.Color(16777215) }
|
|
331
579
|
}),
|
|
332
|
-
vertexShader:
|
|
333
|
-
fragmentShader:
|
|
580
|
+
vertexShader: kt,
|
|
581
|
+
fragmentShader: Zt
|
|
334
582
|
}), this.type = "MeshLineMaterial", Object.defineProperties(this, {
|
|
335
583
|
lineWidth: {
|
|
336
584
|
enumerable: !0,
|
|
@@ -554,220 +802,220 @@ class it extends _.ShaderMaterial {
|
|
|
554
802
|
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;
|
|
555
803
|
}
|
|
556
804
|
}
|
|
557
|
-
function
|
|
558
|
-
return
|
|
559
|
-
const
|
|
805
|
+
function $t(o, t) {
|
|
806
|
+
return o.map((e) => {
|
|
807
|
+
const i = [];
|
|
560
808
|
let r;
|
|
561
|
-
return e.forEach((
|
|
809
|
+
return e.forEach((n) => {
|
|
562
810
|
if (r) {
|
|
563
|
-
const a =
|
|
811
|
+
const a = Dt(n, r) * 180 / Math.PI;
|
|
564
812
|
if (a > t) {
|
|
565
|
-
const
|
|
566
|
-
let u =
|
|
813
|
+
const s = _t(r, n), l = 1 / Math.ceil(a / t);
|
|
814
|
+
let u = l;
|
|
567
815
|
for (; u < 1; )
|
|
568
|
-
|
|
816
|
+
i.push(s(u)), u += l;
|
|
569
817
|
}
|
|
570
818
|
}
|
|
571
|
-
|
|
572
|
-
}),
|
|
819
|
+
i.push(r = n);
|
|
820
|
+
}), i;
|
|
573
821
|
});
|
|
574
822
|
}
|
|
575
|
-
function
|
|
576
|
-
const
|
|
823
|
+
function qt(o, { minLng: t, maxLng: e, minLat: i, maxLat: r } = {}) {
|
|
824
|
+
const n = Math.round(Y(360 / o, 2) / Math.PI), a = (1 + Math.sqrt(5)) / 2, s = (c) => c / a * 360 % 360 - 180, l = (c) => Math.acos(2 * c / n - 1) / Math.PI * 180 - 90, u = (c) => n * (Math.cos((c + 90) * Math.PI / 180) + 1) / 2, f = [
|
|
577
825
|
r !== void 0 ? Math.ceil(u(r)) : 0,
|
|
578
|
-
|
|
579
|
-
],
|
|
580
|
-
for (let
|
|
581
|
-
const
|
|
582
|
-
|
|
826
|
+
i !== void 0 ? Math.floor(u(i)) : n - 1
|
|
827
|
+
], p = t === void 0 && e === void 0 ? () => !0 : t === void 0 ? (c) => c <= e : e === void 0 ? (c) => c >= t : e >= t ? (c) => c >= t && c <= e : (c) => c >= t || c <= e, v = [];
|
|
828
|
+
for (let c = f[0]; c <= f[1]; c++) {
|
|
829
|
+
const m = s(c);
|
|
830
|
+
p(m) && v.push([m, l(c)]);
|
|
583
831
|
}
|
|
584
|
-
return
|
|
832
|
+
return v;
|
|
585
833
|
}
|
|
586
|
-
function N(
|
|
587
|
-
return e ?
|
|
834
|
+
function N(o, t, e = !1) {
|
|
835
|
+
return e ? It(t, o) : Ot(o, t);
|
|
588
836
|
}
|
|
589
|
-
function
|
|
590
|
-
const e = { type: "Polygon", coordinates:
|
|
591
|
-
if (Math.min(Math.abs(
|
|
837
|
+
function Nt(o, t) {
|
|
838
|
+
const e = { type: "Polygon", coordinates: o }, [[i, r], [n, a]] = ct(e);
|
|
839
|
+
if (Math.min(Math.abs(n - i), Math.abs(a - r)) < t)
|
|
592
840
|
return [];
|
|
593
|
-
const
|
|
594
|
-
return
|
|
595
|
-
minLng:
|
|
596
|
-
maxLng:
|
|
841
|
+
const s = i > n || a >= 89 || r <= -89;
|
|
842
|
+
return qt(t, {
|
|
843
|
+
minLng: i,
|
|
844
|
+
maxLng: n,
|
|
597
845
|
minLat: r,
|
|
598
846
|
maxLat: a
|
|
599
847
|
}).filter(
|
|
600
|
-
(
|
|
848
|
+
(l) => N(l, e, s)
|
|
601
849
|
);
|
|
602
850
|
}
|
|
603
|
-
function
|
|
604
|
-
const r =
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
let
|
|
608
|
-
if (
|
|
609
|
-
const
|
|
610
|
-
|
|
851
|
+
function Qt(o, { resolution: t = 1 / 0, bbox: e, projection: i } = {}) {
|
|
852
|
+
const r = $t(o, t), n = Q(r), a = Nt(o, t), s = [...n, ...a], l = { type: "Polygon", coordinates: o }, [[u, f], [p, v]] = ct(l), c = u > p || // crosses antimeridian
|
|
853
|
+
v >= 89 || // crosses north pole
|
|
854
|
+
f <= -89;
|
|
855
|
+
let m = [];
|
|
856
|
+
if (c) {
|
|
857
|
+
const g = Et(s).triangles(), w = new Map(
|
|
858
|
+
s.map(([A, C], L) => [`${A}-${C}`, L])
|
|
611
859
|
);
|
|
612
|
-
|
|
613
|
-
const
|
|
614
|
-
if (
|
|
615
|
-
const
|
|
616
|
-
|
|
617
|
-
}),
|
|
618
|
-
if (
|
|
619
|
-
const
|
|
860
|
+
g.features.forEach((A) => {
|
|
861
|
+
const C = A.geometry.coordinates[0].slice(0, 3).reverse(), L = [];
|
|
862
|
+
if (C.forEach(([S, k]) => {
|
|
863
|
+
const O = `${S}-${k}`;
|
|
864
|
+
w.has(O) && L.push(w.get(O));
|
|
865
|
+
}), L.length === 3) {
|
|
866
|
+
if (L.some((S) => S < n.length)) {
|
|
867
|
+
const S = A.properties.circumcenter;
|
|
620
868
|
if (!N(
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
869
|
+
S,
|
|
870
|
+
l,
|
|
871
|
+
c
|
|
624
872
|
))
|
|
625
873
|
return;
|
|
626
874
|
}
|
|
627
|
-
|
|
875
|
+
m.push(...L);
|
|
628
876
|
}
|
|
629
877
|
});
|
|
630
878
|
} else if (a.length) {
|
|
631
|
-
const
|
|
632
|
-
for (let
|
|
633
|
-
const
|
|
634
|
-
if (
|
|
635
|
-
const
|
|
636
|
-
(
|
|
879
|
+
const g = Vt.from(s);
|
|
880
|
+
for (let w = 0, A = g.triangles.length; w < A; w += 3) {
|
|
881
|
+
const C = [2, 1, 0].map((S) => g.triangles[w + S]), L = C.map((S) => s[S]);
|
|
882
|
+
if (C.some((S) => S < n.length)) {
|
|
883
|
+
const S = [0, 1].map(
|
|
884
|
+
(k) => Lt(L, (O) => O[k])
|
|
637
885
|
);
|
|
638
886
|
if (!N(
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
887
|
+
S,
|
|
888
|
+
l,
|
|
889
|
+
c
|
|
642
890
|
))
|
|
643
891
|
continue;
|
|
644
892
|
}
|
|
645
|
-
|
|
893
|
+
m.push(...C);
|
|
646
894
|
}
|
|
647
895
|
} else {
|
|
648
|
-
const { vertices:
|
|
649
|
-
|
|
650
|
-
}
|
|
651
|
-
let
|
|
652
|
-
if (
|
|
653
|
-
const [
|
|
654
|
-
|
|
655
|
-
}
|
|
656
|
-
const
|
|
657
|
-
if (
|
|
658
|
-
const [
|
|
659
|
-
return [
|
|
896
|
+
const { vertices: g, holes: w = [] } = ht(r);
|
|
897
|
+
m = Wt(g, w, 2);
|
|
898
|
+
}
|
|
899
|
+
let d = e ? [e[0], e[2]] : et(s, (g) => g[0]), b = e ? [e[1], e[3]] : et(s, (g) => g[1]);
|
|
900
|
+
if (i) {
|
|
901
|
+
const [g, w] = i([d[0], b[0]]), [A, C] = i([d[1], b[1]]);
|
|
902
|
+
d = [g, A], b = [-w, -C];
|
|
903
|
+
}
|
|
904
|
+
const j = it(d, [0, 1]), z = it(b, [0, 1]), I = s.map(([g, w]) => {
|
|
905
|
+
if (i) {
|
|
906
|
+
const [A, C] = i([g, w]);
|
|
907
|
+
return [j(A), z(-C)];
|
|
660
908
|
} else
|
|
661
|
-
return [
|
|
909
|
+
return [j(g), z(w)];
|
|
662
910
|
});
|
|
663
|
-
return { contour: r, triangles: { points:
|
|
911
|
+
return { contour: r, triangles: { points: s, indices: m, uvs: I } };
|
|
664
912
|
}
|
|
665
|
-
const
|
|
666
|
-
function F(
|
|
667
|
-
const r =
|
|
668
|
-
(
|
|
669
|
-
if (
|
|
670
|
-
const [
|
|
671
|
-
return [
|
|
913
|
+
const lt = new h.BufferGeometry().setAttribute ? "setAttribute" : "addAttribute";
|
|
914
|
+
function F(o, t, e, i) {
|
|
915
|
+
const r = o.map(
|
|
916
|
+
(n) => n.map(([a, s]) => {
|
|
917
|
+
if (i) {
|
|
918
|
+
const [l, u] = i([a, s]);
|
|
919
|
+
return [l, -u, t];
|
|
672
920
|
}
|
|
673
|
-
return e ?
|
|
921
|
+
return e ? zt(a, s, t) : [a, s, t];
|
|
674
922
|
})
|
|
675
923
|
);
|
|
676
|
-
return
|
|
924
|
+
return ht(r);
|
|
677
925
|
}
|
|
678
|
-
function
|
|
679
|
-
const { vertices:
|
|
680
|
-
|
|
926
|
+
function Kt(o, t, e, i, r) {
|
|
927
|
+
const { vertices: n, holes: a } = F(
|
|
928
|
+
o,
|
|
681
929
|
t,
|
|
682
|
-
|
|
930
|
+
i,
|
|
683
931
|
r
|
|
684
|
-
), { vertices:
|
|
685
|
-
|
|
932
|
+
), { vertices: s } = F(
|
|
933
|
+
o,
|
|
686
934
|
e,
|
|
687
|
-
|
|
935
|
+
i,
|
|
688
936
|
r
|
|
689
|
-
),
|
|
690
|
-
let
|
|
691
|
-
const
|
|
692
|
-
for (let
|
|
693
|
-
let
|
|
694
|
-
if (
|
|
695
|
-
|
|
696
|
-
else if (
|
|
697
|
-
const
|
|
698
|
-
|
|
937
|
+
), l = Q([s, n]), u = Math.round(s.length / 3), f = new Set(a);
|
|
938
|
+
let p = 0;
|
|
939
|
+
const v = [];
|
|
940
|
+
for (let m = 0; m < u; m++) {
|
|
941
|
+
let d = m + 1;
|
|
942
|
+
if (d === u)
|
|
943
|
+
d = p;
|
|
944
|
+
else if (f.has(d)) {
|
|
945
|
+
const b = d;
|
|
946
|
+
d = p, p = b;
|
|
699
947
|
}
|
|
700
|
-
|
|
948
|
+
v.push(m, m + u, d + u), v.push(d + u, d, m);
|
|
701
949
|
}
|
|
702
|
-
const
|
|
703
|
-
for (let
|
|
704
|
-
for (let
|
|
705
|
-
return { indices:
|
|
950
|
+
const c = [];
|
|
951
|
+
for (let m = 1; m >= 0; m--)
|
|
952
|
+
for (let d = 0; d < u; d += 1) c.push(d / (u - 1), m);
|
|
953
|
+
return { indices: v, vertices: l, uvs: c, topVerts: s };
|
|
706
954
|
}
|
|
707
|
-
function
|
|
955
|
+
function ut(o, t, e, i, r, n) {
|
|
708
956
|
return {
|
|
709
|
-
indices:
|
|
957
|
+
indices: i ? o.indices : o.indices.slice().reverse(),
|
|
710
958
|
vertices: F(
|
|
711
|
-
[
|
|
959
|
+
[o.points],
|
|
712
960
|
t,
|
|
713
961
|
r,
|
|
714
|
-
|
|
962
|
+
n
|
|
715
963
|
).vertices,
|
|
716
964
|
uvs: e
|
|
717
965
|
};
|
|
718
966
|
}
|
|
719
|
-
const
|
|
720
|
-
polygonGeoJson:
|
|
967
|
+
const Xt = ({
|
|
968
|
+
polygonGeoJson: o,
|
|
721
969
|
startHeight: t,
|
|
722
970
|
endHeight: e,
|
|
723
|
-
curvatureResolution:
|
|
971
|
+
curvatureResolution: i = 1,
|
|
724
972
|
cartesian: r = !0,
|
|
725
|
-
hasSide:
|
|
973
|
+
hasSide: n = !0,
|
|
726
974
|
hasBottom: a = !1,
|
|
727
|
-
hasTop:
|
|
728
|
-
projection:
|
|
975
|
+
hasTop: s = !1,
|
|
976
|
+
projection: l,
|
|
729
977
|
bbox: u
|
|
730
978
|
}) => {
|
|
731
|
-
|
|
732
|
-
|
|
979
|
+
o.forEach((j) => {
|
|
980
|
+
Tt(j) || j.reverse();
|
|
733
981
|
});
|
|
734
|
-
const { contour:
|
|
735
|
-
resolution:
|
|
982
|
+
const { contour: f, triangles: p } = Qt(o, {
|
|
983
|
+
resolution: i,
|
|
736
984
|
bbox: u,
|
|
737
|
-
projection:
|
|
985
|
+
projection: l
|
|
738
986
|
});
|
|
739
|
-
let
|
|
740
|
-
|
|
741
|
-
|
|
987
|
+
let v = {}, c;
|
|
988
|
+
n && (v = Kt(
|
|
989
|
+
f,
|
|
742
990
|
t != null ? t : e,
|
|
743
991
|
e != null ? e : t,
|
|
744
992
|
r,
|
|
745
|
-
|
|
746
|
-
),
|
|
747
|
-
let
|
|
748
|
-
(a ||
|
|
749
|
-
let
|
|
750
|
-
a && (
|
|
751
|
-
f,
|
|
752
|
-
t,
|
|
993
|
+
l
|
|
994
|
+
), c = v.topVerts);
|
|
995
|
+
let m = [];
|
|
996
|
+
(a || s) && (m = Q(p.uvs));
|
|
997
|
+
let d = {};
|
|
998
|
+
a && (d = ut(
|
|
753
999
|
p,
|
|
1000
|
+
t,
|
|
1001
|
+
m,
|
|
754
1002
|
!1,
|
|
755
1003
|
r,
|
|
756
|
-
|
|
1004
|
+
l
|
|
757
1005
|
));
|
|
758
|
-
let
|
|
759
|
-
return
|
|
760
|
-
f,
|
|
761
|
-
e,
|
|
1006
|
+
let b = {};
|
|
1007
|
+
return s && (b = ut(
|
|
762
1008
|
p,
|
|
1009
|
+
e,
|
|
1010
|
+
m,
|
|
763
1011
|
!0,
|
|
764
1012
|
r,
|
|
765
|
-
|
|
766
|
-
)), { contour:
|
|
1013
|
+
l
|
|
1014
|
+
)), { contour: f, triangles: p, sideTorso: v, bottomCap: d, topCap: b, topVerts: c };
|
|
767
1015
|
};
|
|
768
|
-
class
|
|
1016
|
+
class ve extends h.BufferGeometry {
|
|
769
1017
|
constructor(t, e = {}) {
|
|
770
|
-
super(), this.type = "PolygonBufferGeometry", this.parameters =
|
|
1018
|
+
super(), this.type = "PolygonBufferGeometry", this.parameters = E({
|
|
771
1019
|
polygonGeoJson: t,
|
|
772
1020
|
startHeight: 0,
|
|
773
1021
|
endHeight: 1,
|
|
@@ -780,36 +1028,38 @@ class nt extends _.BufferGeometry {
|
|
|
780
1028
|
userDataRsoOffset: 0
|
|
781
1029
|
}, e);
|
|
782
1030
|
const {
|
|
783
|
-
endHeight:
|
|
1031
|
+
endHeight: i,
|
|
784
1032
|
hasTop: r,
|
|
785
|
-
topFirst:
|
|
1033
|
+
topFirst: n,
|
|
786
1034
|
hasBottom: a,
|
|
787
|
-
hasSide:
|
|
788
|
-
cartesian:
|
|
1035
|
+
hasSide: s,
|
|
1036
|
+
cartesian: l,
|
|
789
1037
|
userDataRsoOffset: u,
|
|
790
|
-
projection:
|
|
791
|
-
} = this.parameters, { contour:
|
|
792
|
-
let
|
|
793
|
-
const
|
|
794
|
-
const
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
), this.addGroup(
|
|
1038
|
+
projection: f
|
|
1039
|
+
} = this.parameters, { contour: p, sideTorso: v, topVerts: c, bottomCap: m, topCap: d } = Xt(E({}, this.parameters));
|
|
1040
|
+
let b = [], j = [], z = [], I = 0;
|
|
1041
|
+
const P = (g) => {
|
|
1042
|
+
const w = Math.round(b.length / 3), A = z.length;
|
|
1043
|
+
b = b.concat(g.vertices), j = j.concat(g.uvs), z = z.concat(
|
|
1044
|
+
w ? g.indices.map((C) => C + w) : g.indices
|
|
1045
|
+
), this.addGroup(A, z.length - A, I++);
|
|
798
1046
|
};
|
|
799
|
-
r &&
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
).vertices :
|
|
1047
|
+
r && n && P(d), s && (P(v), this.userData.topVerts = u ? F(
|
|
1048
|
+
p,
|
|
1049
|
+
i + u,
|
|
1050
|
+
l,
|
|
1051
|
+
f
|
|
1052
|
+
).vertices : c), a && P(m), r && !n && P(d), this.setIndex(z), this[lt](
|
|
805
1053
|
"position",
|
|
806
|
-
new
|
|
807
|
-
), this[
|
|
1054
|
+
new h.Float32BufferAttribute(b, 3)
|
|
1055
|
+
), this[lt]("uv", new h.Float32BufferAttribute(j, 2)), this.computeVertexNormals();
|
|
808
1056
|
}
|
|
809
1057
|
}
|
|
810
1058
|
export {
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
1059
|
+
Gt as B,
|
|
1060
|
+
pe as G,
|
|
1061
|
+
de as L,
|
|
1062
|
+
me as M,
|
|
1063
|
+
ve as P,
|
|
1064
|
+
Xt as g
|
|
815
1065
|
};
|