@algorisys/tinyfly 0.101.0 → 0.102.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +5 -5
  2. package/bin/tinyfly.mjs +9 -3
  3. package/docs/editor-guide.md +1 -1
  4. package/docs/examples.md +1 -1
  5. package/docs/getting-started.md +1 -1
  6. package/docs/gsap-compat.md +1 -1
  7. package/docs/llm-guide.md +8 -2
  8. package/docs/maps.md +2 -2
  9. package/docs/scene-3d.md +117 -5
  10. package/docs/teaching.md +1 -1
  11. package/docs/video-rendering.md +44 -1
  12. package/lib/addons/adapters.js +168 -123
  13. package/lib/addons/characters.js +4663 -4566
  14. package/lib/addons/scene-3d-webgl.js +30 -30
  15. package/lib/addons/scene-3d.js +650 -341
  16. package/lib/browser/tinyfly-scene-3d-webgl.iife.js +2 -2
  17. package/lib/browser/tinyfly-scene-3d.iife.js +2 -2
  18. package/lib/browser/tinyfly.iife.js +13 -13
  19. package/lib/browser/tinyfly.js +4105 -3973
  20. package/lib/browser/tinyfly.umd.js +13 -13
  21. package/lib/engine/tinyfly-engine.js +1207 -1172
  22. package/lib/engine/tinyfly-engine.umd.cjs +2 -2
  23. package/lib/headless/headless.js +150 -6
  24. package/lib/types/adapters/canvas/framing.d.ts +27 -0
  25. package/lib/types/adapters/canvas/index.d.ts +1 -0
  26. package/lib/types/characters/character-script-3d.d.ts +21 -1
  27. package/lib/types/characters/index.d.ts +2 -1
  28. package/lib/types/characters/staging-3d.d.ts +56 -0
  29. package/lib/types/engine/authoring/framing.d.ts +48 -0
  30. package/lib/types/engine/authoring/index.d.ts +1 -0
  31. package/lib/types/headless/audio-mix.d.ts +40 -0
  32. package/lib/types/headless/ffmpeg-args.d.ts +2 -0
  33. package/lib/types/headless/frame-renderer.d.ts +7 -1
  34. package/lib/types/headless/index.d.ts +1 -0
  35. package/lib/types/headless/node-audio.d.ts +19 -0
  36. package/lib/types/headless/node-video.d.ts +2 -0
  37. package/lib/types/headless/video-scene.d.ts +12 -0
  38. package/lib/types/scene-3d/index.d.ts +3 -0
  39. package/lib/types/scene-3d/lighting.d.ts +58 -0
  40. package/lib/types/scene-3d/resolve-scene.d.ts +5 -1
  41. package/lib/types/scene-3d/scene-3d-adapter.d.ts +2 -0
  42. package/lib/types/scene-3d/scene-types.d.ts +14 -2
  43. package/lib/types/scene-3d/shots.d.ts +162 -0
  44. package/lib/types/scene-3d/software-renderer.d.ts +40 -0
  45. package/llms-full.txt +177 -16
  46. package/llms.txt +29 -29
  47. package/package.json +1 -1
  48. package/skills/tinyfly/SKILL.md +4 -1
@@ -1,350 +1,484 @@
1
- import { M as It, b as Pt, c as St, a as Tt, e as Ct, g as Et, l as $t, m as Dt, p as Ot, d as Ft, f as zt, r as Nt, s as Wt, h as Rt, t as Vt, i as Lt, v as Yt } from "./load-scene-oWNsYYC1.js";
2
- import { vec3 as w, mat4 as S, quat as F, ribbon as U, ribbonHeadCap as q, trailSamples as G } from "@algorisys/tinyfly";
3
- import { p as R, f as x, s as j, i as tt } from "./shading-0lPgnXmD.js";
4
- import { l as Ht } from "./shading-0lPgnXmD.js";
5
- function et(t, e, n = {}) {
6
- const o = w.normalize(w.subtract(e, t)), s = n.up ?? (Math.abs(o[1]) > 0.9999 ? [0, 0, -1] : [0, 1, 0]);
7
- return H(S.lookAt(t, e, s), n.roll ?? 0);
8
- }
9
- function H(t, e) {
10
- return e ? S.multiply(S.fromQuat(F.fromAxisAngle([0, 0, 1], -e)), t) : t;
11
- }
12
- function yt(t, e, n, o) {
13
- const s = e * Math.PI / 180, a = n * Math.PI / 180;
14
- return [t[0] + o * Math.cos(a) * Math.sin(s), t[1] + o * Math.sin(a), t[2] + o * Math.cos(a) * Math.cos(s)];
15
- }
16
- function wt(t, e, n) {
17
- const o = w.subtract(t, e), s = w.length(o);
18
- if (s === 0) return t;
19
- const a = Math.max(1e-3, s - n);
20
- return w.add(e, w.scale(o, a / s));
21
- }
22
- function V(t, e) {
23
- if (t.projection === "perspective") return S.perspective(t.fov, e, t.near, t.far);
24
- const n = t.height / 2;
25
- return S.orthographic(-n * e, n * e, -n, n, t.near, t.far);
26
- }
27
- function nt(t, e, n, o) {
28
- const { camera: s } = o, a = s.near, r = t.map((d) => S.transformPoint(s.view, d)), f = s.projection[5] * o.height / 2, l = (d, c) => n.width * (1 - n.taper * d) * f / (s.orthographic ? 1 : Math.max(c, a)), m = R(n.color), A = [];
29
- let y = [];
30
- const T = (d) => -d[2] >= a;
31
- for (let d = 0; d < r.length; d++) {
32
- const c = r[d];
33
- T(c) ? (y.length === 0 && d > 0 && !T(r[d - 1]) && y.push(L(r[d - 1], c, e[d - 1], e[d], a)), y.push({ view: c, age: e[d] })) : y.length > 0 && (y.push(L(r[d - 1], c, e[d - 1], e[d], a)), A.push(y), y = []);
34
- }
35
- y.length > 0 && A.push(y);
1
+ import { M as sn, b as rn, c as an, a as cn, e as ln, g as dn, l as hn, m as fn, p as un, d as gn, f as pn, r as yn, s as mn, h as kn, t as wn, i as Mn, v as vn } from "./load-scene-oWNsYYC1.js";
2
+ import { vec3 as A, mat4 as P, quat as F, ribbon as dt, ribbonHeadCap as ht, trailSamples as ft, getEasingFunction as ut, loopNoise as gt } from "@algorisys/tinyfly";
3
+ import { p as N, f as pt, s as q, i as j } from "./shading-0lPgnXmD.js";
4
+ import { l as xn } from "./shading-0lPgnXmD.js";
5
+ function yt(t, n, o = {}) {
6
+ const e = A.normalize(A.subtract(n, t)), i = o.up ?? (Math.abs(e[1]) > 0.9999 ? [0, 0, -1] : [0, 1, 0]);
7
+ return tt(P.lookAt(t, n, i), o.roll ?? 0);
8
+ }
9
+ function tt(t, n) {
10
+ return n ? P.multiply(P.fromQuat(F.fromAxisAngle([0, 0, 1], -n)), t) : t;
11
+ }
12
+ function L(t, n, o, e) {
13
+ const i = n * Math.PI / 180, a = o * Math.PI / 180;
14
+ return [t[0] + e * Math.cos(a) * Math.sin(i), t[1] + e * Math.sin(a), t[2] + e * Math.cos(a) * Math.cos(i)];
15
+ }
16
+ function Rt(t, n, o) {
17
+ const e = A.subtract(t, n), i = A.length(e);
18
+ if (i === 0) return t;
19
+ const a = Math.max(1e-3, i - o);
20
+ return A.add(n, A.scale(e, a / i));
21
+ }
22
+ function J(t, n) {
23
+ if (t.projection === "perspective") return P.perspective(t.fov, n, t.near, t.far);
24
+ const o = t.height / 2;
25
+ return P.orthographic(-o * n, o * n, -o, o, t.near, t.far);
26
+ }
27
+ function mt(t, n, o, e) {
28
+ const { camera: i } = e, a = i.near, r = t.map((p) => P.transformPoint(i.view, p)), l = i.projection[5] * e.height / 2, c = (p, h) => o.width * (1 - o.taper * p) * l / (i.orthographic ? 1 : Math.max(h, a)), u = N(o.color), g = [];
29
+ let m = [];
30
+ const v = (p) => -p[2] >= a;
31
+ for (let p = 0; p < r.length; p++) {
32
+ const h = r[p];
33
+ v(h) ? (m.length === 0 && p > 0 && !v(r[p - 1]) && m.push(K(r[p - 1], h, n[p - 1], n[p], a)), m.push({ view: h, age: n[p] })) : m.length > 0 && (m.push(K(r[p - 1], h, n[p - 1], n[p], a)), g.push(m), m = []);
34
+ }
35
+ m.length > 0 && g.push(m);
36
36
  const $ = [];
37
- for (const d of A) {
38
- if (d.length < 2) continue;
39
- const c = d.map((h) => -h.view[2]), C = d.map((h) => o.toScreen(h.view)).map((h, g) => ({ x: h.x, y: h.y, width: l(d[g].age, c[g]) })), i = U(C), p = d[d.length - 1].age === 0 ? q(C) : null;
40
- for (let h = 0; h + 1 < d.length; h++) {
41
- const g = (c[h] + c[h + 1]) / 2;
42
- if (g > s.far) continue;
43
- let M = n.opacity * (1 - n.fade * ((d[h].age + d[h + 1].age) / 2));
44
- const b = w.lerp(d[h].view, d[h + 1].view, 0.5), E = x(o.fog, w.length(b));
45
- let D = m;
46
- if (o.fog && E > 0)
47
- if (n.additive) M *= 1 - E;
37
+ for (const p of g) {
38
+ if (p.length < 2) continue;
39
+ const h = p.map((f) => -f.view[2]), b = p.map((f) => e.toScreen(f.view)).map((f, w) => ({ x: f.x, y: f.y, width: c(p[w].age, h[w]) })), s = dt(b), d = p[p.length - 1].age === 0 ? ht(b) : null;
40
+ for (let f = 0; f + 1 < p.length; f++) {
41
+ const w = (h[f] + h[f + 1]) / 2;
42
+ if (w > i.far) continue;
43
+ let x = o.opacity * (1 - o.fade * ((p[f].age + p[f + 1].age) / 2));
44
+ const k = A.lerp(p[f].view, p[f + 1].view, 0.5), I = pt(e.fog, A.length(k));
45
+ let T = u;
46
+ if (e.fog && I > 0)
47
+ if (o.additive) x *= 1 - I;
48
48
  else {
49
- const v = R(o.fog.color);
50
- D = [m[0] + (v[0] - m[0]) * E, m[1] + (v[1] - m[1]) * E, m[2] + (v[2] - m[2]) * E];
49
+ const y = N(e.fog.color);
50
+ T = [u[0] + (y[0] - u[0]) * I, u[1] + (y[1] - u[1]) * I, u[2] + (y[2] - u[2]) * I];
51
51
  }
52
- if (M <= 0) continue;
53
- const O = `rgb(${D.map((v) => Math.round(Math.min(1, Math.max(0, v)) * 255)).join(", ")})`, I = [i.left[h], i.left[h + 1], i.right[h + 1], i.right[h]], u = h + 2 === d.length ? p : null;
52
+ if (x <= 0) continue;
53
+ const D = `rgb(${T.map((y) => Math.round(Math.min(1, Math.max(0, y)) * 255)).join(", ")})`, S = [s.left[f], s.left[f + 1], s.right[f + 1], s.right[f]], E = f + 2 === p.length ? d : null;
54
54
  $.push({
55
- depth: g,
56
- draw(v) {
57
- n.additive && (v.globalCompositeOperation = "lighter"), v.globalAlpha = Math.min(1, M), v.fillStyle = O, v.beginPath(), v.moveTo(I[0].x, I[0].y), v.lineTo(I[1].x, I[1].y), u && v.arc(u.x, u.y, u.radius, u.start, u.start - Math.PI, !0), v.lineTo(I[2].x, I[2].y), v.lineTo(I[3].x, I[3].y), v.closePath(), v.fill(), !n.additive && M >= 1 && (v.strokeStyle = O, v.lineWidth = 0.75, v.stroke());
55
+ depth: w,
56
+ draw(y) {
57
+ o.additive && (y.globalCompositeOperation = "lighter"), y.globalAlpha = Math.min(1, x), y.fillStyle = D, y.beginPath(), y.moveTo(S[0].x, S[0].y), y.lineTo(S[1].x, S[1].y), E && y.arc(E.x, E.y, E.radius, E.start, E.start - Math.PI, !0), y.lineTo(S[2].x, S[2].y), y.lineTo(S[3].x, S[3].y), y.closePath(), y.fill(), !o.additive && x >= 1 && (y.strokeStyle = D, y.lineWidth = 0.75, y.stroke());
58
58
  }
59
59
  });
60
60
  }
61
61
  }
62
62
  return $;
63
63
  }
64
- function L(t, e, n, o, s) {
65
- const a = (-s - t[2]) / (e[2] - t[2]);
66
- return { view: w.lerp(t, e, a), age: n + (o - n) * a };
64
+ function K(t, n, o, e, i) {
65
+ const a = (-i - t[2]) / (n[2] - t[2]);
66
+ return { view: A.lerp(t, n, a), age: o + (e - o) * a };
67
67
  }
68
- const ot = Math.cos(30 * Math.PI / 180), Q = /* @__PURE__ */ new Map(), P = (t) => typeof t == "number" ? t : void 0, z = (t, e) => Array.isArray(t) && t.length === e ? t : void 0;
69
- function X(t, e) {
70
- const n = t.position ?? [0, 0, 0], o = z(e.get("position"), 3) ?? [
71
- P(e.get("x")) ?? n[0],
72
- P(e.get("y")) ?? n[1],
73
- P(e.get("z")) ?? n[2]
68
+ const kt = Math.cos(30 * Math.PI / 180), nt = /* @__PURE__ */ new Map(), C = (t) => typeof t == "number" ? t : void 0, W = (t, n) => Array.isArray(t) && t.length === n ? t : void 0;
69
+ function ot(t, n) {
70
+ const o = t.position ?? [0, 0, 0], e = W(n.get("position"), 3) ?? [
71
+ C(n.get("x")) ?? o[0],
72
+ C(n.get("y")) ?? o[1],
73
+ C(n.get("z")) ?? o[2]
74
74
  ];
75
- let s;
76
- const a = z(e.get("quaternion"), 4), r = ["rotateX", "rotateY", "rotateZ"].map((A) => P(e.get(A)));
77
- if (a) s = F.normalize(a);
78
- else if (r.some((A) => A !== void 0)) {
79
- const A = t.rotation ?? [0, 0, 0];
80
- s = F.fromEuler(r[0] ?? A[0], r[1] ?? A[1], r[2] ?? A[2]);
81
- } else t.quaternion ? s = F.normalize(t.quaternion) : s = t.rotation ? F.fromEuler(...t.rotation) : F.identity();
82
- const f = typeof t.scale == "number" ? [t.scale, t.scale, t.scale] : t.scale ?? [1, 1, 1], l = P(e.get("scale")), m = [
83
- P(e.get("scaleX")) ?? l ?? f[0],
84
- P(e.get("scaleY")) ?? l ?? f[1],
85
- P(e.get("scaleZ")) ?? l ?? f[2]
75
+ let i;
76
+ const a = W(n.get("quaternion"), 4), r = ["rotateX", "rotateY", "rotateZ"].map((g) => C(n.get(g)));
77
+ if (a) i = F.normalize(a);
78
+ else if (r.some((g) => g !== void 0)) {
79
+ const g = t.rotation ?? [0, 0, 0];
80
+ i = F.fromEuler(r[0] ?? g[0], r[1] ?? g[1], r[2] ?? g[2]);
81
+ } else t.quaternion ? i = F.normalize(t.quaternion) : i = t.rotation ? F.fromEuler(...t.rotation) : F.identity();
82
+ const l = typeof t.scale == "number" ? [t.scale, t.scale, t.scale] : t.scale ?? [1, 1, 1], c = C(n.get("scale")), u = [
83
+ C(n.get("scaleX")) ?? c ?? l[0],
84
+ C(n.get("scaleY")) ?? c ?? l[1],
85
+ C(n.get("scaleZ")) ?? c ?? l[2]
86
86
  ];
87
- return S.compose(o, s, m);
87
+ return P.compose(e, i, u);
88
88
  }
89
- const N = (t) => [t[12], t[13], t[14]];
90
- function it(t, e, n, o) {
91
- const s = N(e), a = z(n.get("lookAt"), 3) ?? t.lookAt, r = P(n.get("roll")) ?? t.roll ?? 0, f = a ? et(s, a, { up: t.up, roll: r }) : H(S.invert(e) ?? S.identity(), r), l = t.projection === "perspective" ? V({ ...t, fov: P(n.get("fov")) ?? t.fov }, o) : V({ ...t, height: P(n.get("height")) ?? t.height }, o);
89
+ const Z = (t) => [t[12], t[13], t[14]];
90
+ function wt(t, n, o, e) {
91
+ const i = Z(n), a = W(o.get("lookAt"), 3) ?? t.lookAt, r = C(o.get("roll")) ?? t.roll ?? 0, l = a ? yt(i, a, { up: t.up, roll: r }) : tt(P.invert(n) ?? P.identity(), r), c = t.projection === "perspective" ? J({ ...t, fov: C(o.get("fov")) ?? t.fov }, e) : J({ ...t, height: C(o.get("height")) ?? t.height }, e);
92
92
  return {
93
93
  id: t.id,
94
- view: f,
95
- projection: l,
96
- position: s,
97
- forward: w.normalize([-f[2], -f[6], -f[10]]),
94
+ view: l,
95
+ projection: c,
96
+ position: i,
97
+ forward: A.normalize([-l[2], -l[6], -l[10]]),
98
98
  orthographic: t.projection === "orthographic",
99
99
  near: t.near,
100
100
  far: t.far
101
101
  };
102
102
  }
103
- function Y(t) {
104
- return S.transpose(S.invert(t) ?? S.identity());
103
+ function Q(t) {
104
+ return P.transpose(P.invert(t) ?? P.identity());
105
105
  }
106
- function st(t, e, n, o) {
107
- return w.normalize([t[0] * e + t[4] * n + t[8] * o, t[1] * e + t[5] * n + t[9] * o, t[2] * e + t[6] * n + t[10] * o]);
106
+ function Mt(t, n, o, e) {
107
+ return A.normalize([t[0] * n + t[4] * o + t[8] * e, t[1] * n + t[5] * o + t[9] * e, t[2] * n + t[6] * o + t[10] * e]);
108
108
  }
109
- function rt(t, e) {
110
- const n = (s) => -s[2] >= e, o = [];
111
- for (let s = 0; s < t.length; s++) {
112
- const a = t[s], r = t[(s + 1) % t.length];
113
- if (n(a) && o.push(a), n(a) !== n(r)) {
114
- const f = (-e - a[2]) / (r[2] - a[2]);
115
- o.push(w.lerp(a, r, f));
109
+ function vt(t, n) {
110
+ const o = (i) => -i[2] >= n, e = [];
111
+ for (let i = 0; i < t.length; i++) {
112
+ const a = t[i], r = t[(i + 1) % t.length];
113
+ if (o(a) && e.push(a), o(a) !== o(r)) {
114
+ const l = (-n - a[2]) / (r[2] - a[2]);
115
+ e.push(A.lerp(a, r, l));
116
116
  }
117
117
  }
118
- return o;
118
+ return e;
119
+ }
120
+ function bt(t, n, o, e = 16) {
121
+ const i = [t[0], t[1], t[2]], a = [0, 1, 0], r = [];
122
+ for (let c = 0; c < e; c++) {
123
+ const u = c / e * Math.PI * 2;
124
+ i.push(t[0] + Math.cos(u) * n, t[1], t[2] + Math.sin(u) * o), a.push(0, 1, 0);
125
+ }
126
+ for (let c = 0; c < e; c++) r.push(0, 1 + (c + 1) % e, 1 + c);
127
+ const l = Array.from({ length: e }, () => []);
128
+ return { positions: i, normals: a, indices: r, faceEdges: l };
119
129
  }
120
- function at(t, e) {
121
- const n = P(e.get("outlineWidth")) ?? t.outline?.width, o = e.get("outlineColor"), s = (typeof o == "string" ? o : void 0) ?? t.outline?.color ?? "#000000";
122
- return n !== void 0 && n > 0 ? { width: n, color: s } : void 0;
130
+ function xt(t, n) {
131
+ const o = C(n.get("outlineWidth")) ?? t.outline?.width, e = n.get("outlineColor"), i = (typeof e == "string" ? e : void 0) ?? t.outline?.color ?? "#000000";
132
+ return o !== void 0 && o > 0 ? { width: o, color: i } : void 0;
123
133
  }
124
- function lt(t, e) {
125
- return !t || t.to <= t.from ? 1 : Math.min(1, Math.max(0, (e - t.from) / (t.to - t.from)));
134
+ function At(t, n) {
135
+ return !t || t.to <= t.from ? 1 : Math.min(1, Math.max(0, (n - t.from) / (t.to - t.from)));
126
136
  }
127
- function Z(t, e = /* @__PURE__ */ new Map(), n) {
128
- const { scene: o } = t, s = (i) => e.get(`${o.id}/${i}`) ?? Q, a = n.nearFade ?? o.nearFade, r = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
129
- for (const i of o.objects) {
130
- const p = s(i.id), h = X(i, p), g = i.parent ? r.get(i.parent) : void 0;
131
- r.set(i.id, g ? S.multiply(g, h) : h);
132
- const M = P(p.get("visible")) !== void 0 ? P(p.get("visible")) > 0.5 : i.visible !== !1;
133
- f.set(i.id, M && (i.parent ? f.get(i.parent) !== !1 : !0));
137
+ function et(t, n = /* @__PURE__ */ new Map(), o) {
138
+ const { scene: e } = t, i = (s) => n.get(`${e.id}/${s}`) ?? nt, a = o.nearFade ?? e.nearFade, r = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
139
+ for (const s of e.objects) {
140
+ const d = i(s.id), f = ot(s, d), w = s.parent ? r.get(s.parent) : void 0;
141
+ r.set(s.id, w ? P.multiply(w, f) : f);
142
+ const x = C(d.get("visible")) !== void 0 ? C(d.get("visible")) > 0.5 : s.visible !== !1;
143
+ l.set(s.id, x && (s.parent ? l.get(s.parent) !== !1 : !0));
134
144
  }
135
- const l = e.get(o.id)?.get("activeCamera"), m = typeof l == "string" && o.objects.some((i) => i.id === l && i.kind === "camera") ? l : o.camera, A = o.objects.find((i) => i.id === m), y = it(A, r.get(m), s(m), n.width / n.height), T = (i) => {
136
- const p = S.transformPoint(y.projection, i);
137
- return { x: (p[0] + 1) / 2 * n.width, y: (1 - p[1]) / 2 * n.height };
145
+ const c = n.get(e.id)?.get("activeCamera"), u = typeof c == "string" && e.objects.some((s) => s.id === c && s.kind === "camera") ? c : e.camera, g = e.objects.find((s) => s.id === u), m = wt(g, r.get(u), i(u), o.width / o.height), v = (s) => {
146
+ const d = P.transformPoint(m.projection, s);
147
+ return { x: (d[0] + 1) / 2 * o.width, y: (1 - d[1]) / 2 * o.height };
138
148
  }, $ = [];
139
- for (const i of o.objects) {
140
- if (i.kind !== "light" || !f.get(i.id)) continue;
141
- const p = s(i.id), h = N(r.get(i.id)), g = z(p.get("target"), 3) ?? i.target ?? [0, 0, 0], M = p.get("color");
149
+ for (const s of e.objects) {
150
+ if (s.kind !== "light" || !l.get(s.id)) continue;
151
+ const d = i(s.id), f = Z(r.get(s.id)), w = W(d.get("target"), 3) ?? s.target ?? [0, 0, 0], x = d.get("color");
142
152
  $.push({
143
- id: i.id,
144
- light: i.light,
145
- color: typeof M == "string" ? M : i.color,
146
- intensity: P(p.get("intensity")) ?? i.intensity,
147
- position: h,
148
- direction: w.normalize(w.subtract(g, h)),
149
- range: i.range,
150
- angle: i.angle ?? 30
153
+ id: s.id,
154
+ light: s.light,
155
+ color: typeof x == "string" ? x : s.color,
156
+ intensity: C(d.get("intensity")) ?? s.intensity,
157
+ position: f,
158
+ direction: A.normalize(A.subtract(w, f)),
159
+ range: s.range,
160
+ angle: s.angle ?? 30
151
161
  });
152
162
  }
153
- const d = [], c = [];
154
- o.objects.forEach((i, p) => {
155
- if (i.kind !== "mesh" || !f.get(i.id)) return;
156
- const h = t.meshes.get(i.id), g = o.materials?.[i.material];
157
- if (!h || !g) return;
158
- const M = s(i.id), b = r.get(i.id), E = Y(b), D = M.get("color"), O = (P(M.get("opacity")) ?? 1) * (g.opacity ?? 1);
159
- if (O <= 0) return;
160
- const I = at(g, M), u = I === g.outline || I && g.outline && I.width === g.outline.width && I.color === g.outline.color ? g : { ...g, outline: I };
161
- c.push({ objectId: i.id, objectIndex: p, mesh: h, world: b, material: u, color: typeof D == "string" ? D : void 0, opacity: O }), d.push(..._(h, b, E, y, T, u, {
162
- objectId: i.id,
163
- objectIndex: p,
164
- layer: i.layer ?? 0,
165
- color: typeof D == "string" ? D : void 0,
166
- opacity: O,
167
- ink: I,
163
+ const p = [], h = [];
164
+ e.objects.forEach((s, d) => {
165
+ if (s.kind !== "mesh" || !l.get(s.id)) return;
166
+ const f = t.meshes.get(s.id), w = e.materials?.[s.material];
167
+ if (!f || !w) return;
168
+ const x = i(s.id), k = r.get(s.id), I = Q(k), T = x.get("color"), D = (C(x.get("opacity")) ?? 1) * (w.opacity ?? 1);
169
+ if (D <= 0) return;
170
+ const S = xt(w, x), E = S === w.outline || S && w.outline && S.width === w.outline.width && S.color === w.outline.color ? w : { ...w, outline: S };
171
+ h.push({ objectId: s.id, objectIndex: d, mesh: f, world: k, material: E, color: typeof T == "string" ? T : void 0, opacity: D }), p.push(..._(f, k, I, m, v, E, {
172
+ objectId: s.id,
173
+ objectIndex: d,
174
+ layer: s.layer ?? 0,
175
+ color: typeof T == "string" ? T : void 0,
176
+ opacity: D,
177
+ ink: S,
178
+ nearFade: a
179
+ }));
180
+ }), e.objects.forEach((s, d) => {
181
+ if (s.kind !== "mesh" || !s.shadow || !l.get(s.id)) return;
182
+ const f = t.meshes.get(s.id);
183
+ if (!f) return;
184
+ const w = i(s.id);
185
+ if ((C(w.get("opacity")) ?? 1) <= 0) return;
186
+ const x = r.get(s.id), k = s.shadow === !0 ? {} : s.shadow, I = k.ground ?? e.ground ?? 0;
187
+ let T = 1 / 0, D = -1 / 0, S = 1 / 0, E = 1 / 0, y = -1 / 0;
188
+ for (let O = 0; O < f.positions.length; O += 3) {
189
+ const R = P.transformPoint(x, [f.positions[O], f.positions[O + 1], f.positions[O + 2]]);
190
+ T = Math.min(T, R[0]), D = Math.max(D, R[0]), S = Math.min(S, R[1]), E = Math.min(E, R[2]), y = Math.max(y, R[2]);
191
+ }
192
+ const z = Math.max(D - T, y - E);
193
+ if (!(z > 0)) return;
194
+ const X = Math.max(0, S - I), Y = Math.min(1, X / (2 * z)), H = (k.opacity ?? 0.22) * (1 - Y * 0.8);
195
+ if (H <= 0.01) return;
196
+ const G = 1.1 + Y * 0.4, ct = bt([(T + D) / 2, I + 2e-3, (E + y) / 2], (D - T) / 2 * G, (y - E) / 2 * G), lt = { color: "#000000", shading: "unlit", opacity: H };
197
+ p.push(..._(ct, P.identity(), P.identity(), m, v, lt, {
198
+ objectId: `${s.id}:shadow`,
199
+ objectIndex: d - 0.5,
200
+ layer: s.layer ?? 0,
201
+ opacity: H,
168
202
  nearFade: a
169
203
  }));
170
204
  });
171
- const k = [];
172
- o.objects.forEach((i, p) => {
173
- const h = t.kinds.get(i.kind);
174
- if (!h || !f.get(i.id)) return;
175
- const g = h.resolve({
176
- object: i,
177
- prepared: t.prepared.get(i.id),
178
- values: s(i.id),
179
- world: r.get(i.id),
180
- camera: y,
205
+ const M = [];
206
+ e.objects.forEach((s, d) => {
207
+ const f = t.kinds.get(s.kind);
208
+ if (!f || !l.get(s.id)) return;
209
+ const w = f.resolve({
210
+ object: s,
211
+ prepared: t.prepared.get(s.id),
212
+ values: i(s.id),
213
+ world: r.get(s.id),
214
+ camera: m,
181
215
  lights: $,
182
- fog: o.fog,
183
- width: n.width,
184
- height: n.height,
185
- toScreen: T
216
+ fog: e.fog,
217
+ width: o.width,
218
+ height: o.height,
219
+ toScreen: v
186
220
  });
187
- if (!g) return;
188
- const M = i.layer ?? 0;
189
- for (const b of g.drawables ?? []) k.push({ ...b, objectId: i.id, objectIndex: p, layer: M });
190
- for (const b of g.meshes ?? [])
191
- c.push({ objectId: i.id, objectIndex: p, mesh: b.mesh, world: b.world, material: b.material, opacity: b.material.opacity ?? 1 }), d.push(..._(b.mesh, b.world, Y(b.world), y, T, b.material, {
192
- objectId: i.id,
193
- objectIndex: p,
194
- layer: M,
195
- opacity: b.material.opacity ?? 1,
196
- ink: b.material.outline,
221
+ if (!w) return;
222
+ const x = s.layer ?? 0;
223
+ for (const k of w.drawables ?? []) M.push({ ...k, objectId: s.id, objectIndex: d, layer: x });
224
+ for (const k of w.meshes ?? [])
225
+ h.push({ objectId: s.id, objectIndex: d, mesh: k.mesh, world: k.world, material: k.material, opacity: k.material.opacity ?? 1 }), p.push(..._(k.mesh, k.world, Q(k.world), m, v, k.material, {
226
+ objectId: s.id,
227
+ objectIndex: d,
228
+ layer: x,
229
+ opacity: k.material.opacity ?? 1,
230
+ ink: k.material.outline,
197
231
  nearFade: a
198
232
  }));
199
233
  });
200
- const C = { camera: y, height: n.height, fog: o.fog, toScreen: T };
201
- return o.objects.forEach((i, p) => {
202
- if (i.kind !== "line" && i.kind !== "trail" || !f.get(i.id)) return;
203
- const h = s(i.id), g = i.kind === "line" ? dt(i, r.get(i.id)) : ht(i, o, e, n);
204
- if (!g) return;
205
- const M = ct(i, h);
206
- if (M.opacity <= 0 || M.width <= 0) return;
207
- const b = i.layer ?? 0;
208
- for (const E of nt(g.points, g.ages, M, C)) k.push({ ...E, objectId: i.id, objectIndex: p, layer: b });
209
- }), k.sort((i, p) => i.layer - p.layer || p.depth - i.depth || i.objectIndex - p.objectIndex), d.sort((i, p) => i.layer - p.layer || p.depth - i.depth || i.objectIndex - p.objectIndex || i.face - p.face || i.part - p.part), {
210
- id: o.id,
211
- width: n.width,
212
- height: n.height,
213
- background: o.background,
214
- fog: o.fog,
215
- camera: y,
234
+ const b = { camera: m, height: o.height, fog: e.fog, toScreen: v };
235
+ return e.objects.forEach((s, d) => {
236
+ if (s.kind !== "line" && s.kind !== "trail" || !l.get(s.id)) return;
237
+ const f = i(s.id), w = s.kind === "line" ? It(s, r.get(s.id)) : St(s, e, n, o);
238
+ if (!w) return;
239
+ const x = $t(s, f);
240
+ if (x.opacity <= 0 || x.width <= 0) return;
241
+ const k = s.layer ?? 0;
242
+ for (const I of mt(w.points, w.ages, x, b)) M.push({ ...I, objectId: s.id, objectIndex: d, layer: k });
243
+ }), M.sort((s, d) => s.layer - d.layer || d.depth - s.depth || s.objectIndex - d.objectIndex), p.sort((s, d) => s.layer - d.layer || d.depth - s.depth || s.objectIndex - d.objectIndex || s.face - d.face || s.part - d.part), {
244
+ id: e.id,
245
+ width: o.width,
246
+ height: o.height,
247
+ background: e.background,
248
+ fog: e.fog,
249
+ camera: m,
216
250
  lights: $,
217
251
  worlds: r,
218
- triangles: d,
219
- drawables: k,
220
- meshes: c,
221
- time: n.time ?? 0
252
+ triangles: p,
253
+ drawables: M,
254
+ meshes: h,
255
+ time: o.time ?? 0
222
256
  };
223
257
  }
224
- function ct(t, e) {
225
- const n = e.get("color"), o = t.kind === "trail";
258
+ function $t(t, n) {
259
+ const o = n.get("color"), e = t.kind === "trail";
226
260
  return {
227
- color: typeof n == "string" ? n : t.color,
228
- width: P(e.get("width")) ?? t.width ?? 0.05,
229
- taper: t.taper ?? (o ? 1 : 0),
230
- fade: t.fade ?? (o ? 1 : 0),
231
- opacity: (P(e.get("opacity")) ?? 1) * (t.opacity ?? 1),
261
+ color: typeof o == "string" ? o : t.color,
262
+ width: C(n.get("width")) ?? t.width ?? 0.05,
263
+ taper: t.taper ?? (e ? 1 : 0),
264
+ fade: t.fade ?? (e ? 1 : 0),
265
+ opacity: (C(n.get("opacity")) ?? 1) * (t.opacity ?? 1),
232
266
  additive: t.blend === "add"
233
267
  };
234
268
  }
235
- function dt(t, e) {
236
- const o = (t.closed ? [...t.points, t.points[0]] : t.points).map((s) => S.transformPoint(e, s));
237
- return { points: o, ages: o.map((s, a) => 1 - a / (o.length - 1)) };
269
+ function It(t, n) {
270
+ const e = (t.closed ? [...t.points, t.points[0]] : t.points).map((i) => P.transformPoint(n, i));
271
+ return { points: e, ages: e.map((i, a) => 1 - a / (e.length - 1)) };
238
272
  }
239
- function ht(t, e, n, o) {
240
- if (!o.valuesAt) return null;
241
- const s = o.time ?? 0, a = P(n.get(`${e.id}/${t.id}`)?.get("length")) ?? t.length, r = G(
242
- (f) => N(B(e, t.follow, f === s ? n : o.valuesAt(f))),
243
- s,
244
- { length: a, samples: t.samples ?? 32, period: t.period ?? o.period }
273
+ function St(t, n, o, e) {
274
+ if (!e.valuesAt) return null;
275
+ const i = e.time ?? 0, a = C(o.get(`${n.id}/${t.id}`)?.get("length")) ?? t.length, r = ft(
276
+ (l) => Z(it(n, t.follow, l === i ? o : e.valuesAt(l))),
277
+ i,
278
+ { length: a, samples: t.samples ?? 32, period: t.period ?? e.period }
245
279
  );
246
- return r.length >= 2 ? { points: r.map((f) => f.at), ages: r.map((f) => f.age) } : null;
247
- }
248
- function B(t, e, n) {
249
- const o = t.objects.find((a) => a.id === e);
250
- if (!o) return S.identity();
251
- const s = X(o, n.get(`${t.id}/${e}`) ?? Q);
252
- return o.parent ? S.multiply(B(t, o.parent, n), s) : s;
253
- }
254
- function _(t, e, n, o, s, a, r) {
255
- const f = t.positions.length / 3, l = [], m = [];
256
- for (let c = 0; c < f; c++) {
257
- const k = S.transformPoint(e, [t.positions[c * 3], t.positions[c * 3 + 1], t.positions[c * 3 + 2]]);
258
- l.push(k), m.push(S.transformPoint(o.view, k));
259
- }
260
- const A = t.indices.length / 3, y = [], T = [];
261
- for (let c = 0; c < A; c++) {
262
- const [k, C, i] = [0, 1, 2].map((g) => l[t.indices[c * 3 + g]]), p = w.normalize(w.cross(w.subtract(C, k), w.subtract(i, k)));
263
- y.push(p);
264
- const h = o.orthographic ? w.scale(o.forward, -1) : w.subtract(o.position, k);
265
- T.push(w.dot(p, h) > 0);
266
- }
267
- const $ = (c) => -m[c][2] >= o.near, d = [];
268
- for (let c = 0; c < A; c++) {
269
- const k = T[c];
270
- if (!k && !a.doubleSided) continue;
271
- const C = [t.indices[c * 3], t.indices[c * 3 + 1], t.indices[c * 3 + 2]], i = C.map((u) => m[u]);
272
- if (i.every((u) => -u[2] > o.far)) continue;
273
- const p = rt(i, o.near);
274
- if (p.length < 3) continue;
275
- const h = k ? 1 : -1, g = w.scale(y[c], h), M = C.map((u) => w.scale(st(n, t.normals[u * 3], t.normals[u * 3 + 1], t.normals[u * 3 + 2]), h)), b = w.scale(w.add(w.add(l[C[0]], l[C[1]]), l[C[2]]), 1 / 3), E = -(i[0][2] + i[1][2] + i[2][2]) / 3, D = [];
276
- if (r.ink && k)
277
- for (const u of t.faceEdges[c]) {
278
- const v = u.across, W = v === -1 || !T[v], K = a.creases !== !1 && !W && c < v && w.dot(y[c], y[v]) < ot;
279
- (W || K) && $(u.a) && $(u.b) && D.push([s(m[u.a]), s(m[u.b])]);
280
+ return r.length >= 2 ? { points: r.map((l) => l.at), ages: r.map((l) => l.age) } : null;
281
+ }
282
+ function it(t, n, o) {
283
+ const e = t.objects.find((a) => a.id === n);
284
+ if (!e) return P.identity();
285
+ const i = ot(e, o.get(`${t.id}/${n}`) ?? nt);
286
+ return e.parent ? P.multiply(it(t, e.parent, o), i) : i;
287
+ }
288
+ function _(t, n, o, e, i, a, r) {
289
+ const l = t.positions.length / 3, c = [], u = [];
290
+ for (let h = 0; h < l; h++) {
291
+ const M = P.transformPoint(n, [t.positions[h * 3], t.positions[h * 3 + 1], t.positions[h * 3 + 2]]);
292
+ c.push(M), u.push(P.transformPoint(e.view, M));
293
+ }
294
+ const g = t.indices.length / 3, m = [], v = [];
295
+ for (let h = 0; h < g; h++) {
296
+ const [M, b, s] = [0, 1, 2].map((w) => c[t.indices[h * 3 + w]]), d = A.normalize(A.cross(A.subtract(b, M), A.subtract(s, M)));
297
+ m.push(d);
298
+ const f = e.orthographic ? A.scale(e.forward, -1) : A.subtract(e.position, M);
299
+ v.push(A.dot(d, f) > 0);
300
+ }
301
+ const $ = (h) => -u[h][2] >= e.near, p = [];
302
+ for (let h = 0; h < g; h++) {
303
+ const M = v[h];
304
+ if (!M && !a.doubleSided) continue;
305
+ const b = [t.indices[h * 3], t.indices[h * 3 + 1], t.indices[h * 3 + 2]], s = b.map((y) => u[y]);
306
+ if (s.every((y) => -y[2] > e.far)) continue;
307
+ const d = vt(s, e.near);
308
+ if (d.length < 3) continue;
309
+ const f = M ? 1 : -1, w = A.scale(m[h], f), x = b.map((y) => A.scale(Mt(o, t.normals[y * 3], t.normals[y * 3 + 1], t.normals[y * 3 + 2]), f)), k = A.scale(A.add(A.add(c[b[0]], c[b[1]]), c[b[2]]), 1 / 3), I = -(s[0][2] + s[1][2] + s[2][2]) / 3, T = [], D = [];
310
+ if (r.ink && M)
311
+ for (const y of t.faceEdges[h]) {
312
+ const z = y.across, X = z === -1 || !v[z], Y = a.creases !== !1 && !X && h < z && A.dot(m[h], m[z]) < kt;
313
+ (X || Y) && $(y.a) && $(y.b) && (T.push([i(u[y.a]), i(u[y.b])]), D.push([-u[y.a][2], -u[y.b][2]]));
280
314
  }
281
- const O = r.opacity * lt(r.nearFade, E);
282
- if (O <= 0) continue;
283
- const I = p.map(s);
284
- for (let u = 1; u + 1 < I.length; u++)
285
- d.push({
315
+ const S = r.opacity * At(r.nearFade, I);
316
+ if (S <= 0) continue;
317
+ const E = d.map(i);
318
+ for (let y = 1; y + 1 < E.length; y++)
319
+ p.push({
286
320
  objectId: r.objectId,
287
321
  objectIndex: r.objectIndex,
288
322
  layer: r.layer,
289
- face: c,
290
- part: u - 1,
291
- screen: [I[0], I[u], I[u + 1]],
292
- depth: E,
293
- centroid: b,
294
- normal: g,
295
- vertexNormals: M,
323
+ face: h,
324
+ part: y - 1,
325
+ screen: [E[0], E[y], E[y + 1]],
326
+ depth: I,
327
+ depths: [-d[0][2], -d[y][2], -d[y + 1][2]],
328
+ centroid: k,
329
+ normal: w,
330
+ vertexNormals: x,
296
331
  material: a,
297
- color: r.color ?? t.faceColors?.[c],
298
- opacity: O,
299
- outline: u === 1 ? D : [],
332
+ color: r.color ?? t.faceColors?.[h],
333
+ opacity: S,
334
+ outline: y === 1 ? T : [],
335
+ outlineDepths: y === 1 ? D : [],
300
336
  ink: r.ink
301
337
  });
302
338
  }
303
- return d;
339
+ return p;
304
340
  }
305
- class mt {
341
+ class Xt {
306
342
  ctx;
307
- constructor(e) {
308
- this.ctx = e;
343
+ constructor(n) {
344
+ this.ctx = n;
309
345
  }
310
- render(e) {
311
- J(this.ctx, e);
346
+ render(n) {
347
+ st(this.ctx, n);
312
348
  }
313
349
  }
314
- function J(t, e) {
315
- t.save(), e.background && e.background !== "transparent" && (t.fillStyle = e.background, t.fillRect(0, 0, e.width, e.height)), t.lineJoin = "round", t.lineCap = "round";
316
- let n = 0;
317
- const o = (r, f) => {
318
- for (; n < e.drawables.length; ) {
319
- const l = e.drawables[n];
320
- if (l.layer > r || l.layer === r && l.depth <= f) break;
321
- t.save(), l.draw(t, e), t.restore(), n++;
350
+ function st(t, n) {
351
+ if (t.save(), n.background && n.background !== "transparent") {
352
+ if (typeof n.background == "string") t.fillStyle = n.background;
353
+ else {
354
+ const r = t.createLinearGradient(0, 0, 0, n.height);
355
+ r.addColorStop(0, n.background.top), r.addColorStop(1, n.background.bottom), t.fillStyle = r;
356
+ }
357
+ t.fillRect(0, 0, n.width, n.height);
358
+ }
359
+ t.lineJoin = "round", t.lineCap = "round";
360
+ let o = 0;
361
+ const e = (r, l) => {
362
+ for (; o < n.drawables.length; ) {
363
+ const c = n.drawables[o];
364
+ if (c.layer > r || c.layer === r && c.depth <= l) break;
365
+ t.save(), c.draw(t, n), t.restore(), o++;
322
366
  }
323
367
  };
324
- let s = [];
368
+ let i = [];
325
369
  const a = (r) => {
326
- if (s.length === 0) return;
327
- const f = [];
328
- for (const l of s)
329
- r && r.objectId === l.objectId && r.layer === l.layer && l.depth - r.depth <= ft * l.depth ? f.push(l) : pt(t, l.triangle, e);
330
- s = f;
370
+ if (i.length === 0) return;
371
+ const l = [];
372
+ for (const c of i)
373
+ r && r.objectId === c.objectId && r.layer === c.layer && c.depth - r.depth <= Pt * c.depth ? l.push(c) : Tt(t, c.triangle, n);
374
+ i = l;
331
375
  };
332
- for (const r of e.triangles) {
333
- a(r), o(r.layer, r.depth);
334
- const { color: f, alpha: l } = j(r, e.lights, e.camera, e.fog), [m, A, y] = r.screen;
335
- t.globalAlpha = l, t.beginPath(), t.moveTo(m.x, m.y), t.lineTo(A.x, A.y), t.lineTo(y.x, y.y), t.closePath(), t.fillStyle = f, t.fill(), l >= 1 && (t.strokeStyle = f, t.lineWidth = 0.75, t.stroke()), r.ink && r.outline.length > 0 && s.push({ objectId: r.objectId, layer: r.layer, depth: r.depth, triangle: r });
336
- }
337
- a(), o(1 / 0, -1 / 0), t.restore();
338
- }
339
- const ft = 0.04;
340
- function pt(t, e, n) {
341
- const o = e.ink;
342
- t.globalAlpha = e.opacity, t.strokeStyle = tt(o.color, n.fog, w.distance(e.centroid, n.camera.position)), t.lineWidth = o.width, t.beginPath();
343
- for (const [s, a] of e.outline)
344
- t.moveTo(s.x, s.y), t.lineTo(a.x, a.y);
376
+ for (const r of n.triangles) {
377
+ a(r), e(r.layer, r.depth);
378
+ const { color: l, alpha: c } = q(r, n.lights, n.camera, n.fog), [u, g, m] = r.screen;
379
+ t.globalAlpha = c, t.beginPath(), t.moveTo(u.x, u.y), t.lineTo(g.x, g.y), t.lineTo(m.x, m.y), t.closePath(), t.fillStyle = l, t.fill(), c >= 1 && (t.strokeStyle = l, t.lineWidth = 0.75, t.stroke()), r.ink && r.outline.length > 0 && i.push({ objectId: r.objectId, layer: r.layer, depth: r.depth, triangle: r });
380
+ }
381
+ a(), e(1 / 0, -1 / 0), t.restore();
382
+ }
383
+ const Pt = 0.04;
384
+ function Tt(t, n, o) {
385
+ const e = n.ink;
386
+ t.globalAlpha = n.opacity, t.strokeStyle = j(e.color, o.fog, A.distance(n.centroid, o.camera.position)), t.lineWidth = e.width, t.beginPath();
387
+ for (const [i, a] of n.outline)
388
+ t.moveTo(i.x, i.y), t.lineTo(a.x, a.y);
345
389
  t.stroke();
346
390
  }
347
- class vt {
391
+ function Et(t, n = {}) {
392
+ const o = t.width, e = t.height, i = new Uint8ClampedArray(o * e * 4), a = new Float32Array(o * e).fill(1 / 0);
393
+ if (n.under && n.under.length === i.length) i.set(n.under);
394
+ else if (t.background && t.background !== "transparent") {
395
+ const g = N(typeof t.background == "string" ? t.background : t.background.top), m = N(typeof t.background == "string" ? t.background : t.background.bottom);
396
+ for (let v = 0; v < e; v++) {
397
+ const $ = e > 1 ? v / (e - 1) : 0, p = Math.round((g[0] + (m[0] - g[0]) * $) * 255), h = Math.round((g[1] + (m[1] - g[1]) * $) * 255), M = Math.round((g[2] + (m[2] - g[2]) * $) * 255);
398
+ for (let b = 0; b < o; b++) {
399
+ const s = v * o + b;
400
+ i[s * 4] = p, i[s * 4 + 1] = h, i[s * 4 + 2] = M, i[s * 4 + 3] = 255;
401
+ }
402
+ }
403
+ }
404
+ const r = { width: o, height: e, data: i, depth: a };
405
+ let l = -1 / 0;
406
+ const c = [], u = () => {
407
+ for (const g of c) U(r, t, g, !1);
408
+ c.length = 0;
409
+ };
410
+ for (const g of t.triangles)
411
+ g.layer !== l && (u(), l = g.layer, a.fill(1 / 0)), g.opacity < 1 ? c.push(g) : U(r, t, g, !0);
412
+ return u(), r;
413
+ }
414
+ function U(t, n, o, e) {
415
+ const { color: i, alpha: a } = q(o, n.lights, n.camera, n.fog), r = N(i).map((l) => Math.round(l * 255));
416
+ if (Dt(t, o.screen, o.depths, r, a, e), o.ink && o.outline.length > 0) {
417
+ const l = N(j(o.ink.color, n.fog, A.distance(o.centroid, n.camera.position))).map((c) => Math.round(c * 255));
418
+ o.outline.forEach((c, u) => {
419
+ const g = o.outlineDepths[u] ?? [o.depth, o.depth];
420
+ zt(t, c[0], c[1], g, o.ink.width, l, a);
421
+ });
422
+ }
423
+ }
424
+ function rt(t, n, o, e) {
425
+ const i = n * 4;
426
+ if (e >= 1) {
427
+ t[i] = o[0], t[i + 1] = o[1], t[i + 2] = o[2], t[i + 3] = 255;
428
+ return;
429
+ }
430
+ const a = t[i + 3] / 255, r = e + a * (1 - e);
431
+ if (!(r <= 0)) {
432
+ for (let l = 0; l < 3; l++) t[i + l] = Math.round((o[l] * e + t[i + l] * a * (1 - e)) / r);
433
+ t[i + 3] = Math.round(r * 255);
434
+ }
435
+ }
436
+ const Ct = 4e-3;
437
+ function Dt(t, n, o, e, i, a) {
438
+ const [r, l, c] = n, u = (l.x - r.x) * (c.y - r.y) - (l.y - r.y) * (c.x - r.x);
439
+ if (u === 0) return;
440
+ const g = Math.max(0, Math.floor(Math.min(r.x, l.x, c.x))), m = Math.min(t.width - 1, Math.ceil(Math.max(r.x, l.x, c.x))), v = Math.max(0, Math.floor(Math.min(r.y, l.y, c.y))), $ = Math.min(t.height - 1, Math.ceil(Math.max(r.y, l.y, c.y)));
441
+ if (g > m || v > $) return;
442
+ const p = [1 / Math.max(1e-9, o[0]), 1 / Math.max(1e-9, o[1]), 1 / Math.max(1e-9, o[2])], h = u > 0 ? 1 : -1;
443
+ for (let M = v; M <= $; M++) {
444
+ const b = M + 0.5;
445
+ for (let s = g; s <= m; s++) {
446
+ const d = s + 0.5, f = ((l.x - d) * (c.y - b) - (l.y - b) * (c.x - d)) * h, w = ((c.x - d) * (r.y - b) - (c.y - b) * (r.x - d)) * h, x = ((r.x - d) * (l.y - b) - (r.y - b) * (l.x - d)) * h;
447
+ if (f < 0 || w < 0 || x < 0) continue;
448
+ const I = (f + w + x) / (f * p[0] + w * p[1] + x * p[2]), T = M * t.width + s;
449
+ I >= t.depth[T] || (rt(t.data, T, e, i), a && (t.depth[T] = I));
450
+ }
451
+ }
452
+ }
453
+ function zt(t, n, o, e, i, a, r) {
454
+ const l = Math.max(0.5, i / 2), c = Math.max(0, Math.floor(Math.min(n.x, o.x) - l)), u = Math.min(t.width - 1, Math.ceil(Math.max(n.x, o.x) + l)), g = Math.max(0, Math.floor(Math.min(n.y, o.y) - l)), m = Math.min(t.height - 1, Math.ceil(Math.max(n.y, o.y) + l)), v = o.x - n.x, $ = o.y - n.y, p = v * v + $ * $, h = l * l;
455
+ for (let M = g; M <= m; M++) {
456
+ const b = M + 0.5;
457
+ for (let s = c; s <= u; s++) {
458
+ const d = s + 0.5, f = p > 0 ? Math.min(1, Math.max(0, ((d - n.x) * v + (b - n.y) * $) / p)) : 0, w = n.x + v * f, x = n.y + $ * f;
459
+ if ((d - w) ** 2 + (b - x) ** 2 > h) continue;
460
+ const k = (e[0] + (e[1] - e[0]) * f) * (1 - Ct), I = M * t.width + s;
461
+ k > t.depth[I] || rt(t.data, I, a, r);
462
+ }
463
+ }
464
+ }
465
+ function at(t, n) {
466
+ const e = !n.background || n.background === "transparent" ? t.getImageData(0, 0, n.width, n.height).data : void 0, i = Et(n, { under: e }), a = t.createImageData(n.width, n.height);
467
+ a.data.set(i.data), t.putImageData(a, 0, 0), t.save(), t.lineJoin = "round", t.lineCap = "round";
468
+ for (const r of n.drawables)
469
+ t.save(), r.draw(t, n), t.restore();
470
+ t.restore();
471
+ }
472
+ class Yt {
473
+ ctx;
474
+ constructor(n) {
475
+ this.ctx = n;
476
+ }
477
+ render(n) {
478
+ at(this.ctx, n);
479
+ }
480
+ }
481
+ class Wt {
348
482
  renderer;
349
483
  width;
350
484
  height;
@@ -352,87 +486,262 @@ class vt {
352
486
  values = /* @__PURE__ */ new Map();
353
487
  valuesAt;
354
488
  /** `valuesAt`: the values at another time (`(t) => timeline.getStateAtTime(t).values`), for trails */
355
- constructor(e, n) {
356
- this.renderer = e, this.width = n.width, this.height = n.height, this.valuesAt = n.valuesAt;
489
+ constructor(n, o) {
490
+ this.renderer = n, this.width = o.width, this.height = o.height, this.valuesAt = o.valuesAt;
357
491
  }
358
492
  /** Add a scene; its tracks address `<scene.id>/<objectId>`. */
359
- registerScene(e) {
360
- this.scenes.set(e.scene.id, e);
493
+ registerScene(n) {
494
+ this.scenes.set(n.scene.id, n);
361
495
  }
362
- unregisterScene(e) {
363
- this.scenes.delete(e);
496
+ unregisterScene(n) {
497
+ this.scenes.delete(n);
364
498
  }
365
- resize(e, n) {
366
- this.width = e, this.height = n;
499
+ resize(n, o) {
500
+ this.width = n, this.height = o;
367
501
  }
368
- applyState(e) {
369
- this.values = e.values, this.time = e.currentTime ?? this.time;
502
+ applyState(n) {
503
+ this.values = n.values, this.time = n.currentTime ?? this.time;
370
504
  }
371
505
  time = 0;
372
506
  render() {
373
- for (const e of this.scenes.values())
374
- this.renderer.render(Z(e, this.values, { width: this.width, height: this.height, time: this.time, valuesAt: this.valuesAt }));
507
+ for (const n of this.scenes.values())
508
+ this.renderer.render(et(n, this.values, { width: this.width, height: this.height, time: this.time, valuesAt: this.valuesAt }));
375
509
  }
376
510
  }
377
- function kt(t, e, n, o) {
378
- const s = o.stateAt, a = o.valuesAt ?? (s && ((r) => s(r).values));
379
- J(t, Z(e, n ?? /* @__PURE__ */ new Map(), { width: o.width, height: o.height, time: o.time, period: o.period, valuesAt: a }));
511
+ function Ht(t, n, o, e) {
512
+ const i = e.stateAt, a = e.valuesAt ?? (i && ((l) => i(l).values)), r = et(n, o ?? /* @__PURE__ */ new Map(), { width: e.width, height: e.height, time: e.time, period: e.period, valuesAt: a });
513
+ e.depthBuffer ? at(t, r) : st(t, r);
380
514
  }
381
- function Mt(t = {}) {
382
- const e = t.id ?? "penrose", n = t.length ?? 4, o = t.thickness ?? 0.8, s = t.material ?? "penrose", [a, r, f] = t.position ?? [0, 0, 0], l = o / 2, m = (d, c, k) => ({
383
- id: `${e}-${d}`,
515
+ function Lt(t = {}) {
516
+ const n = t.id ?? "penrose", o = t.length ?? 4, e = t.thickness ?? 0.8, i = t.material ?? "penrose", [a, r, l] = t.position ?? [0, 0, 0], c = e / 2, u = (p, h, M) => ({
517
+ id: `${n}-${p}`,
384
518
  kind: "mesh",
385
- geometry: { type: "box", size: [k[0] - c[0], k[1] - c[1], k[2] - c[2]] },
386
- material: s,
387
- position: [a + (c[0] + k[0]) / 2, r + (c[1] + k[1]) / 2, f + (c[2] + k[2]) / 2]
388
- }), A = [
389
- m("x", [-l, -l, -l], [n - l, l, l]),
390
- m("y", [n - l, -l, -l], [n + l, n - l, l]),
391
- m("z", [n - l, n - l, -l], [n + l, n + l, n])
392
- ], y = [a + 2 * n / 3, r + n / 3, f + n / 3], T = (t.distance ?? 20) / Math.sqrt(3), $ = {
393
- id: `${e}-camera`,
519
+ geometry: { type: "box", size: [M[0] - h[0], M[1] - h[1], M[2] - h[2]] },
520
+ material: i,
521
+ position: [a + (h[0] + M[0]) / 2, r + (h[1] + M[1]) / 2, l + (h[2] + M[2]) / 2]
522
+ }), g = [
523
+ u("x", [-c, -c, -c], [o - c, c, c]),
524
+ u("y", [o - c, -c, -c], [o + c, o - c, c]),
525
+ u("z", [o - c, o - c, -c], [o + c, o + c, o])
526
+ ], m = [a + 2 * o / 3, r + o / 3, l + o / 3], v = (t.distance ?? 20) / Math.sqrt(3), $ = {
527
+ id: `${n}-camera`,
394
528
  kind: "camera",
395
529
  projection: "orthographic",
396
- height: n * 1.6,
530
+ height: o * 1.6,
397
531
  near: 0.1,
398
532
  far: (t.distance ?? 20) * 3,
399
- position: [y[0] + T, y[1] + T, y[2] + T],
400
- lookAt: y
533
+ position: [m[0] + v, m[1] + v, m[2] + v],
534
+ lookAt: m
535
+ };
536
+ return { objects: g, camera: $ };
537
+ }
538
+ function _t(t, n) {
539
+ let o;
540
+ for (const e of [...t].sort((i, a) => i.start - a.start)) e.start <= n && (o = e);
541
+ return o;
542
+ }
543
+ function Bt(t) {
544
+ const n = [], o = [...t].sort((i, a) => i.start - a.start), e = /* @__PURE__ */ new Set();
545
+ return o.forEach((i, a) => {
546
+ e.has(i.id) && n.push(`two shots share the id "${i.id}"`), e.add(i.id), i.end > i.start || n.push(`shot "${i.id}" ends before it starts`), a > 0 && i.start < o[a - 1].end && n.push(`shot "${i.id}" starts before "${o[a - 1].id}" ends`), i.transition && a === 0 && n.push(`shot "${i.id}" is first: nothing to transition from`), i.transition && i.transition.duration > i.end - i.start && n.push(`shot "${i.id}": its transition is longer than the shot`);
547
+ }), n;
548
+ }
549
+ function Vt(t, n) {
550
+ const o = [...t].sort((i, a) => i.start - a.start);
551
+ if (o.length === 0) return [];
552
+ const e = o.map((i) => ({ time: i.start, value: i.camera }));
553
+ return [{ id: `${n}-shots`, target: n, property: "activeCamera", keyframes: e }];
554
+ }
555
+ function Zt(t) {
556
+ return [...t].sort((n, o) => n.start - o.start).map((n) => ({ id: n.id, time: n.start, label: n.label ?? n.id }));
557
+ }
558
+ function Gt(t, n) {
559
+ const o = [...t].sort((e, i) => e.start - i.start);
560
+ for (let e = 1; e < o.length; e++) {
561
+ const i = o[e], a = i.transition;
562
+ if (!(!a || a.kind === "cut" || !(a.duration > 0)) && n >= i.start && n < i.start + a.duration)
563
+ return { kind: a.kind, progress: (n - i.start) / a.duration, from: o[e - 1], to: i, direction: a.direction ?? "left", color: a.color ?? "#000000" };
564
+ }
565
+ }
566
+ function Jt(t, n) {
567
+ const o = 6e4 / n.bpm, e = (a) => n.offset + Math.round((a - n.offset) / o) * o, i = [...t].sort((a, r) => a.start - r.start).map((a) => ({ ...a }));
568
+ for (let a = 1; a < i.length; a++) {
569
+ const r = Math.max(i[a - 1].start + 1, e(i[a].start));
570
+ i[a - 1].end = r, i[a].start = r;
571
+ }
572
+ return i;
573
+ }
574
+ function Kt(t, n, o) {
575
+ const e = new Map(t ?? []), i = new Map(e.get(n) ?? []);
576
+ return i.set("activeCamera", o), e.set(n, i), e;
577
+ }
578
+ const B = (t, n, o) => [t[0] + (n[0] - t[0]) * o, t[1] + (n[1] - t[1]) * o, t[2] + (n[2] - t[2]) * o];
579
+ function Ft(t, n, o) {
580
+ const e = { target: [0, 0, 0], yaw: 0, pitch: 15, distance: 8, ...t }, i = { ...e, ...n }, a = B(e.target, i.target, o), r = e.position || i.position ? B(e.position ?? L(e.target, e.yaw, e.pitch, e.distance), i.position ?? L(i.target, i.yaw, i.pitch, i.distance), o) : L(a, e.yaw + (i.yaw - e.yaw) * o, e.pitch + (i.pitch - e.pitch) * o, e.distance + (i.distance - e.distance) * o), l = B(e.lookAt ?? e.target, i.lookAt ?? i.target, o), c = e.fov !== void 0 || i.fov !== void 0 ? (e.fov ?? i.fov) + ((i.fov ?? e.fov) - (e.fov ?? i.fov)) * o : void 0;
581
+ return { position: r, lookAt: l, fov: c };
582
+ }
583
+ function Qt(t) {
584
+ const n = Math.max(1, t.every ?? 33), o = ut(t.easing ?? "ease-in-out"), e = `${t.scene}/${t.camera}`, i = [], a = [], r = [];
585
+ for (let c = t.start; ; c = Math.min(t.end, c + n)) {
586
+ const u = t.end > t.start ? o((c - t.start) / (t.end - t.start)) : 1, g = Ft(t.from, t.to, u);
587
+ if (i.push({ time: c, value: g.position }), a.push({ time: c, value: g.lookAt }), g.fov !== void 0 && r.push({ time: c, value: g.fov }), c >= t.end) break;
588
+ }
589
+ const l = [
590
+ { id: `${e}-move-position`, target: e, property: "position", keyframes: i },
591
+ { id: `${e}-move-lookAt`, target: e, property: "lookAt", keyframes: a }
592
+ ];
593
+ return r.length > 0 && l.push({ id: `${e}-move-fov`, target: e, property: "fov", keyframes: r }), l;
594
+ }
595
+ function Ut(t) {
596
+ const n = Math.max(1, t.every ?? 33), o = t.offset ?? [0, 2, 6], e = t.lag ?? 0, i = `${t.scene}/${t.camera}`, a = [], r = [];
597
+ for (let l = t.start; ; l = Math.min(t.end, l + n)) {
598
+ const c = t.subjectAt(l), u = t.subjectAt(Math.max(t.start, l - e));
599
+ if (a.push({ time: l, value: [u[0] + o[0], u[1] + o[1], u[2] + o[2]] }), r.push({ time: l, value: c }), l >= t.end) break;
600
+ }
601
+ return [
602
+ { id: `${i}-follow-position`, target: i, property: "position", keyframes: a },
603
+ { id: `${i}-follow-lookAt`, target: i, property: "lookAt", keyframes: r }
604
+ ];
605
+ }
606
+ function qt(t, n) {
607
+ const o = `${n.scene}/${n.camera}`, e = n.amount ?? 0.04, i = n.aim ?? 0.08, a = n.rate ?? 1.2, r = Math.max(1, n.every ?? 33), l = n.end - n.start, c = Math.max(1, l), u = Math.max(1, Math.round(c / 1e3 * a)), g = typeof n.seed == "string" ? n.seed : `handheld-${n.seed ?? 0}`, m = (s, d) => gt(s - n.start, { period: c, seed: `${g}-${d}`, cycles: u, octaves: 2 }), v = t.filter((s) => s.target === o), $ = t.filter((s) => s.target !== o), p = (s, d, f) => {
608
+ const w = v.find((k) => k.property === s), x = [];
609
+ if (w)
610
+ for (const k of w.keyframes) {
611
+ const I = k.value;
612
+ x.push({ time: k.time, value: [I[0] + m(k.time, `${s}x`) * d, I[1] + m(k.time, `${s}y`) * d, I[2] + m(k.time, `${s}z`) * d * 0.5], easing: k.easing });
613
+ }
614
+ else if (f)
615
+ for (let k = n.start; x.push({ time: k, value: [f[0] + m(k, `${s}x`) * d, f[1] + m(k, `${s}y`) * d, f[2] + m(k, `${s}z`) * d * 0.5] }), !(k >= n.end); k = Math.min(n.end, k + r))
616
+ ;
617
+ else return;
618
+ return { id: w?.id ?? `${o}-handheld-${s}`, target: o, property: s, keyframes: x };
619
+ }, h = [...$, ...v.filter((s) => s.property !== "position" && s.property !== "lookAt")], M = p("position", e, n.base?.position), b = p("lookAt", i, n.base?.lookAt);
620
+ return M && h.push(M), b && h.push(b), h;
621
+ }
622
+ const V = {
623
+ day: {
624
+ lights: [
625
+ { id: "key", kind: "light", light: "directional", color: "#fff6e0", intensity: 0.95, position: [4, 8, 3] },
626
+ { id: "fill", kind: "light", light: "directional", color: "#cfe3ff", intensity: 0.3, position: [-5, 3, -2] },
627
+ { id: "sky", kind: "light", light: "ambient", color: "#bcd4ea", intensity: 0.4 }
628
+ ],
629
+ background: { top: "#5aa9e6", bottom: "#dff1ff" },
630
+ fog: { color: "#dff1ff", near: 14, far: 40 }
631
+ },
632
+ dusk: {
633
+ lights: [
634
+ { id: "key", kind: "light", light: "directional", color: "#ffb067", intensity: 0.8, position: [6, 2.5, 2] },
635
+ { id: "fill", kind: "light", light: "directional", color: "#7b6bd6", intensity: 0.25, position: [-4, 3, -3] },
636
+ { id: "sky", kind: "light", light: "ambient", color: "#b58ab3", intensity: 0.3 }
637
+ ],
638
+ background: { top: "#4a3a7a", bottom: "#ff9a62" },
639
+ fog: { color: "#d9826f", near: 10, far: 30 }
640
+ },
641
+ night: {
642
+ lights: [
643
+ { id: "key", kind: "light", light: "directional", color: "#9db7ff", intensity: 0.35, position: [-3, 7, 2] },
644
+ { id: "fill", kind: "light", light: "directional", color: "#3b4a7a", intensity: 0.12, position: [4, 2, -3] },
645
+ { id: "sky", kind: "light", light: "ambient", color: "#243357", intensity: 0.25 }
646
+ ],
647
+ background: { top: "#060a1c", bottom: "#1b2650" },
648
+ fog: { color: "#101a3a", near: 6, far: 22 }
649
+ },
650
+ stage: {
651
+ lights: [
652
+ { id: "key", kind: "light", light: "directional", color: "#ffffff", intensity: 0.15, position: [2, 6, 4] },
653
+ { id: "fill", kind: "light", light: "directional", color: "#402040", intensity: 0.08, position: [-4, 3, -2] },
654
+ { id: "sky", kind: "light", light: "ambient", color: "#1a1020", intensity: 0.2 },
655
+ { id: "spot", kind: "light", light: "spot", color: "#ffe9b0", intensity: 1.1, position: [0, 7, 2], target: [0, 0, 0], angle: 22, range: 16 }
656
+ ],
657
+ background: { top: "#05030a", bottom: "#120a1c" },
658
+ fog: { color: "#0a0612", near: 8, far: 24 }
659
+ }
660
+ };
661
+ function jt(t, n = {}) {
662
+ const o = V[t];
663
+ if (!o) throw new Error(`lightingPreset: unknown mood "${t}" (day, dusk, night, stage)`);
664
+ const e = n.prefix ? `${n.prefix}-` : "";
665
+ return {
666
+ objects: o.lights.map((i) => ({ ...i, id: `${e}${i.id}`, position: i.position ? [...i.position] : void 0, target: i.target ? [...i.target] : void 0 })),
667
+ background: { ...o.background },
668
+ fog: { ...o.fog }
669
+ };
670
+ }
671
+ function tn(t, n, o) {
672
+ const e = V[t], i = V[n];
673
+ if (!e || !i) throw new Error(`lightingTracks: unknown mood "${e ? n : t}" (day, dusk, night, stage)`);
674
+ const a = o.prefix ? `${o.prefix}-` : "", r = /* @__PURE__ */ new Set([...e.lights.map((c) => c.id), ...i.lights.map((c) => c.id)]), l = [];
675
+ for (const c of r) {
676
+ const u = e.lights.find((b) => b.id === c), g = i.lights.find((b) => b.id === c), m = `${o.scene}/${a}${c}`, v = (b, s, d) => {
677
+ const f = [{ time: o.start, value: s }, { time: o.end, value: d, easing: o.easing ?? "ease-in-out" }];
678
+ l.push({ id: `${m}-${b}`, target: m, property: b, keyframes: f });
679
+ };
680
+ v("intensity", u?.intensity ?? 0, g?.intensity ?? 0), v("color", u?.color ?? g.color, g?.color ?? u.color);
681
+ const $ = u?.position ?? g?.position, p = g?.position ?? u?.position;
682
+ $ && p && v("position", [...$], [...p]);
683
+ const h = u?.target ?? g?.target, M = g?.target ?? u?.target;
684
+ h && M && v("target", [...h], [...M]);
685
+ }
686
+ return l;
687
+ }
688
+ function nn(t = {}) {
689
+ const n = t.id ?? "ground", o = t.size ?? 24;
690
+ return {
691
+ objects: [{ id: n, kind: "mesh", layer: -1, geometry: { type: "plane", size: [o, o], segments: t.segments ?? 24 }, material: n, position: [0, t.y ?? 0, 0] }],
692
+ materials: { [n]: { color: t.color ?? "#3b4252", shading: "flat" } }
401
693
  };
402
- return { objects: A, camera: $ };
403
694
  }
404
695
  export {
405
- mt as Canvas2DRenderer,
406
- It as MeshBuilder,
407
- vt as Scene3DAdapter,
408
- Pt as boxMesh,
409
- St as coneMesh,
410
- Tt as cylinderMesh,
411
- wt as dollyPosition,
412
- J as drawResolvedScene,
413
- kt as drawScene3D,
414
- Ct as extrudeMesh,
415
- x as fogAmount,
416
- Et as geometryMesh,
417
- tt as inkColor,
418
- Ht as lightAt,
419
- $t as loadScene3D,
420
- et as lookAtView,
421
- Dt as meshEdges,
422
- yt as orbitPosition,
423
- R as parseColor,
424
- Mt as penroseTriangle3D,
425
- Ot as planeMesh,
426
- Ft as pointInPolygon,
427
- zt as prepareMesh,
428
- V as projectionMatrix,
429
- Nt as rawMesh,
430
- Z as resolveScene3D,
431
- H as rollView,
432
- j as shadeTriangle,
433
- Wt as signedArea,
434
- Rt as sphereMesh,
435
- Vt as torusMesh,
436
- Lt as triangulate,
437
- Yt as validateScene3D
696
+ Xt as Canvas2DRenderer,
697
+ V as LIGHTING_PRESETS,
698
+ sn as MeshBuilder,
699
+ Wt as Scene3DAdapter,
700
+ Yt as SoftwareRenderer,
701
+ rn as boxMesh,
702
+ Ut as cameraFollowTracks,
703
+ qt as cameraHandheldTracks,
704
+ Qt as cameraMoveTracks,
705
+ Ft as cameraPoseAt,
706
+ Bt as checkShots,
707
+ an as coneMesh,
708
+ cn as cylinderMesh,
709
+ Rt as dollyPosition,
710
+ st as drawResolvedScene,
711
+ at as drawResolvedSceneWithDepth,
712
+ Ht as drawScene3D,
713
+ ln as extrudeMesh,
714
+ pt as fogAmount,
715
+ dn as geometryMesh,
716
+ nn as ground,
717
+ j as inkColor,
718
+ xn as lightAt,
719
+ jt as lightingPreset,
720
+ tn as lightingTracks,
721
+ hn as loadScene3D,
722
+ yt as lookAtView,
723
+ fn as meshEdges,
724
+ L as orbitPosition,
725
+ N as parseColor,
726
+ Lt as penroseTriangle3D,
727
+ un as planeMesh,
728
+ gn as pointInPolygon,
729
+ pn as prepareMesh,
730
+ J as projectionMatrix,
731
+ Et as rasterizeResolvedScene,
732
+ yn as rawMesh,
733
+ et as resolveScene3D,
734
+ tt as rollView,
735
+ q as shadeTriangle,
736
+ _t as shotAt,
737
+ Zt as shotMarkers,
738
+ Vt as shotTracks,
739
+ mn as signedArea,
740
+ Jt as snapShotsToBeats,
741
+ kn as sphereMesh,
742
+ wn as torusMesh,
743
+ Gt as transitionAt,
744
+ Mn as triangulate,
745
+ vn as validateScene3D,
746
+ Kt as withActiveCamera
438
747
  };