gl-draw 0.17.0-beta.37 → 0.17.0-beta.39
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/cartographicToCartesian.js +1 -1
- package/dist/cartographicToCartesian.module.js +29 -29
- package/dist/objects/ellipsoid/createGeometry.d.ts +2 -2
- package/dist/objects/index.js +1 -1
- package/dist/objects/index.module.js +359 -359
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/index.module.js +1 -1
- package/package.json +1 -1
|
@@ -1,74 +1,74 @@
|
|
|
1
1
|
var te = Object.defineProperty, ee = Object.defineProperties;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
2
|
+
var ne = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var pt = Object.getOwnPropertySymbols;
|
|
4
4
|
var Ot = Object.prototype.hasOwnProperty, Ut = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var Rt = (
|
|
5
|
+
var Rt = (d, t, e) => t in d ? te(d, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : d[t] = e, X = (d, t) => {
|
|
6
6
|
for (var e in t || (t = {}))
|
|
7
|
-
Ot.call(t, e) && Rt(
|
|
8
|
-
if (
|
|
9
|
-
for (var e of
|
|
10
|
-
Ut.call(t, e) && Rt(
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
var
|
|
7
|
+
Ot.call(t, e) && Rt(d, e, t[e]);
|
|
8
|
+
if (pt)
|
|
9
|
+
for (var e of pt(t))
|
|
10
|
+
Ut.call(t, e) && Rt(d, e, t[e]);
|
|
11
|
+
return d;
|
|
12
|
+
}, gt = (d, t) => ee(d, ne(t));
|
|
13
|
+
var wt = (d, t) => {
|
|
14
14
|
var e = {};
|
|
15
|
-
for (var
|
|
16
|
-
Ot.call(
|
|
17
|
-
if (
|
|
18
|
-
for (var
|
|
19
|
-
t.indexOf(
|
|
15
|
+
for (var n in d)
|
|
16
|
+
Ot.call(d, n) && t.indexOf(n) < 0 && (e[n] = d[n]);
|
|
17
|
+
if (d != null && pt)
|
|
18
|
+
for (var n of pt(d))
|
|
19
|
+
t.indexOf(n) < 0 && Ut.call(d, n) && (e[n] = d[n]);
|
|
20
20
|
return e;
|
|
21
21
|
};
|
|
22
|
-
var
|
|
22
|
+
var ct = (d, t, e) => new Promise((n, s) => {
|
|
23
23
|
var r = (i) => {
|
|
24
24
|
try {
|
|
25
25
|
f(e.next(i));
|
|
26
26
|
} catch (h) {
|
|
27
|
-
|
|
27
|
+
s(h);
|
|
28
28
|
}
|
|
29
29
|
}, a = (i) => {
|
|
30
30
|
try {
|
|
31
31
|
f(e.throw(i));
|
|
32
32
|
} catch (h) {
|
|
33
|
-
|
|
33
|
+
s(h);
|
|
34
34
|
}
|
|
35
|
-
}, f = (i) => i.done ?
|
|
36
|
-
f((e = e.apply(
|
|
35
|
+
}, f = (i) => i.done ? n(i.value) : Promise.resolve(i.value).then(r, a);
|
|
36
|
+
f((e = e.apply(d, t)).next());
|
|
37
37
|
});
|
|
38
|
-
import { LineMaterial as
|
|
39
|
-
import { LineMaterial as
|
|
38
|
+
import { LineMaterial as se } from "three/examples/jsm/lines/LineMaterial";
|
|
39
|
+
import { LineMaterial as pn } from "three/examples/jsm/lines/LineMaterial";
|
|
40
40
|
import { LineSegmentsGeometry as oe } from "three/examples/jsm/lines/LineSegmentsGeometry";
|
|
41
|
-
import { LineSegmentsGeometry as
|
|
42
|
-
import { P as ie, a as
|
|
43
|
-
import { N as
|
|
44
|
-
import { BufferGeometry as
|
|
41
|
+
import { LineSegmentsGeometry as yn } from "three/examples/jsm/lines/LineSegmentsGeometry";
|
|
42
|
+
import { P as ie, a as K, M as re, L as ae } from "../index.module2.js";
|
|
43
|
+
import { N as xn, g as wn } from "../index.module2.js";
|
|
44
|
+
import { BufferGeometry as lt, Float32BufferAttribute as rt, MeshStandardMaterial as ce, Mesh as kt, Vector3 as j, ShapeUtils as yt, Shape as Mt, Vector2 as z, ArcCurve as le, CatmullRomCurve3 as he, CubicBezierCurve as ue, CubicBezierCurve3 as fe, EllipseCurve as de, LineCurve as me, LineCurve3 as pe, QuadraticBezierCurve as ge, QuadraticBezierCurve3 as ye, SplineCurve as be, Box3 as xe, PlaneGeometry as we, CanvasTexture as ve, AmbientLight as Se, DirectionalLight as Me, PointLight as Ae, SpotLight as Le, HemisphereLight as Te, RectAreaLight as Ge, Matrix4 as qt, BufferAttribute as Q, Ray as Ee, Sphere as _e, LineSegments as Ft, Color as Yt, MeshBasicMaterial as Pe } from "three";
|
|
45
45
|
import { mergeAttributes as Dt, mergeGroups as ze } from "three/examples/jsm/utils/BufferGeometryUtils";
|
|
46
|
-
import { W as
|
|
46
|
+
import { W as vt } from "../cartographicToCartesian.module.js";
|
|
47
47
|
import { g as je, c as Ce } from "../uvGenerator.module.js";
|
|
48
|
-
import { Brush as
|
|
48
|
+
import { Brush as Ht, Evaluator as Ie, INTERSECTION as Be } from "three-bvh-csg";
|
|
49
49
|
import { RectAreaLightUniformsLib as Re } from "three/examples/jsm/lights/RectAreaLightUniformsLib";
|
|
50
|
-
import * as
|
|
50
|
+
import * as it from "@tweenjs/tween.js";
|
|
51
51
|
import { LineSegments2 as Oe } from "three/examples/jsm/lines/LineSegments2";
|
|
52
|
-
function
|
|
53
|
-
const e =
|
|
54
|
-
Object.keys(
|
|
55
|
-
), r = {}, a = {}, f =
|
|
52
|
+
function q(d, t = 0) {
|
|
53
|
+
const e = d[0].index !== null, n = new Set(Object.keys(d[0].attributes)), s = new Set(
|
|
54
|
+
Object.keys(d[0].morphAttributes)
|
|
55
|
+
), r = {}, a = {}, f = d[0].morphTargetsRelative, i = new lt();
|
|
56
56
|
let h = 0;
|
|
57
|
-
for (let o = 0; o <
|
|
58
|
-
const c =
|
|
57
|
+
for (let o = 0; o < d.length; ++o) {
|
|
58
|
+
const c = d[o];
|
|
59
59
|
let g = 0;
|
|
60
60
|
if (e !== (c.index !== null))
|
|
61
61
|
return console.error(
|
|
62
62
|
"THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + o + ". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."
|
|
63
63
|
), null;
|
|
64
64
|
for (const u in c.attributes) {
|
|
65
|
-
if (!
|
|
65
|
+
if (!n.has(u))
|
|
66
66
|
return console.error(
|
|
67
67
|
"THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + o + '. All geometries must have compatible attributes; make sure "' + u + '" attribute exists among all geometries, or in none of them.'
|
|
68
68
|
), null;
|
|
69
69
|
r[u] === void 0 && (r[u] = []), r[u].push(c.attributes[u]), g++;
|
|
70
70
|
}
|
|
71
|
-
if (g !==
|
|
71
|
+
if (g !== n.size)
|
|
72
72
|
return console.error(
|
|
73
73
|
"THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + o + ". Make sure all geometries have the same number of attributes."
|
|
74
74
|
), null;
|
|
@@ -77,7 +77,7 @@ function k(m, t = 0) {
|
|
|
77
77
|
"THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + o + ". .morphTargetsRelative must be consistent throughout all geometries."
|
|
78
78
|
), null;
|
|
79
79
|
for (const u in c.morphAttributes) {
|
|
80
|
-
if (!
|
|
80
|
+
if (!s.has(u))
|
|
81
81
|
return console.error(
|
|
82
82
|
"THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + o + ". .morphAttributes must be consistent throughout all geometries."
|
|
83
83
|
), null;
|
|
@@ -110,11 +110,11 @@ function k(m, t = 0) {
|
|
|
110
110
|
if (e) {
|
|
111
111
|
let o = 0;
|
|
112
112
|
const c = [];
|
|
113
|
-
for (let g = 0; g <
|
|
114
|
-
const u =
|
|
113
|
+
for (let g = 0; g < d.length; ++g) {
|
|
114
|
+
const u = d[g].index;
|
|
115
115
|
for (let y = 0; y < u.count; ++y)
|
|
116
116
|
c.push(u.getX(y) + o);
|
|
117
|
-
o +=
|
|
117
|
+
o += d[g].attributes.position.count;
|
|
118
118
|
}
|
|
119
119
|
i.setIndex(c);
|
|
120
120
|
}
|
|
@@ -144,26 +144,26 @@ function k(m, t = 0) {
|
|
|
144
144
|
}
|
|
145
145
|
return t === 2 ? ze(i) : i;
|
|
146
146
|
}
|
|
147
|
-
const
|
|
148
|
-
const f =
|
|
147
|
+
const Wt = (d) => {
|
|
148
|
+
const f = d, { coordinate: t, startHeight: e, height: n } = f, s = wt(f, ["coordinate", "startHeight", "height"]);
|
|
149
149
|
let r = e || 0;
|
|
150
|
-
return typeof e != "undefined" && typeof
|
|
150
|
+
return typeof e != "undefined" && typeof n != "undefined" && (r = e + n), new ie([t], gt(X({}, s), {
|
|
151
151
|
startHeight: e,
|
|
152
152
|
endHeight: r
|
|
153
153
|
}));
|
|
154
154
|
};
|
|
155
|
-
class
|
|
155
|
+
class en extends K {
|
|
156
156
|
constructor(t) {
|
|
157
|
-
super(), this.options =
|
|
157
|
+
super(), this.options = X({}, t);
|
|
158
158
|
}
|
|
159
159
|
create() {
|
|
160
160
|
const i = this.options, {
|
|
161
161
|
geometry: t,
|
|
162
162
|
coordinateArr: e,
|
|
163
|
-
coordinate:
|
|
164
|
-
material:
|
|
163
|
+
coordinate: n,
|
|
164
|
+
material: s,
|
|
165
165
|
useGroups: r
|
|
166
|
-
} = i, a =
|
|
166
|
+
} = i, a = wt(i, [
|
|
167
167
|
"geometry",
|
|
168
168
|
"coordinateArr",
|
|
169
169
|
"coordinate",
|
|
@@ -171,49 +171,49 @@ class es extends tt {
|
|
|
171
171
|
"useGroups"
|
|
172
172
|
]);
|
|
173
173
|
let f = t;
|
|
174
|
-
if (!f &&
|
|
175
|
-
f =
|
|
176
|
-
coordinate:
|
|
174
|
+
if (!f && n)
|
|
175
|
+
f = Wt(X({
|
|
176
|
+
coordinate: n
|
|
177
177
|
}, a));
|
|
178
178
|
else if (!f && e) {
|
|
179
179
|
const h = e.map(
|
|
180
|
-
(o) =>
|
|
180
|
+
(o) => Wt(X({
|
|
181
181
|
coordinate: o
|
|
182
182
|
}, a))
|
|
183
183
|
);
|
|
184
|
-
f =
|
|
184
|
+
f = q(h, r != null ? r : 0);
|
|
185
185
|
}
|
|
186
|
-
this.createMesh(f,
|
|
186
|
+
this.createMesh(f, s);
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
function Ue(
|
|
189
|
+
function Ue(d = {}) {
|
|
190
190
|
const {
|
|
191
|
-
a: t =
|
|
192
|
-
b: e =
|
|
193
|
-
scaleFactor:
|
|
194
|
-
widthSegments:
|
|
191
|
+
a: t = vt.a,
|
|
192
|
+
b: e = vt.b,
|
|
193
|
+
scaleFactor: n = 1 / vt.a,
|
|
194
|
+
widthSegments: s = 64,
|
|
195
195
|
heightSegments: r = 32
|
|
196
|
-
} =
|
|
196
|
+
} = d, a = new lt(), f = [], i = [], h = [], o = [], c = t * t, g = e * e, u = (c - g) / c;
|
|
197
197
|
let y = 0;
|
|
198
198
|
const A = [];
|
|
199
199
|
for (let w = 0; w <= r; w++) {
|
|
200
|
-
const v = [], E = w / r, P = (0.5 - E) * 180 * Math.PI / 180,
|
|
201
|
-
for (let C = 0; C <=
|
|
202
|
-
const
|
|
203
|
-
i.push(
|
|
204
|
-
const
|
|
205
|
-
h.push(
|
|
200
|
+
const v = [], E = w / r, P = (0.5 - E) * 180 * Math.PI / 180, O = Math.sin(P), U = Math.cos(P), N = t / Math.sqrt(1 - u * O * O);
|
|
201
|
+
for (let C = 0; C <= s; C++) {
|
|
202
|
+
const $ = C / s, V = ($ - 0.5) * 360 * Math.PI / 180, at = Math.sin(V), I = Math.cos(V), B = N * U * at * n, At = N * (1 - u) * O * n, ht = N * U * I * n;
|
|
203
|
+
i.push(B, At, ht);
|
|
204
|
+
const tt = U * at / t, R = O * (1 - u) / e, k = U * I / t, D = Math.sqrt(tt * tt + R * R + k * k);
|
|
205
|
+
h.push(tt / D, R / D, k / D), o.push($, 1 - E), v.push(y++);
|
|
206
206
|
}
|
|
207
207
|
A.push(v);
|
|
208
208
|
}
|
|
209
209
|
for (let w = 0; w < r; w++)
|
|
210
|
-
for (let v = 0; v <
|
|
211
|
-
const E = A[w][v + 1], S = A[w][v], P = A[w + 1][v],
|
|
212
|
-
f.push(E, S,
|
|
210
|
+
for (let v = 0; v < s; v++) {
|
|
211
|
+
const E = A[w][v + 1], S = A[w][v], P = A[w + 1][v], O = A[w + 1][v + 1];
|
|
212
|
+
f.push(E, S, O), f.push(S, P, O);
|
|
213
213
|
}
|
|
214
|
-
return a.setIndex(f), a.setAttribute("position", new
|
|
214
|
+
return a.setIndex(f), a.setAttribute("position", new rt(i, 3)), a.setAttribute("normal", new rt(h, 3)), a.setAttribute("uv", new rt(o, 2)), a;
|
|
215
215
|
}
|
|
216
|
-
class
|
|
216
|
+
class nn extends K {
|
|
217
217
|
constructor(t = {}) {
|
|
218
218
|
super(), this.options = t;
|
|
219
219
|
}
|
|
@@ -223,8 +223,8 @@ class ss extends tt {
|
|
|
223
223
|
metalness: 0.1,
|
|
224
224
|
roughness: 0.7,
|
|
225
225
|
wireframe: !1
|
|
226
|
-
}),
|
|
227
|
-
return
|
|
226
|
+
}), n = new kt(t, e);
|
|
227
|
+
return n.name = "Ellipsoid", this.object3d = n, n;
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
const De = {
|
|
@@ -232,21 +232,21 @@ const De = {
|
|
|
232
232
|
CatmullRomCurve3: he,
|
|
233
233
|
CubicBezierCurve: ue,
|
|
234
234
|
CubicBezierCurve3: fe,
|
|
235
|
-
EllipseCurve:
|
|
236
|
-
LineCurve:
|
|
235
|
+
EllipseCurve: de,
|
|
236
|
+
LineCurve: me,
|
|
237
237
|
LineCurve3: pe,
|
|
238
238
|
QuadraticBezierCurve: ge,
|
|
239
239
|
QuadraticBezierCurve3: ye,
|
|
240
240
|
SplineCurve: be
|
|
241
241
|
};
|
|
242
|
-
class
|
|
242
|
+
class st extends lt {
|
|
243
243
|
/**
|
|
244
244
|
* Constructs a new extrude geometry.
|
|
245
245
|
*
|
|
246
246
|
* @param {Shape|Array<Shape>} [shapes] - A shape or an array of shapes.
|
|
247
247
|
* @param {ExtrudeGeometry~Options} [options] - The extrude settings.
|
|
248
248
|
*/
|
|
249
|
-
constructor(t = new
|
|
249
|
+
constructor(t = new Mt([
|
|
250
250
|
new z(0.5, 0.5),
|
|
251
251
|
new z(-0.5, 0.5),
|
|
252
252
|
new z(-0.5, -0.5),
|
|
@@ -256,39 +256,39 @@ class ot extends ft {
|
|
|
256
256
|
shapes: t,
|
|
257
257
|
options: e
|
|
258
258
|
}, t = Array.isArray(t) ? t : [t];
|
|
259
|
-
const
|
|
259
|
+
const n = this, s = [], r = [];
|
|
260
260
|
for (let f = 0, i = t.length; f < i; f++) {
|
|
261
261
|
const h = t[f];
|
|
262
262
|
a(h);
|
|
263
263
|
}
|
|
264
|
-
this.setAttribute("position", new
|
|
264
|
+
this.setAttribute("position", new rt(s, 3)), this.setAttribute("uv", new rt(r, 2)), this.computeVertexNormals();
|
|
265
265
|
function a(f) {
|
|
266
266
|
var Et, _t, Pt;
|
|
267
267
|
const i = [], h = e.curveSegments !== void 0 ? e.curveSegments : 12, o = e.steps !== void 0 ? e.steps : 1, c = e.depth !== void 0 ? e.depth : 1;
|
|
268
268
|
let g = e.bevelEnabled !== void 0 ? e.bevelEnabled : !0, u = e.bevelThickness !== void 0 ? e.bevelThickness : 0.2, y = e.bevelSize !== void 0 ? e.bevelSize : u - 0.1, A = e.bevelOffset !== void 0 ? e.bevelOffset : 0, w = e.bevelSegments !== void 0 ? e.bevelSegments : 3;
|
|
269
|
-
const v = e.extrudePath, E = e.UVGenerator !== void 0 ? e.UVGenerator :
|
|
270
|
-
let
|
|
271
|
-
v && (
|
|
272
|
-
const
|
|
273
|
-
let I =
|
|
274
|
-
const B =
|
|
275
|
-
if (!
|
|
269
|
+
const v = e.extrudePath, E = e.UVGenerator !== void 0 ? e.UVGenerator : He, S = (Et = e.hasTop) != null ? Et : !0, P = (_t = e.hasBottom) != null ? _t : !0, O = (Pt = e.hasSide) != null ? Pt : !0;
|
|
270
|
+
let U, N = !1, C, $, ot, V;
|
|
271
|
+
v && (U = v.getSpacedPoints(o), N = !0, g = !1, C = v.computeFrenetFrames(o, !1), $ = new j(), ot = new j(), V = new j()), g || (w = 0, u = 0, y = 0, A = 0);
|
|
272
|
+
const at = f.extractPoints(h);
|
|
273
|
+
let I = at.shape;
|
|
274
|
+
const B = at.holes;
|
|
275
|
+
if (!yt.isClockWise(I)) {
|
|
276
276
|
I = I.reverse();
|
|
277
|
-
for (let l = 0,
|
|
277
|
+
for (let l = 0, m = B.length; l < m; l++) {
|
|
278
278
|
const p = B[l];
|
|
279
|
-
|
|
279
|
+
yt.isClockWise(p) && (B[l] = p.reverse());
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function ht(l) {
|
|
283
283
|
const p = 10000000000000001e-36;
|
|
284
284
|
let x = l[0];
|
|
285
285
|
for (let b = 1; b <= l.length; b++) {
|
|
286
|
-
const L = b % l.length, M = l[L], T = M.x - x.x, G = M.y - x.y, _ = T * T + G * G,
|
|
286
|
+
const L = b % l.length, M = l[L], T = M.x - x.x, G = M.y - x.y, _ = T * T + G * G, H = Math.max(
|
|
287
287
|
Math.abs(M.x),
|
|
288
288
|
Math.abs(M.y),
|
|
289
289
|
Math.abs(x.x),
|
|
290
290
|
Math.abs(x.y)
|
|
291
|
-
), nt = p *
|
|
291
|
+
), nt = p * H * H;
|
|
292
292
|
if (_ <= nt) {
|
|
293
293
|
l.splice(L, 1), b--;
|
|
294
294
|
continue;
|
|
@@ -296,187 +296,187 @@ class ot extends ft {
|
|
|
296
296
|
x = M;
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
|
-
|
|
300
|
-
const
|
|
301
|
-
for (let l = 0; l <
|
|
302
|
-
const
|
|
303
|
-
I = I.concat(
|
|
299
|
+
ht(I), B.forEach(ht);
|
|
300
|
+
const tt = B.length, R = I;
|
|
301
|
+
for (let l = 0; l < tt; l++) {
|
|
302
|
+
const m = B[l];
|
|
303
|
+
I = I.concat(m);
|
|
304
304
|
}
|
|
305
|
-
function
|
|
306
|
-
return
|
|
305
|
+
function k(l, m, p) {
|
|
306
|
+
return m || error("ExtrudeGeometry: vec does not exist"), l.clone().addScaledVector(m, p);
|
|
307
307
|
}
|
|
308
308
|
const D = I.length;
|
|
309
|
-
function
|
|
309
|
+
function Lt(l, m, p) {
|
|
310
310
|
let x, b, L;
|
|
311
|
-
const M = l.x -
|
|
311
|
+
const M = l.x - m.x, T = l.y - m.y, G = p.x - l.x, _ = p.y - l.y, H = M * M + T * T, nt = M * _ - T * G;
|
|
312
312
|
if (Math.abs(nt) > Number.EPSILON) {
|
|
313
|
-
const
|
|
313
|
+
const W = Math.sqrt(H), zt = Math.sqrt(
|
|
314
314
|
G * G + _ * _
|
|
315
|
-
), jt =
|
|
315
|
+
), jt = m.x - T / W, Ct = m.y + M / W, Qt = p.x - _ / zt, Kt = p.y + G / zt, It = ((Qt - jt) * _ - (Kt - Ct) * G) / (M * _ - T * G);
|
|
316
316
|
x = jt + M * It - l.x, b = Ct + T * It - l.y;
|
|
317
317
|
const Bt = x * x + b * b;
|
|
318
318
|
if (Bt <= 2)
|
|
319
319
|
return new z(x, b);
|
|
320
320
|
L = Math.sqrt(Bt / 2);
|
|
321
321
|
} else {
|
|
322
|
-
let
|
|
323
|
-
M > Number.EPSILON ? G > Number.EPSILON && (
|
|
322
|
+
let W = !1;
|
|
323
|
+
M > Number.EPSILON ? G > Number.EPSILON && (W = !0) : M < -Number.EPSILON ? G < -Number.EPSILON && (W = !0) : Math.sign(T) === Math.sign(_) && (W = !0), W ? (x = -T, b = M, L = Math.sqrt(H)) : (x = M, b = T, L = Math.sqrt(H / 2));
|
|
324
324
|
}
|
|
325
325
|
return new z(x / L, b / L);
|
|
326
326
|
}
|
|
327
|
-
const
|
|
328
|
-
for (let l = 0,
|
|
329
|
-
p ===
|
|
330
|
-
const
|
|
331
|
-
let
|
|
332
|
-
for (let l = 0,
|
|
327
|
+
const ut = [];
|
|
328
|
+
for (let l = 0, m = R.length, p = m - 1, x = l + 1; l < m; l++, p++, x++)
|
|
329
|
+
p === m && (p = 0), x === m && (x = 0), ut[l] = Lt(R[l], R[p], R[x]);
|
|
330
|
+
const xt = [];
|
|
331
|
+
let J, ft = ut.concat();
|
|
332
|
+
for (let l = 0, m = tt; l < m; l++) {
|
|
333
333
|
const p = B[l];
|
|
334
|
-
|
|
334
|
+
J = [];
|
|
335
335
|
for (let x = 0, b = p.length, L = b - 1, M = x + 1; x < b; x++, L++, M++)
|
|
336
|
-
L === b && (L = 0), M === b && (M = 0),
|
|
337
|
-
|
|
336
|
+
L === b && (L = 0), M === b && (M = 0), J[x] = Lt(p[x], p[L], p[M]);
|
|
337
|
+
xt.push(J), ft = ft.concat(J);
|
|
338
338
|
}
|
|
339
|
-
let
|
|
339
|
+
let et;
|
|
340
340
|
if (w === 0)
|
|
341
|
-
|
|
341
|
+
et = yt.triangulateShape(R, B);
|
|
342
342
|
else {
|
|
343
|
-
const l = [],
|
|
343
|
+
const l = [], m = [];
|
|
344
344
|
for (let p = 0; p < w; p++) {
|
|
345
345
|
const x = p / w, b = u * Math.cos(x * Math.PI / 2), L = y * Math.sin(x * Math.PI / 2) + A;
|
|
346
|
-
for (let M = 0, T =
|
|
347
|
-
const G =
|
|
348
|
-
|
|
346
|
+
for (let M = 0, T = R.length; M < T; M++) {
|
|
347
|
+
const G = k(R[M], ut[M], L);
|
|
348
|
+
F(G.x, G.y, -b), x === 0 && l.push(G);
|
|
349
349
|
}
|
|
350
|
-
for (let M = 0, T =
|
|
350
|
+
for (let M = 0, T = tt; M < T; M++) {
|
|
351
351
|
const G = B[M];
|
|
352
|
-
|
|
352
|
+
J = xt[M];
|
|
353
353
|
const _ = [];
|
|
354
|
-
for (let
|
|
355
|
-
const
|
|
356
|
-
|
|
354
|
+
for (let H = 0, nt = G.length; H < nt; H++) {
|
|
355
|
+
const W = k(G[H], J[H], L);
|
|
356
|
+
F(W.x, W.y, -b), x === 0 && _.push(W);
|
|
357
357
|
}
|
|
358
|
-
x === 0 &&
|
|
358
|
+
x === 0 && m.push(_);
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
|
-
|
|
361
|
+
et = yt.triangulateShape(
|
|
362
362
|
l,
|
|
363
|
-
|
|
363
|
+
m
|
|
364
364
|
);
|
|
365
365
|
}
|
|
366
|
-
const
|
|
366
|
+
const dt = et.length, Tt = y + A;
|
|
367
367
|
for (let l = 0; l < D; l++) {
|
|
368
|
-
const
|
|
369
|
-
N ? (
|
|
368
|
+
const m = g ? k(I[l], ft[l], Tt) : I[l];
|
|
369
|
+
N ? (ot.copy(C.normals[0]).multiplyScalar(m.x), $.copy(C.binormals[0]).multiplyScalar(m.y), V.copy(U[0]).add(ot).add($), F(V.x, V.y, V.z)) : F(m.x, m.y, 0);
|
|
370
370
|
}
|
|
371
371
|
for (let l = 1; l <= o; l++)
|
|
372
|
-
for (let
|
|
373
|
-
const p = g ?
|
|
374
|
-
N ? (
|
|
372
|
+
for (let m = 0; m < D; m++) {
|
|
373
|
+
const p = g ? k(I[m], ft[m], Tt) : I[m];
|
|
374
|
+
N ? (ot.copy(C.normals[l]).multiplyScalar(p.x), $.copy(C.binormals[l]).multiplyScalar(p.y), V.copy(U[l]).add(ot).add($), F(V.x, V.y, V.z)) : F(p.x, p.y, c / o * l);
|
|
375
375
|
}
|
|
376
376
|
for (let l = w - 1; l >= 0; l--) {
|
|
377
|
-
const
|
|
378
|
-
for (let b = 0, L =
|
|
379
|
-
const M =
|
|
380
|
-
|
|
377
|
+
const m = l / w, p = u * Math.cos(m * Math.PI / 2), x = y * Math.sin(m * Math.PI / 2) + A;
|
|
378
|
+
for (let b = 0, L = R.length; b < L; b++) {
|
|
379
|
+
const M = k(R[b], ut[b], x);
|
|
380
|
+
F(M.x, M.y, c + p);
|
|
381
381
|
}
|
|
382
382
|
for (let b = 0, L = B.length; b < L; b++) {
|
|
383
383
|
const M = B[b];
|
|
384
|
-
|
|
384
|
+
J = xt[b];
|
|
385
385
|
for (let T = 0, G = M.length; T < G; T++) {
|
|
386
|
-
const _ =
|
|
387
|
-
N ?
|
|
386
|
+
const _ = k(M[T], J[T], x);
|
|
387
|
+
N ? F(
|
|
388
388
|
_.x,
|
|
389
|
-
_.y +
|
|
390
|
-
|
|
391
|
-
) :
|
|
389
|
+
_.y + U[o - 1].y,
|
|
390
|
+
U[o - 1].x + p
|
|
391
|
+
) : F(_.x, _.y, c + p);
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
|
-
Zt(),
|
|
395
|
+
Zt(), O && $t();
|
|
396
396
|
function Zt() {
|
|
397
|
-
const l =
|
|
397
|
+
const l = s.length / 3;
|
|
398
398
|
if (g) {
|
|
399
|
-
let
|
|
399
|
+
let m = 0, p = D * m;
|
|
400
400
|
if (P)
|
|
401
|
-
for (let x = 0; x <
|
|
402
|
-
const b =
|
|
403
|
-
|
|
401
|
+
for (let x = 0; x < dt; x++) {
|
|
402
|
+
const b = et[x];
|
|
403
|
+
mt(b[2] + p, b[1] + p, b[0] + p);
|
|
404
404
|
}
|
|
405
|
-
if (
|
|
406
|
-
for (let x = 0; x <
|
|
407
|
-
const b =
|
|
408
|
-
|
|
405
|
+
if (m = o + w * 2, p = D * m, S)
|
|
406
|
+
for (let x = 0; x < dt; x++) {
|
|
407
|
+
const b = et[x];
|
|
408
|
+
mt(b[0] + p, b[1] + p, b[2] + p);
|
|
409
409
|
}
|
|
410
410
|
} else {
|
|
411
411
|
if (P)
|
|
412
|
-
for (let
|
|
413
|
-
const p =
|
|
414
|
-
|
|
412
|
+
for (let m = 0; m < dt; m++) {
|
|
413
|
+
const p = et[m];
|
|
414
|
+
mt(p[2], p[1], p[0]);
|
|
415
415
|
}
|
|
416
416
|
if (S)
|
|
417
|
-
for (let
|
|
418
|
-
const p =
|
|
419
|
-
|
|
417
|
+
for (let m = 0; m < dt; m++) {
|
|
418
|
+
const p = et[m];
|
|
419
|
+
mt(
|
|
420
420
|
p[0] + D * o,
|
|
421
421
|
p[1] + D * o,
|
|
422
422
|
p[2] + D * o
|
|
423
423
|
);
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
|
-
|
|
426
|
+
n.addGroup(l, s.length / 3 - l, 0);
|
|
427
427
|
}
|
|
428
428
|
function $t() {
|
|
429
|
-
const l =
|
|
430
|
-
let
|
|
431
|
-
Gt(
|
|
429
|
+
const l = s.length / 3;
|
|
430
|
+
let m = 0;
|
|
431
|
+
Gt(R, m), m += R.length;
|
|
432
432
|
for (let p = 0, x = B.length; p < x; p++) {
|
|
433
433
|
const b = B[p];
|
|
434
|
-
Gt(b,
|
|
434
|
+
Gt(b, m), m += b.length;
|
|
435
435
|
}
|
|
436
|
-
|
|
436
|
+
n.addGroup(l, s.length / 3 - l, 1);
|
|
437
437
|
}
|
|
438
|
-
function Gt(l,
|
|
438
|
+
function Gt(l, m) {
|
|
439
439
|
let p = l.length;
|
|
440
440
|
for (; --p >= 0; ) {
|
|
441
441
|
const x = p;
|
|
442
442
|
let b = p - 1;
|
|
443
443
|
b < 0 && (b = l.length - 1);
|
|
444
444
|
for (let L = 0, M = o + w * 2; L < M; L++) {
|
|
445
|
-
const T = D * L, G = D * (L + 1), _ =
|
|
446
|
-
Jt(_,
|
|
445
|
+
const T = D * L, G = D * (L + 1), _ = m + x + T, H = m + b + T, nt = m + b + G, W = m + x + G;
|
|
446
|
+
Jt(_, H, nt, W);
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
|
-
function
|
|
451
|
-
i.push(l), i.push(
|
|
450
|
+
function F(l, m, p) {
|
|
451
|
+
i.push(l), i.push(m), i.push(p);
|
|
452
452
|
}
|
|
453
|
-
function
|
|
454
|
-
|
|
455
|
-
const x =
|
|
456
|
-
s,
|
|
453
|
+
function mt(l, m, p) {
|
|
454
|
+
Y(l), Y(m), Y(p);
|
|
455
|
+
const x = s.length / 3, b = E.generateTopUV(
|
|
457
456
|
n,
|
|
457
|
+
s,
|
|
458
458
|
x - 3,
|
|
459
459
|
x - 2,
|
|
460
460
|
x - 1
|
|
461
461
|
);
|
|
462
|
-
|
|
462
|
+
Z(b[0]), Z(b[1]), Z(b[2]);
|
|
463
463
|
}
|
|
464
|
-
function Jt(l,
|
|
465
|
-
|
|
466
|
-
const b =
|
|
467
|
-
s,
|
|
464
|
+
function Jt(l, m, p, x) {
|
|
465
|
+
Y(l), Y(m), Y(x), Y(m), Y(p), Y(x);
|
|
466
|
+
const b = s.length / 3, L = E.generateSideWallUV(
|
|
468
467
|
n,
|
|
468
|
+
s,
|
|
469
469
|
b - 6,
|
|
470
470
|
b - 3,
|
|
471
471
|
b - 2,
|
|
472
472
|
b - 1
|
|
473
473
|
);
|
|
474
|
-
|
|
475
|
-
}
|
|
476
|
-
function F(l) {
|
|
477
|
-
n.push(i[l * 3 + 0]), n.push(i[l * 3 + 1]), n.push(i[l * 3 + 2]);
|
|
474
|
+
Z(L[0]), Z(L[1]), Z(L[3]), Z(L[1]), Z(L[2]), Z(L[3]);
|
|
478
475
|
}
|
|
479
476
|
function Y(l) {
|
|
477
|
+
s.push(i[l * 3 + 0]), s.push(i[l * 3 + 1]), s.push(i[l * 3 + 2]);
|
|
478
|
+
}
|
|
479
|
+
function Z(l) {
|
|
480
480
|
r.push(l.x), r.push(l.y);
|
|
481
481
|
}
|
|
482
482
|
}
|
|
@@ -485,8 +485,8 @@ class ot extends ft {
|
|
|
485
485
|
return super.copy(t), this.parameters = Object.assign({}, t.parameters), this;
|
|
486
486
|
}
|
|
487
487
|
toJSON() {
|
|
488
|
-
const t = super.toJSON(), e = this.parameters.shapes,
|
|
489
|
-
return
|
|
488
|
+
const t = super.toJSON(), e = this.parameters.shapes, n = this.parameters.options;
|
|
489
|
+
return We(e, n, t);
|
|
490
490
|
}
|
|
491
491
|
/**
|
|
492
492
|
* Factory method for creating an instance of this class from the given
|
|
@@ -497,28 +497,28 @@ class ot extends ft {
|
|
|
497
497
|
* @return {ExtrudeGeometry} A new instance.
|
|
498
498
|
*/
|
|
499
499
|
static fromJSON(t, e) {
|
|
500
|
-
const
|
|
500
|
+
const n = [];
|
|
501
501
|
for (let r = 0, a = t.shapes.length; r < a; r++) {
|
|
502
502
|
const f = e[t.shapes[r]];
|
|
503
|
-
|
|
503
|
+
n.push(f);
|
|
504
504
|
}
|
|
505
|
-
const
|
|
506
|
-
return
|
|
507
|
-
|
|
508
|
-
)), new
|
|
505
|
+
const s = t.options.extrudePath;
|
|
506
|
+
return s !== void 0 && (t.options.extrudePath = new De[s.type]().fromJSON(
|
|
507
|
+
s
|
|
508
|
+
)), new st(n, t.options);
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
|
-
const
|
|
512
|
-
generateTopUV: function(
|
|
513
|
-
const r = t[e * 3], a = t[e * 3 + 1], f = t[
|
|
511
|
+
const He = {
|
|
512
|
+
generateTopUV: function(d, t, e, n, s) {
|
|
513
|
+
const r = t[e * 3], a = t[e * 3 + 1], f = t[n * 3], i = t[n * 3 + 1], h = t[s * 3], o = t[s * 3 + 1];
|
|
514
514
|
return [
|
|
515
515
|
new z(r, a),
|
|
516
516
|
new z(f, i),
|
|
517
517
|
new z(h, o)
|
|
518
518
|
];
|
|
519
519
|
},
|
|
520
|
-
generateSideWallUV: function(
|
|
521
|
-
const a = t[e * 3], f = t[e * 3 + 1], i = t[e * 3 + 2], h = t[
|
|
520
|
+
generateSideWallUV: function(d, t, e, n, s, r) {
|
|
521
|
+
const a = t[e * 3], f = t[e * 3 + 1], i = t[e * 3 + 2], h = t[n * 3], o = t[n * 3 + 1], c = t[n * 3 + 2], g = t[s * 3], u = t[s * 3 + 1], y = t[s * 3 + 2], A = t[r * 3], w = t[r * 3 + 1], v = t[r * 3 + 2];
|
|
522
522
|
return Math.abs(f - o) < Math.abs(a - h) ? [
|
|
523
523
|
new z(a, 1 - i),
|
|
524
524
|
new z(h, 1 - c),
|
|
@@ -532,37 +532,37 @@ const Xe = {
|
|
|
532
532
|
];
|
|
533
533
|
}
|
|
534
534
|
};
|
|
535
|
-
function
|
|
536
|
-
if (e.shapes = [], Array.isArray(
|
|
537
|
-
for (let
|
|
538
|
-
const r =
|
|
535
|
+
function We(d, t, e) {
|
|
536
|
+
if (e.shapes = [], Array.isArray(d))
|
|
537
|
+
for (let n = 0, s = d.length; n < s; n++) {
|
|
538
|
+
const r = d[n];
|
|
539
539
|
e.shapes.push(r.uuid);
|
|
540
540
|
}
|
|
541
541
|
else
|
|
542
|
-
e.shapes.push(
|
|
542
|
+
e.shapes.push(d.uuid);
|
|
543
543
|
return e.options = Object.assign({}, t), t.extrudePath !== void 0 && (e.options.extrudePath = t.extrudePath.toJSON()), e;
|
|
544
544
|
}
|
|
545
|
-
class
|
|
545
|
+
class Xe extends st {
|
|
546
546
|
constructor(t, e) {
|
|
547
547
|
super(t, e);
|
|
548
|
-
const
|
|
549
|
-
new
|
|
548
|
+
const n = new Ht(
|
|
549
|
+
new st(t, gt(X({}, e), {
|
|
550
550
|
hasTop: !0,
|
|
551
551
|
hasSide: !0,
|
|
552
552
|
hasBottom: !1
|
|
553
553
|
}))
|
|
554
554
|
);
|
|
555
|
-
|
|
556
|
-
const
|
|
557
|
-
|
|
555
|
+
n.updateMatrixWorld();
|
|
556
|
+
const s = new xe().setFromObject(n), r = new j();
|
|
557
|
+
s.getSize(r);
|
|
558
558
|
const a = new j(
|
|
559
|
-
|
|
560
|
-
|
|
559
|
+
s.min.x + r.x / 2,
|
|
560
|
+
s.min.y + r.y / 2,
|
|
561
561
|
0
|
|
562
562
|
);
|
|
563
563
|
let f = e.topSegments, i = e.box3;
|
|
564
564
|
if (i) {
|
|
565
|
-
i = i.union(
|
|
565
|
+
i = i.union(s);
|
|
566
566
|
const v = new j();
|
|
567
567
|
i.getSize(v);
|
|
568
568
|
const E = Math.max(
|
|
@@ -578,9 +578,9 @@ class We extends ot {
|
|
|
578
578
|
r.y,
|
|
579
579
|
f,
|
|
580
580
|
f
|
|
581
|
-
), o = new
|
|
581
|
+
), o = new Ht(h);
|
|
582
582
|
o.position.set(a.x, a.y, a.z), o.updateMatrixWorld();
|
|
583
|
-
const g = new Ie().evaluate(o,
|
|
583
|
+
const g = new Ie().evaluate(o, n, Be), u = g.geometry.getAttribute("position"), y = new rt(
|
|
584
584
|
u.count * 2,
|
|
585
585
|
2
|
|
586
586
|
);
|
|
@@ -591,36 +591,36 @@ class We extends ot {
|
|
|
591
591
|
if (i) {
|
|
592
592
|
const v = i.min, E = i.max, S = new j().subVectors(E, v);
|
|
593
593
|
for (let P = 0; P < u.count; P++) {
|
|
594
|
-
const
|
|
594
|
+
const O = u.getX(P), U = u.getY(P), N = (O - v.x) / S.x, C = (U - v.y) / S.y;
|
|
595
595
|
y.setXY(P, N, C);
|
|
596
596
|
}
|
|
597
597
|
g.geometry.setAttribute("uv", y);
|
|
598
598
|
}
|
|
599
599
|
u.needsUpdate = !0;
|
|
600
|
-
const A = new
|
|
600
|
+
const A = new st(t, gt(X({}, e), {
|
|
601
601
|
hasTop: !1
|
|
602
|
-
})), w =
|
|
602
|
+
})), w = q([g.geometry, A], 2);
|
|
603
603
|
this.copy(w.toNonIndexed());
|
|
604
604
|
}
|
|
605
605
|
}
|
|
606
|
-
const
|
|
606
|
+
const Xt = (d) => {
|
|
607
607
|
const {
|
|
608
608
|
split: t,
|
|
609
609
|
depth: e,
|
|
610
|
-
points:
|
|
611
|
-
box3:
|
|
610
|
+
points: n,
|
|
611
|
+
box3: s,
|
|
612
612
|
hasTop: r,
|
|
613
613
|
hasBottom: a,
|
|
614
614
|
hasSide: f,
|
|
615
615
|
sideRepeat: i,
|
|
616
616
|
topSegments: h
|
|
617
|
-
} =
|
|
617
|
+
} = d, o = h ? Xe : st, c = new o(new Mt(n), {
|
|
618
618
|
depth: e,
|
|
619
619
|
bevelEnabled: !1,
|
|
620
|
-
box3:
|
|
620
|
+
box3: s,
|
|
621
621
|
UVGenerator: je({
|
|
622
622
|
split: t,
|
|
623
|
-
box3:
|
|
623
|
+
box3: s,
|
|
624
624
|
sideRepeat: i
|
|
625
625
|
}),
|
|
626
626
|
hasTop: r,
|
|
@@ -630,19 +630,19 @@ const Wt = (m) => {
|
|
|
630
630
|
});
|
|
631
631
|
return Ce(), c;
|
|
632
632
|
};
|
|
633
|
-
class
|
|
633
|
+
class sn extends K {
|
|
634
634
|
constructor(t) {
|
|
635
|
-
super(), this.options =
|
|
635
|
+
super(), this.options = X({
|
|
636
636
|
depth: 1
|
|
637
637
|
}, t);
|
|
638
638
|
}
|
|
639
639
|
create() {
|
|
640
|
-
return
|
|
640
|
+
return ct(this, null, function* () {
|
|
641
641
|
const {
|
|
642
642
|
points: t,
|
|
643
643
|
pointsArr: e,
|
|
644
|
-
useGroups:
|
|
645
|
-
depth:
|
|
644
|
+
useGroups: n,
|
|
645
|
+
depth: s,
|
|
646
646
|
geometry: r,
|
|
647
647
|
geometryArr: a,
|
|
648
648
|
material: f,
|
|
@@ -651,9 +651,9 @@ class ns extends tt {
|
|
|
651
651
|
hasTop: o,
|
|
652
652
|
hasBottom: c,
|
|
653
653
|
hasSide: g
|
|
654
|
-
} = this.options, u = Array.isArray(
|
|
654
|
+
} = this.options, u = Array.isArray(s) ? s : [s], y = Array.isArray(i) ? i : [i], A = f;
|
|
655
655
|
let w = r;
|
|
656
|
-
A || console.log("material is null"), !w && t ? w =
|
|
656
|
+
A || console.log("material is null"), !w && t ? w = Xt({
|
|
657
657
|
points: t,
|
|
658
658
|
depth: u[0],
|
|
659
659
|
box3: y[0],
|
|
@@ -661,11 +661,11 @@ class ns extends tt {
|
|
|
661
661
|
hasTop: o,
|
|
662
662
|
hasBottom: c,
|
|
663
663
|
hasSide: g
|
|
664
|
-
}) : !w && e ? w =
|
|
664
|
+
}) : !w && e ? w = q(
|
|
665
665
|
e.map(
|
|
666
666
|
(v, E) => {
|
|
667
667
|
var S, P;
|
|
668
|
-
return
|
|
668
|
+
return Xt({
|
|
669
669
|
points: v,
|
|
670
670
|
depth: (S = u[E]) != null ? S : u[0],
|
|
671
671
|
box3: (P = y[E]) != null ? P : y[0],
|
|
@@ -676,29 +676,29 @@ class ns extends tt {
|
|
|
676
676
|
});
|
|
677
677
|
}
|
|
678
678
|
),
|
|
679
|
-
|
|
680
|
-
) : !w && a && a.length > 1 ? w =
|
|
679
|
+
n != null ? n : 0
|
|
680
|
+
) : !w && a && a.length > 1 ? w = q(a, n != null ? n : 0) : !w && a && a.length === 1 && ([w] = a), this.createMesh(w, A);
|
|
681
681
|
});
|
|
682
682
|
}
|
|
683
683
|
addGeometries(t) {
|
|
684
|
-
const e = this.object3d,
|
|
685
|
-
e.geometry =
|
|
684
|
+
const e = this.object3d, n = q([e.geometry, ...t]);
|
|
685
|
+
e.geometry = n;
|
|
686
686
|
}
|
|
687
687
|
setTextureAnisotropic(t, e) {
|
|
688
688
|
t.anisotropy = e || this.pencil.renderer.capabilities.getMaxAnisotropy();
|
|
689
689
|
}
|
|
690
690
|
}
|
|
691
|
-
const
|
|
691
|
+
const on = (d) => {
|
|
692
692
|
const {
|
|
693
693
|
topColor: t,
|
|
694
694
|
sideColor: e,
|
|
695
|
-
sideMap:
|
|
696
|
-
createCanvasObjectURL:
|
|
695
|
+
sideMap: n,
|
|
696
|
+
createCanvasObjectURL: s,
|
|
697
697
|
split: r,
|
|
698
698
|
maxAnisotropy: a
|
|
699
|
-
} =
|
|
699
|
+
} = d;
|
|
700
700
|
return new Promise((f) => {
|
|
701
|
-
const i =
|
|
701
|
+
const i = n ? document.createElement("img") : {
|
|
702
702
|
src: "",
|
|
703
703
|
onload: () => {
|
|
704
704
|
},
|
|
@@ -707,15 +707,15 @@ const os = (m) => {
|
|
|
707
707
|
};
|
|
708
708
|
i.onload = () => {
|
|
709
709
|
const h = r, o = document.createElement("canvas"), c = o.getContext("2d");
|
|
710
|
-
o.height = i.height / (1 - h), o.width = i.width, h && t && (c.fillStyle = t, c.fillRect(0, 0, i.width, o.height * h)),
|
|
710
|
+
o.height = i.height / (1 - h), o.width = i.width, h && t && (c.fillStyle = t, c.fillRect(0, 0, i.width, o.height * h)), n && i instanceof HTMLImageElement ? c.drawImage(i, 0, o.height * h, i.width, i.height) : e && (c.fillStyle = e, c.fillRect(0, o.height * h, i.width, i.height)), s && o.toBlob((u) => {
|
|
711
711
|
console.log(URL.createObjectURL(u));
|
|
712
712
|
});
|
|
713
713
|
const g = new ve(o);
|
|
714
714
|
f(g);
|
|
715
|
-
},
|
|
715
|
+
}, n ? i.src = n : i instanceof HTMLImageElement || i.onload();
|
|
716
716
|
});
|
|
717
717
|
};
|
|
718
|
-
class
|
|
718
|
+
class rn extends K {
|
|
719
719
|
create() {
|
|
720
720
|
this.createGroup();
|
|
721
721
|
}
|
|
@@ -727,12 +727,12 @@ class is extends tt {
|
|
|
727
727
|
);
|
|
728
728
|
}
|
|
729
729
|
}
|
|
730
|
-
class
|
|
730
|
+
class an extends K {
|
|
731
731
|
constructor(t) {
|
|
732
732
|
super(), this.rectAreaLightUniformsLibInit = !1, this.options = t;
|
|
733
733
|
}
|
|
734
734
|
create() {
|
|
735
|
-
var e,
|
|
735
|
+
var e, n, s, r, a, f, i, h, o, c, g, u, y, A, w, v, E;
|
|
736
736
|
const t = this.options;
|
|
737
737
|
if (t.type === "AmbientLight") {
|
|
738
738
|
const S = new Se(t.color);
|
|
@@ -743,8 +743,8 @@ class rs extends tt {
|
|
|
743
743
|
} else if (t.type === "PointLight") {
|
|
744
744
|
const S = new Ae(
|
|
745
745
|
(e = t.color) != null ? e : 16777215,
|
|
746
|
-
(
|
|
747
|
-
(
|
|
746
|
+
(n = t.intensity) != null ? n : 1,
|
|
747
|
+
(s = t.distance) != null ? s : 0,
|
|
748
748
|
(r = t.decay) != null ? r : 2
|
|
749
749
|
);
|
|
750
750
|
S.name = "点光源", this.object3d = S, this.pointLight = S;
|
|
@@ -781,8 +781,8 @@ class rs extends tt {
|
|
|
781
781
|
t.target && this.pencil.scene.add(t.target);
|
|
782
782
|
const e = this.pencil.cameraTarget;
|
|
783
783
|
if (this.spotLight || this.directionalLight) {
|
|
784
|
-
const
|
|
785
|
-
|
|
784
|
+
const n = this.spotLight || this.directionalLight;
|
|
785
|
+
n.position.copy(e), n.target.position.copy(e);
|
|
786
786
|
} else this.pointLight && this.pointLight.position.copy(e);
|
|
787
787
|
}
|
|
788
788
|
dispose() {
|
|
@@ -790,15 +790,15 @@ class rs extends tt {
|
|
|
790
790
|
t.target && this.pencil.scene.remove(t.target), super.dispose();
|
|
791
791
|
}
|
|
792
792
|
}
|
|
793
|
-
class Ve extends
|
|
794
|
-
constructor(t = [], e = "none",
|
|
795
|
-
super(), this.type = "MeshLineGeometry", this.pointCount = 0, this._points = [], this.shape = "none", this.shapeFunction = (
|
|
793
|
+
class Ve extends lt {
|
|
794
|
+
constructor(t = [], e = "none", n) {
|
|
795
|
+
super(), this.type = "MeshLineGeometry", this.pointCount = 0, this._points = [], this.shape = "none", this.shapeFunction = (s) => 1, this.matrixWorld = new qt(), this.shape = e, n && (this.shapeFunction = n), t.length > 0 && this.setPoints(t);
|
|
796
796
|
}
|
|
797
797
|
convertToVector3Array(t) {
|
|
798
798
|
if (typeof t[0] == "number") {
|
|
799
|
-
const e = [],
|
|
800
|
-
for (let
|
|
801
|
-
e.push(new j(s
|
|
799
|
+
const e = [], n = t;
|
|
800
|
+
for (let s = 0; s < n.length; s += 3)
|
|
801
|
+
e.push(new j(n[s], n[s + 1], n[s + 2]));
|
|
802
802
|
return e;
|
|
803
803
|
} else
|
|
804
804
|
return t.map((e) => {
|
|
@@ -819,22 +819,22 @@ class Ve extends ft {
|
|
|
819
819
|
!t || t.length === 0 || (this._points = this.convertToVector3Array(t), this.pointCount = this._points.length, e && (this.shapeFunction = e, this.shape = "custom"), this.initializeGeometry(), this.updateGeometry());
|
|
820
820
|
}
|
|
821
821
|
initializeGeometry() {
|
|
822
|
-
const t = new
|
|
822
|
+
const t = new Q(
|
|
823
823
|
new Float32Array(this.pointCount * 6),
|
|
824
824
|
3
|
|
825
|
-
), e = new
|
|
825
|
+
), e = new Q(
|
|
826
826
|
new Float32Array(this.pointCount * 6),
|
|
827
827
|
3
|
|
828
|
-
),
|
|
828
|
+
), n = new Q(new Float32Array(this.pointCount * 6), 3), s = new Q(
|
|
829
829
|
new Float32Array(this.pointCount * 2),
|
|
830
830
|
1
|
|
831
|
-
), r = new
|
|
831
|
+
), r = new Q(new Float32Array(this.pointCount * 2), 1), a = new Q(new Float32Array(this.pointCount * 2), 1), f = new Q(new Float32Array(this.pointCount * 4), 2), i = new Q(
|
|
832
832
|
new Uint16Array((this.pointCount - 1) * 6),
|
|
833
833
|
1
|
|
834
834
|
);
|
|
835
835
|
this.shape === "taper" && (this.shapeFunction = (h) => 1 * Math.pow(4 * h * (1 - h), 1));
|
|
836
836
|
for (let h = 0, o = 0, c = 0; h < this.pointCount; h += 1, o += 2, c += 6) {
|
|
837
|
-
|
|
837
|
+
s.setX(o, h / this.pointCount), s.setX(o + 1, h / this.pointCount), r.setX(o, 1), r.setX(o + 1, -1);
|
|
838
838
|
const g = this.shape === "none" ? 1 : this.shapeFunction(h / (this.pointCount - 1));
|
|
839
839
|
a.setX(o, g), a.setX(o + 1, g);
|
|
840
840
|
const u = h / (this.pointCount - 1);
|
|
@@ -843,20 +843,20 @@ class Ve extends ft {
|
|
|
843
843
|
i.setX(c + 0, y + 0), i.setX(c + 1, y + 1), i.setX(c + 2, y + 2), i.setX(c + 3, y + 2), i.setX(c + 4, y + 1), i.setX(c + 5, y + 3);
|
|
844
844
|
}
|
|
845
845
|
}
|
|
846
|
-
this.setAttribute("position", t), this.setAttribute("previous", e), this.setAttribute("next",
|
|
846
|
+
this.setAttribute("position", t), this.setAttribute("previous", e), this.setAttribute("next", n), this.setAttribute("counters", s), this.setAttribute("side", r), this.setAttribute("width", a), this.setAttribute("uv", f), this.setIndex(i);
|
|
847
847
|
}
|
|
848
848
|
updateGeometry() {
|
|
849
849
|
if (!this._points[0]) return;
|
|
850
|
-
const t = this.getAttribute("position"), e = this.getAttribute("previous"),
|
|
851
|
-
let
|
|
850
|
+
const t = this.getAttribute("position"), e = this.getAttribute("previous"), n = this.getAttribute("next");
|
|
851
|
+
let s = 0, r = 0, a = 0;
|
|
852
852
|
const f = this._points[0];
|
|
853
853
|
e.setXYZ(r, f.x, f.y, f.z), r += 1, e.setXYZ(r, f.x, f.y, f.z), r += 1;
|
|
854
854
|
for (let h = 0; h < this.pointCount; h++) {
|
|
855
855
|
const o = this._points[h];
|
|
856
|
-
t.setXYZ(
|
|
856
|
+
t.setXYZ(s, o.x, o.y, o.z), s += 1, t.setXYZ(s, o.x, o.y, o.z), s += 1, h < this.pointCount - 1 && (e.setXYZ(r, o.x, o.y, o.z), r += 1, e.setXYZ(r, o.x, o.y, o.z), r += 1), h > 0 && h + 1 <= this.pointCount && (n.setXYZ(a, o.x, o.y, o.z), a += 1, n.setXYZ(a, o.x, o.y, o.z), a += 1);
|
|
857
857
|
}
|
|
858
858
|
const i = this._points[this.pointCount - 1];
|
|
859
|
-
|
|
859
|
+
n.setXYZ(a, i.x, i.y, i.z), a += 1, n.setXYZ(a, i.x, i.y, i.z), a += 1, t.needsUpdate = !0, e.needsUpdate = !0, n.needsUpdate = !0, this.computeBoundingSphere(), this.computeBoundingBox();
|
|
860
860
|
}
|
|
861
861
|
get points() {
|
|
862
862
|
return this._points;
|
|
@@ -865,39 +865,39 @@ class Ve extends ft {
|
|
|
865
865
|
this.setPoints(t);
|
|
866
866
|
}
|
|
867
867
|
updatePoints(t, e) {
|
|
868
|
-
const
|
|
869
|
-
if (
|
|
868
|
+
const n = this.convertToVector3Array(t);
|
|
869
|
+
if (n.length !== this.pointCount) {
|
|
870
870
|
console.warn(
|
|
871
871
|
"MeshLineGeometry: Cannot update points with different length. Use setPoints() instead."
|
|
872
872
|
);
|
|
873
873
|
return;
|
|
874
874
|
}
|
|
875
|
-
this._points =
|
|
875
|
+
this._points = n, e && (this.shapeFunction = e, this.shape = "custom", this.initializeGeometry()), this.updateGeometry();
|
|
876
876
|
}
|
|
877
877
|
setShape(t, e) {
|
|
878
878
|
this.shape = t, e && (this.shapeFunction = e), this._points.length > 0 && (this.initializeGeometry(), this.updateGeometry());
|
|
879
879
|
}
|
|
880
880
|
}
|
|
881
|
-
function
|
|
882
|
-
const e = new qt(),
|
|
883
|
-
if (
|
|
884
|
-
e.copy(this.matrixWorld).invert(),
|
|
881
|
+
function cn(d, t) {
|
|
882
|
+
const e = new qt(), n = new Ee(), s = new _e(), r = new j(), a = this.geometry;
|
|
883
|
+
if (s.copy(a.boundingSphere), s.applyMatrix4(this.matrixWorld), !d.ray.intersectSphere(s, r)) return;
|
|
884
|
+
e.copy(this.matrixWorld).invert(), n.copy(d.ray).applyMatrix4(e);
|
|
885
885
|
const f = new j(), i = new j(), h = new j(), o = this instanceof Ft ? 2 : 1, c = a.index, g = a.attributes;
|
|
886
886
|
if (c !== null) {
|
|
887
887
|
const u = c.array, y = g.position.array, A = g.width.array;
|
|
888
888
|
for (let w = 0, v = u.length - 1; w < v; w += o) {
|
|
889
889
|
const E = u[w], S = u[w + 1];
|
|
890
890
|
f.fromArray(y, E * 3), i.fromArray(y, S * 3);
|
|
891
|
-
const P = A[Math.floor(w / 3)] !== void 0 ? A[Math.floor(w / 3)] : 1,
|
|
892
|
-
if (
|
|
891
|
+
const P = A[Math.floor(w / 3)] !== void 0 ? A[Math.floor(w / 3)] : 1, O = d.params.Line.threshold + this.material.lineWidth * P / 2, U = O * O;
|
|
892
|
+
if (n.distanceSqToSegment(
|
|
893
893
|
f,
|
|
894
894
|
i,
|
|
895
895
|
r,
|
|
896
896
|
h
|
|
897
|
-
) >
|
|
897
|
+
) > U) continue;
|
|
898
898
|
r.applyMatrix4(this.matrixWorld);
|
|
899
|
-
const C =
|
|
900
|
-
C <
|
|
899
|
+
const C = d.ray.origin.distanceTo(r);
|
|
900
|
+
C < d.near || C > d.far || (t.push({
|
|
901
901
|
distance: C,
|
|
902
902
|
// What do we want? intersection point on the ray or on the segment??
|
|
903
903
|
// point: raycaster.ray.at( distance ),
|
|
@@ -910,93 +910,93 @@ function as(m, t) {
|
|
|
910
910
|
}
|
|
911
911
|
}
|
|
912
912
|
}
|
|
913
|
-
const
|
|
914
|
-
const { setPointWidth: t, nodes: e } =
|
|
915
|
-
return
|
|
916
|
-
}, Vt = /* @__PURE__ */ new WeakMap(),
|
|
917
|
-
let
|
|
913
|
+
const St = (d) => {
|
|
914
|
+
const { setPointWidth: t, nodes: e } = d, n = new Ve();
|
|
915
|
+
return n.setPoints(e, t), n;
|
|
916
|
+
}, Vt = /* @__PURE__ */ new WeakMap(), bt = /* @__PURE__ */ new Map();
|
|
917
|
+
let ln = class extends K {
|
|
918
918
|
constructor(t = {}) {
|
|
919
|
-
super(), this.options =
|
|
919
|
+
super(), this.options = X({}, t);
|
|
920
920
|
}
|
|
921
921
|
get material() {
|
|
922
922
|
var t;
|
|
923
923
|
return (t = this.object3d) == null ? void 0 : t.material;
|
|
924
924
|
}
|
|
925
925
|
create() {
|
|
926
|
-
return
|
|
926
|
+
return ct(this, null, function* () {
|
|
927
927
|
const {
|
|
928
928
|
nodes: t,
|
|
929
929
|
nodesArr: e,
|
|
930
|
-
geometry:
|
|
931
|
-
geometryArr:
|
|
930
|
+
geometry: n,
|
|
931
|
+
geometryArr: s,
|
|
932
932
|
material: r,
|
|
933
933
|
useGroups: a,
|
|
934
934
|
setPointWidth: f,
|
|
935
935
|
lineWidthArr: i,
|
|
936
936
|
materialParameters: h
|
|
937
937
|
} = this.options;
|
|
938
|
-
let o = r, c =
|
|
939
|
-
!o && h && (o = this.getMaterial(h)), !c && t ? c =
|
|
938
|
+
let o = r, c = n;
|
|
939
|
+
!o && h && (o = this.getMaterial(h)), !c && t ? c = St({
|
|
940
940
|
nodes: t,
|
|
941
941
|
setPointWidth: f
|
|
942
|
-
}) : !c && e ? c =
|
|
942
|
+
}) : !c && e ? c = q(
|
|
943
943
|
e.map((g, u) => {
|
|
944
944
|
let y = f;
|
|
945
945
|
return !y && i && (y = () => {
|
|
946
946
|
var A;
|
|
947
947
|
return (A = i[u]) != null ? A : i[0];
|
|
948
|
-
}),
|
|
948
|
+
}), St({
|
|
949
949
|
nodes: g,
|
|
950
950
|
setPointWidth: y
|
|
951
951
|
});
|
|
952
952
|
}),
|
|
953
953
|
a != null ? a : 0
|
|
954
|
-
) : !c &&
|
|
954
|
+
) : !c && s && s.length > 1 ? c = q(s, a != null ? a : 0) : !c && s && s.length === 1 && ([c] = s), this.createMesh(c, o);
|
|
955
955
|
});
|
|
956
956
|
}
|
|
957
957
|
setGeometry(t, e) {
|
|
958
|
-
const
|
|
958
|
+
const n = St({
|
|
959
959
|
nodes: t,
|
|
960
960
|
setPointWidth: e
|
|
961
|
-
}),
|
|
962
|
-
|
|
961
|
+
}), s = this.object3d, r = s.geometry;
|
|
962
|
+
s.geometry = n, r.dispose();
|
|
963
963
|
}
|
|
964
964
|
getMaterial(t) {
|
|
965
|
-
const { width: e, height:
|
|
965
|
+
const { width: e, height: n } = this.pencil.getSize(), s = new re(X({
|
|
966
966
|
color: new Yt("#ffffff")
|
|
967
967
|
}, t));
|
|
968
|
-
return
|
|
968
|
+
return s.uniforms.resolution.value.set(e, n), s;
|
|
969
969
|
}
|
|
970
970
|
addGeometries(t) {
|
|
971
|
-
const e = this.object3d,
|
|
972
|
-
e.geometry =
|
|
971
|
+
const e = this.object3d, n = q([e.geometry, ...t]);
|
|
972
|
+
e.geometry = n;
|
|
973
973
|
}
|
|
974
974
|
resize(t, e) {
|
|
975
|
-
var
|
|
976
|
-
(
|
|
975
|
+
var n, s;
|
|
976
|
+
(s = (n = this.material) == null ? void 0 : n.uniforms) == null || s.resolution.value.set(t, e);
|
|
977
977
|
}
|
|
978
978
|
handleMaterialChange(t) {
|
|
979
979
|
if (t) {
|
|
980
|
-
const { width: e, height:
|
|
981
|
-
this.resize(e,
|
|
980
|
+
const { width: e, height: n } = this.pencil.getSize();
|
|
981
|
+
this.resize(e, n);
|
|
982
982
|
}
|
|
983
983
|
}
|
|
984
984
|
animate({
|
|
985
985
|
duration: t = 1e3,
|
|
986
986
|
delay: e = 0,
|
|
987
|
-
repeat:
|
|
988
|
-
lineLoop:
|
|
987
|
+
repeat: n = 0,
|
|
988
|
+
lineLoop: s,
|
|
989
989
|
onRepeat: r,
|
|
990
990
|
onUpdate: a,
|
|
991
991
|
onComplete: f,
|
|
992
992
|
startShow: i
|
|
993
993
|
} = {}) {
|
|
994
|
-
const { offset: h, offsetLoop: o } = this.material.uniforms, c = this.pencil.userData.debugLine ?
|
|
994
|
+
const { offset: h, offsetLoop: o } = this.material.uniforms, c = this.pencil.userData.debugLine ? bt : Vt;
|
|
995
995
|
if (c.get(this.material) && this.stopAnimation(), t === 0) return;
|
|
996
|
-
const g =
|
|
996
|
+
const g = s != null ? s : !0;
|
|
997
997
|
h.value.x = 1, o.value = g && i ? 1 : 0;
|
|
998
998
|
let u = 0;
|
|
999
|
-
const y = new
|
|
999
|
+
const y = new it.Tween(h.value).to({ x: -1 }, t).delay(e).repeat(n).onUpdate(({ x: A }) => {
|
|
1000
1000
|
g && A <= 0 && o.value === 0 && (o.value = 1), a == null || a(A);
|
|
1001
1001
|
}).onRepeat(() => {
|
|
1002
1002
|
u += 1, r == null || r(u);
|
|
@@ -1005,36 +1005,36 @@ let cs = class extends tt {
|
|
|
1005
1005
|
}).start();
|
|
1006
1006
|
c.set(this.material, y), this.material.addEventListener("dispose", () => {
|
|
1007
1007
|
this.stopAnimation();
|
|
1008
|
-
}), this.pencil.userData.debugLine && console.log("animate",
|
|
1008
|
+
}), this.pencil.userData.debugLine && console.log("animate", bt.size);
|
|
1009
1009
|
}
|
|
1010
1010
|
stopAnimation() {
|
|
1011
|
-
const t = this.pencil.userData.debugLine ?
|
|
1012
|
-
e && (e.stop(),
|
|
1011
|
+
const t = this.pencil.userData.debugLine ? bt : Vt, e = t.get(this.material);
|
|
1012
|
+
e && (e.stop(), it.remove(e), t.delete(this.material), this.material.uniforms.offset.value.x = 0, this.material.uniforms.offsetLoop.value = 1), this.pencil.userData.debugLine && console.log("stopAnimation", bt.size);
|
|
1013
1013
|
}
|
|
1014
1014
|
render() {
|
|
1015
1015
|
const { width: t, height: e } = this.pencil.getSize();
|
|
1016
1016
|
this.resize(t, e);
|
|
1017
1017
|
}
|
|
1018
1018
|
};
|
|
1019
|
-
const Nt = (
|
|
1020
|
-
const { points: t } =
|
|
1021
|
-
return new
|
|
1019
|
+
const Nt = (d) => {
|
|
1020
|
+
const { points: t } = d, e = t.reduce((s, r, a) => (a < t.length - 1 && s.push(r, t[a + 1]), s), []);
|
|
1021
|
+
return new lt().setFromPoints(e);
|
|
1022
1022
|
};
|
|
1023
|
-
class
|
|
1023
|
+
class un extends K {
|
|
1024
1024
|
constructor(t = {}) {
|
|
1025
|
-
super(), this.options =
|
|
1025
|
+
super(), this.options = X({}, t);
|
|
1026
1026
|
}
|
|
1027
1027
|
get material() {
|
|
1028
1028
|
var t;
|
|
1029
1029
|
return (t = this.object3d) == null ? void 0 : t.material;
|
|
1030
1030
|
}
|
|
1031
1031
|
create() {
|
|
1032
|
-
return
|
|
1032
|
+
return ct(this, null, function* () {
|
|
1033
1033
|
const {
|
|
1034
1034
|
points: t,
|
|
1035
1035
|
pointsArr: e,
|
|
1036
|
-
geometry:
|
|
1037
|
-
geometryArr:
|
|
1036
|
+
geometry: n,
|
|
1037
|
+
geometryArr: s,
|
|
1038
1038
|
material: r,
|
|
1039
1039
|
useGroups: a,
|
|
1040
1040
|
setPointWidth: f,
|
|
@@ -1042,15 +1042,15 @@ class hs extends tt {
|
|
|
1042
1042
|
materialParameters: h,
|
|
1043
1043
|
instanceCount: o
|
|
1044
1044
|
} = this.options;
|
|
1045
|
-
let c = r, g =
|
|
1045
|
+
let c = r, g = n;
|
|
1046
1046
|
!c && h && (c = this.getMaterial(h)), !g && t ? g = Nt({
|
|
1047
1047
|
points: t
|
|
1048
|
-
}) : !g && e ? g =
|
|
1048
|
+
}) : !g && e ? g = q(
|
|
1049
1049
|
e.map((y) => Nt({
|
|
1050
1050
|
points: y
|
|
1051
1051
|
})),
|
|
1052
1052
|
a != null ? a : 0
|
|
1053
|
-
) : !g &&
|
|
1053
|
+
) : !g && s && s.length > 1 ? g = q(s, a != null ? a : 0) : !g && s && s.length === 1 && ([g] = s);
|
|
1054
1054
|
const u = new oe().fromLineSegments(
|
|
1055
1055
|
new Ft(g)
|
|
1056
1056
|
);
|
|
@@ -1065,14 +1065,14 @@ class hs extends tt {
|
|
|
1065
1065
|
});
|
|
1066
1066
|
}
|
|
1067
1067
|
getMaterial(t) {
|
|
1068
|
-
return new
|
|
1068
|
+
return new se(X({
|
|
1069
1069
|
color: new Yt("#ffffff")
|
|
1070
1070
|
}, t));
|
|
1071
1071
|
}
|
|
1072
1072
|
}
|
|
1073
|
-
class
|
|
1073
|
+
class fn extends K {
|
|
1074
1074
|
constructor(t) {
|
|
1075
|
-
super(), this.options =
|
|
1075
|
+
super(), this.options = X({
|
|
1076
1076
|
maxDepth: 10,
|
|
1077
1077
|
percentDepth: !1,
|
|
1078
1078
|
innerRadius: 25,
|
|
@@ -1081,71 +1081,71 @@ class us extends tt {
|
|
|
1081
1081
|
}, t);
|
|
1082
1082
|
}
|
|
1083
1083
|
create() {
|
|
1084
|
-
return
|
|
1084
|
+
return ct(this, null, function* () {
|
|
1085
1085
|
this.createGroup();
|
|
1086
|
-
const { data: t, maxDepth: e, colors:
|
|
1086
|
+
const { data: t, maxDepth: e, colors: n, material: s, percentDepth: r, activeIndex: a } = this.options, f = Math.max(...t), i = t.reduce((o, c) => o + c, 0);
|
|
1087
1087
|
let h = Math.PI / 2;
|
|
1088
1088
|
t.forEach((o, c) => {
|
|
1089
1089
|
if (o === 0) return;
|
|
1090
|
-
const g = Math.PI * 2 * (o / i), u =
|
|
1090
|
+
const g = Math.PI * 2 * (o / i), u = n[c], y = r ? e * (o / f) : e, A = this.createGeometry(y, g), w = s ? s.clone() : new Pe({
|
|
1091
1091
|
color: u
|
|
1092
1092
|
});
|
|
1093
|
-
|
|
1093
|
+
s && w.color.set(u);
|
|
1094
1094
|
const v = new kt(A, w);
|
|
1095
1095
|
v.userData.depth = y, v.userData.index = c, v.rotateZ(h), h += g, this.add(v);
|
|
1096
1096
|
}), a !== -1 && this.setActive(a);
|
|
1097
1097
|
});
|
|
1098
1098
|
}
|
|
1099
1099
|
createGeometry(t, e) {
|
|
1100
|
-
const { outRadius:
|
|
1101
|
-
return r.moveTo(
|
|
1100
|
+
const { outRadius: n, innerRadius: s } = this.options, r = new Mt();
|
|
1101
|
+
return r.moveTo(n, 0), r.lineTo(s, 0), r.absarc(0, 0, s, 0, e, !1), r.absarc(0, 0, n, e, 0, !0), new st(r, {
|
|
1102
1102
|
curveSegments: 48,
|
|
1103
1103
|
depth: t,
|
|
1104
1104
|
bevelEnabled: !1
|
|
1105
1105
|
});
|
|
1106
1106
|
}
|
|
1107
1107
|
handlePick(t, e = 1.3) {
|
|
1108
|
-
const { object:
|
|
1109
|
-
return this.setActive(
|
|
1108
|
+
const { object: n } = this.pencil.pick(t, this.object3d.children) || {}, s = n ? this.object3d.children.findIndex((r) => r === n) : this.options.activeIndex;
|
|
1109
|
+
return this.setActive(s, e);
|
|
1110
1110
|
}
|
|
1111
1111
|
setActive(t, e = 1.3) {
|
|
1112
|
-
const
|
|
1113
|
-
if (this.object3d.children.forEach((
|
|
1114
|
-
if (!(
|
|
1115
|
-
if (
|
|
1116
|
-
|
|
1117
|
-
const r = new
|
|
1118
|
-
|
|
1112
|
+
const n = this.object3d.children[t];
|
|
1113
|
+
if (this.object3d.children.forEach((s) => {
|
|
1114
|
+
if (!(n && n === s) && s.scale.z !== 1) {
|
|
1115
|
+
if (s.userData.levTween) return;
|
|
1116
|
+
s.userData.enTween && (s.userData.enTween.stop(), s.userData.enTween = null);
|
|
1117
|
+
const r = new it.Tween(s.scale).to({ z: 1 }, 100);
|
|
1118
|
+
s.userData.levTween = r, r.start();
|
|
1119
1119
|
}
|
|
1120
|
-
}),
|
|
1121
|
-
if (
|
|
1120
|
+
}), n) {
|
|
1121
|
+
if (n.userData.enTween)
|
|
1122
1122
|
return;
|
|
1123
|
-
|
|
1124
|
-
const
|
|
1125
|
-
return
|
|
1123
|
+
n.userData.levTween && (n.userData.levTween.stop(), n.userData.levTween = null);
|
|
1124
|
+
const s = new it.Tween(n.scale).to({ z: e }, 100);
|
|
1125
|
+
return n.userData.enTween = s, s.start(), n.userData.index;
|
|
1126
1126
|
}
|
|
1127
1127
|
return -1;
|
|
1128
1128
|
}
|
|
1129
1129
|
render() {
|
|
1130
|
-
this.object3d.scale.z = 0, new
|
|
1130
|
+
this.object3d.scale.z = 0, new it.Tween(this.object3d.scale).to({ z: 1 }, 1e3).easing(it.Easing.Sinusoidal.InOut).start();
|
|
1131
1131
|
}
|
|
1132
1132
|
}
|
|
1133
1133
|
export {
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1134
|
+
en as ConicPolygon,
|
|
1135
|
+
nn as Ellipsoid,
|
|
1136
|
+
sn as ExtrudePolygon,
|
|
1137
|
+
rn as Group,
|
|
1138
|
+
an as Light,
|
|
1139
|
+
ln as Line,
|
|
1140
|
+
un as Line2,
|
|
1141
|
+
pn as Line2Material,
|
|
1142
|
+
yn as LineSegmentsGeometry,
|
|
1143
1143
|
Ve as MeshLineGeometry,
|
|
1144
1144
|
re as MeshLineMaterial,
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1145
|
+
cn as MeshLineRaycast,
|
|
1146
|
+
xn as Node,
|
|
1147
|
+
fn as Pie,
|
|
1148
1148
|
ie as getConicPolygonGeometry,
|
|
1149
|
-
|
|
1150
|
-
|
|
1149
|
+
wn as getConicPolygonGeometryMetas,
|
|
1150
|
+
on as getSplitTexture
|
|
1151
1151
|
};
|