@algorisys/tinyfly 0.108.0 → 0.109.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.
@@ -1,484 +1,464 @@
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 = [];
1
+ import { M as _t, b as Bt, c as Vt, a as Zt, e as Gt, g as Jt, l as Kt, m as Ut, p as Qt, d as qt, f as jt, r as tn, s as nn, h as on, t as en, i as sn, v as rn } from "./load-scene-oWNsYYC1.js";
2
+ import { mat4 as C, ribbon as at, ribbonHeadCap as ct, vec3 as A, quat as X, trailSamples as lt } from "@algorisys/tinyfly";
3
+ import { l as dt, r as ht, p as Z } from "./shots-DR_ViiAC.js";
4
+ import { c as cn, a as ln, b as dn, d as hn, e as gn, f as fn, o as un, s as pn, g as yn, h as mn, i as kn, t as wn, w as Mn } from "./shots-DR_ViiAC.js";
5
+ import { p as F, f as gt, s as U, i as Q } from "./shading-0lPgnXmD.js";
6
+ import { l as vn } from "./shading-0lPgnXmD.js";
7
+ function ft(t, n, o, i) {
8
+ const { camera: r } = i, l = r.near, s = t.map((g) => C.transformPoint(r.view, g)), c = r.projection[5] * i.height / 2, a = (g, d) => o.width * (1 - o.taper * g) * c / (r.orthographic ? 1 : Math.max(d, l)), y = F(o.color), p = [];
29
9
  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
- const $ = [];
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;
10
+ const M = (g) => -g[2] >= l;
11
+ for (let g = 0; g < s.length; g++) {
12
+ const d = s[g];
13
+ M(d) ? (m.length === 0 && g > 0 && !M(s[g - 1]) && m.push(G(s[g - 1], d, n[g - 1], n[g], l)), m.push({ view: d, age: n[g] })) : m.length > 0 && (m.push(G(s[g - 1], d, n[g - 1], n[g], l)), p.push(m), m = []);
14
+ }
15
+ m.length > 0 && p.push(m);
16
+ const I = [];
17
+ for (const g of p) {
18
+ if (g.length < 2) continue;
19
+ const d = g.map((h) => -h.view[2]), b = g.map((h) => i.toScreen(h.view)).map((h, k) => ({ x: h.x, y: h.y, width: a(g[k].age, d[k]) })), e = at(b), f = g[g.length - 1].age === 0 ? ct(b) : null;
20
+ for (let h = 0; h + 1 < g.length; h++) {
21
+ const k = (d[h] + d[h + 1]) / 2;
22
+ if (k > r.far) continue;
23
+ let v = o.opacity * (1 - o.fade * ((g[h].age + g[h + 1].age) / 2));
24
+ const x = A.lerp(g[h].view, g[h + 1].view, 0.5), P = gt(i.fog, A.length(x));
25
+ let T = y;
26
+ if (i.fog && P > 0)
27
+ if (o.additive) v *= 1 - P;
48
28
  else {
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];
29
+ const u = F(i.fog.color);
30
+ T = [y[0] + (u[0] - y[0]) * P, y[1] + (u[1] - y[1]) * P, y[2] + (u[2] - y[2]) * P];
51
31
  }
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
- $.push({
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());
32
+ if (v <= 0) continue;
33
+ const D = `rgb(${T.map((u) => Math.round(Math.min(1, Math.max(0, u)) * 255)).join(", ")})`, S = [e.left[h], e.left[h + 1], e.right[h + 1], e.right[h]], $ = h + 2 === g.length ? f : null;
34
+ I.push({
35
+ depth: k,
36
+ draw(u) {
37
+ o.additive && (u.globalCompositeOperation = "lighter"), u.globalAlpha = Math.min(1, v), u.fillStyle = D, u.beginPath(), u.moveTo(S[0].x, S[0].y), u.lineTo(S[1].x, S[1].y), $ && u.arc($.x, $.y, $.radius, $.start, $.start - Math.PI, !0), u.lineTo(S[2].x, S[2].y), u.lineTo(S[3].x, S[3].y), u.closePath(), u.fill(), !o.additive && v >= 1 && (u.strokeStyle = D, u.lineWidth = 0.75, u.stroke());
58
38
  }
59
39
  });
60
40
  }
61
41
  }
62
- return $;
42
+ return I;
63
43
  }
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 };
44
+ function G(t, n, o, i, r) {
45
+ const l = (-r - t[2]) / (n[2] - t[2]);
46
+ return { view: A.lerp(t, n, l), age: o + (i - o) * l };
67
47
  }
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]
48
+ const ut = Math.cos(30 * Math.PI / 180), q = /* @__PURE__ */ new Map(), E = (t) => typeof t == "number" ? t : void 0, W = (t, n) => Array.isArray(t) && t.length === n ? t : void 0;
49
+ function j(t, n) {
50
+ const o = t.position ?? [0, 0, 0], i = W(n.get("position"), 3) ?? [
51
+ E(n.get("x")) ?? o[0],
52
+ E(n.get("y")) ?? o[1],
53
+ E(n.get("z")) ?? o[2]
74
54
  ];
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]
55
+ let r;
56
+ const l = W(n.get("quaternion"), 4), s = ["rotateX", "rotateY", "rotateZ"].map((p) => E(n.get(p)));
57
+ if (l) r = X.normalize(l);
58
+ else if (s.some((p) => p !== void 0)) {
59
+ const p = t.rotation ?? [0, 0, 0];
60
+ r = X.fromEuler(s[0] ?? p[0], s[1] ?? p[1], s[2] ?? p[2]);
61
+ } else t.quaternion ? r = X.normalize(t.quaternion) : r = t.rotation ? X.fromEuler(...t.rotation) : X.identity();
62
+ const c = typeof t.scale == "number" ? [t.scale, t.scale, t.scale] : t.scale ?? [1, 1, 1], a = E(n.get("scale")), y = [
63
+ E(n.get("scaleX")) ?? a ?? c[0],
64
+ E(n.get("scaleY")) ?? a ?? c[1],
65
+ E(n.get("scaleZ")) ?? a ?? c[2]
86
66
  ];
87
- return P.compose(e, i, u);
67
+ return C.compose(i, r, y);
88
68
  }
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);
69
+ const B = (t) => [t[12], t[13], t[14]];
70
+ function pt(t, n, o, i) {
71
+ const r = B(n), l = W(o.get("lookAt"), 3) ?? t.lookAt, s = E(o.get("roll")) ?? t.roll ?? 0, c = l ? dt(r, l, { up: t.up, roll: s }) : ht(C.invert(n) ?? C.identity(), s), a = t.projection === "perspective" ? Z({ ...t, fov: E(o.get("fov")) ?? t.fov }, i) : Z({ ...t, height: E(o.get("height")) ?? t.height }, i);
92
72
  return {
93
73
  id: t.id,
94
- view: l,
95
- projection: c,
96
- position: i,
97
- forward: A.normalize([-l[2], -l[6], -l[10]]),
74
+ view: c,
75
+ projection: a,
76
+ position: r,
77
+ forward: A.normalize([-c[2], -c[6], -c[10]]),
98
78
  orthographic: t.projection === "orthographic",
99
79
  near: t.near,
100
80
  far: t.far
101
81
  };
102
82
  }
103
- function Q(t) {
104
- return P.transpose(P.invert(t) ?? P.identity());
83
+ function J(t) {
84
+ return C.transpose(C.invert(t) ?? C.identity());
105
85
  }
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]);
86
+ function yt(t, n, o, i) {
87
+ return A.normalize([t[0] * n + t[4] * o + t[8] * i, t[1] * n + t[5] * o + t[9] * i, t[2] * n + t[6] * o + t[10] * i]);
108
88
  }
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));
89
+ function mt(t, n) {
90
+ const o = (r) => -r[2] >= n, i = [];
91
+ for (let r = 0; r < t.length; r++) {
92
+ const l = t[r], s = t[(r + 1) % t.length];
93
+ if (o(l) && i.push(l), o(l) !== o(s)) {
94
+ const c = (-n - l[2]) / (s[2] - l[2]);
95
+ i.push(A.lerp(l, s, c));
116
96
  }
117
97
  }
118
- return e;
98
+ return i;
119
99
  }
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);
100
+ function kt(t, n, o, i = 16) {
101
+ const r = [t[0], t[1], t[2]], l = [0, 1, 0], s = [];
102
+ for (let a = 0; a < i; a++) {
103
+ const y = a / i * Math.PI * 2;
104
+ r.push(t[0] + Math.cos(y) * n, t[1], t[2] + Math.sin(y) * o), l.push(0, 1, 0);
125
105
  }
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 };
106
+ for (let a = 0; a < i; a++) s.push(0, 1 + (a + 1) % i, 1 + a);
107
+ const c = Array.from({ length: i }, () => []);
108
+ return { positions: r, normals: l, indices: s, faceEdges: c };
129
109
  }
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;
110
+ function wt(t, n) {
111
+ const o = E(n.get("outlineWidth")) ?? t.outline?.width, i = n.get("outlineColor"), r = (typeof i == "string" ? i : void 0) ?? t.outline?.color ?? "#000000";
112
+ return o !== void 0 && o > 0 ? { width: o, color: r } : void 0;
133
113
  }
134
- function At(t, n) {
114
+ function Mt(t, n) {
135
115
  return !t || t.to <= t.from ? 1 : Math.min(1, Math.max(0, (n - t.from) / (t.to - t.from)));
136
116
  }
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));
144
- }
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 };
148
- }, $ = [];
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");
152
- $.push({
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
117
+ function tt(t, n = /* @__PURE__ */ new Map(), o) {
118
+ const { scene: i } = t, r = (e) => n.get(`${i.id}/${e}`) ?? q, l = o.nearFade ?? i.nearFade, s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
119
+ for (const e of i.objects) {
120
+ const f = r(e.id), h = j(e, f), k = e.parent ? s.get(e.parent) : void 0;
121
+ s.set(e.id, k ? C.multiply(k, h) : h);
122
+ const v = E(f.get("visible")) !== void 0 ? E(f.get("visible")) > 0.5 : e.visible !== !1;
123
+ c.set(e.id, v && (e.parent ? c.get(e.parent) !== !1 : !0));
124
+ }
125
+ const a = n.get(i.id)?.get("activeCamera"), y = typeof a == "string" && i.objects.some((e) => e.id === a && e.kind === "camera") ? a : i.camera, p = i.objects.find((e) => e.id === y), m = pt(p, s.get(y), r(y), o.width / o.height), M = (e) => {
126
+ const f = C.transformPoint(m.projection, e);
127
+ return { x: (f[0] + 1) / 2 * o.width, y: (1 - f[1]) / 2 * o.height };
128
+ }, I = [];
129
+ for (const e of i.objects) {
130
+ if (e.kind !== "light" || !c.get(e.id)) continue;
131
+ const f = r(e.id), h = B(s.get(e.id)), k = W(f.get("target"), 3) ?? e.target ?? [0, 0, 0], v = f.get("color");
132
+ I.push({
133
+ id: e.id,
134
+ light: e.light,
135
+ color: typeof v == "string" ? v : e.color,
136
+ intensity: E(f.get("intensity")) ?? e.intensity,
137
+ position: h,
138
+ direction: A.normalize(A.subtract(k, h)),
139
+ range: e.range,
140
+ angle: e.angle ?? 30
161
141
  });
162
142
  }
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);
143
+ const g = [], d = [];
144
+ i.objects.forEach((e, f) => {
145
+ if (e.kind !== "mesh" || !c.get(e.id)) return;
146
+ const h = t.meshes.get(e.id), k = i.materials?.[e.material];
147
+ if (!h || !k) return;
148
+ const v = r(e.id), x = s.get(e.id), P = J(x), T = v.get("color"), D = (E(v.get("opacity")) ?? 1) * (k.opacity ?? 1);
169
149
  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,
150
+ const S = wt(k, v), $ = S === k.outline || S && k.outline && S.width === k.outline.width && S.color === k.outline.color ? k : { ...k, outline: S };
151
+ d.push({ objectId: e.id, objectIndex: f, mesh: h, world: x, material: $, color: typeof T == "string" ? T : void 0, opacity: D }), g.push(...L(h, x, P, m, M, $, {
152
+ objectId: e.id,
153
+ objectIndex: f,
154
+ layer: e.layer ?? 0,
175
155
  color: typeof T == "string" ? T : void 0,
176
156
  opacity: D,
177
157
  ink: S,
178
- nearFade: a
158
+ nearFade: l
179
159
  }));
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]);
160
+ }), i.objects.forEach((e, f) => {
161
+ if (e.kind !== "mesh" || !e.shadow || !c.get(e.id)) return;
162
+ const h = t.meshes.get(e.id);
163
+ if (!h) return;
164
+ const k = r(e.id);
165
+ if ((E(k.get("opacity")) ?? 1) <= 0) return;
166
+ const v = s.get(e.id), x = e.shadow === !0 ? {} : e.shadow, P = x.ground ?? i.ground ?? 0;
167
+ let T = 1 / 0, D = -1 / 0, S = 1 / 0, $ = 1 / 0, u = -1 / 0;
168
+ for (let O = 0; O < h.positions.length; O += 3) {
169
+ const R = C.transformPoint(v, [h.positions[O], h.positions[O + 1], h.positions[O + 2]]);
170
+ T = Math.min(T, R[0]), D = Math.max(D, R[0]), S = Math.min(S, R[1]), $ = Math.min($, R[2]), u = Math.max(u, R[2]);
191
171
  }
192
- const z = Math.max(D - T, y - E);
172
+ const z = Math.max(D - T, u - $);
193
173
  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);
174
+ const Y = Math.max(0, S - P), N = Math.min(1, Y / (2 * z)), H = (x.opacity ?? 0.22) * (1 - N * 0.8);
195
175
  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,
176
+ const V = 1.1 + N * 0.4, st = kt([(T + D) / 2, P + 2e-3, ($ + u) / 2], (D - T) / 2 * V, (u - $) / 2 * V), rt = { color: "#000000", shading: "unlit", opacity: H };
177
+ g.push(...L(st, C.identity(), C.identity(), m, M, rt, {
178
+ objectId: `${e.id}:shadow`,
179
+ objectIndex: f - 0.5,
180
+ layer: e.layer ?? 0,
201
181
  opacity: H,
202
- nearFade: a
182
+ nearFade: l
203
183
  }));
204
184
  });
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),
185
+ const w = [];
186
+ i.objects.forEach((e, f) => {
187
+ const h = t.kinds.get(e.kind);
188
+ if (!h || !c.get(e.id)) return;
189
+ const k = h.resolve({
190
+ object: e,
191
+ prepared: t.prepared.get(e.id),
192
+ values: r(e.id),
193
+ world: s.get(e.id),
214
194
  camera: m,
215
- lights: $,
216
- fog: e.fog,
195
+ lights: I,
196
+ fog: i.fog,
217
197
  width: o.width,
218
198
  height: o.height,
219
- toScreen: v
199
+ toScreen: M
220
200
  });
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,
231
- nearFade: a
201
+ if (!k) return;
202
+ const v = e.layer ?? 0;
203
+ for (const x of k.drawables ?? []) w.push({ ...x, objectId: e.id, objectIndex: f, layer: v });
204
+ for (const x of k.meshes ?? [])
205
+ d.push({ objectId: e.id, objectIndex: f, mesh: x.mesh, world: x.world, material: x.material, opacity: x.material.opacity ?? 1 }), g.push(...L(x.mesh, x.world, J(x.world), m, M, x.material, {
206
+ objectId: e.id,
207
+ objectIndex: f,
208
+ layer: v,
209
+ opacity: x.material.opacity ?? 1,
210
+ ink: x.material.outline,
211
+ nearFade: l
232
212
  }));
233
213
  });
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,
214
+ const b = { camera: m, height: o.height, fog: i.fog, toScreen: M };
215
+ return i.objects.forEach((e, f) => {
216
+ if (e.kind !== "line" && e.kind !== "trail" || !c.get(e.id)) return;
217
+ const h = r(e.id), k = e.kind === "line" ? vt(e, s.get(e.id)) : xt(e, i, n, o);
218
+ if (!k) return;
219
+ const v = bt(e, h);
220
+ if (v.opacity <= 0 || v.width <= 0) return;
221
+ const x = e.layer ?? 0;
222
+ for (const P of ft(k.points, k.ages, v, b)) w.push({ ...P, objectId: e.id, objectIndex: f, layer: x });
223
+ }), w.sort((e, f) => e.layer - f.layer || f.depth - e.depth || e.objectIndex - f.objectIndex), g.sort((e, f) => e.layer - f.layer || f.depth - e.depth || e.objectIndex - f.objectIndex || e.face - f.face || e.part - f.part), {
224
+ id: i.id,
245
225
  width: o.width,
246
226
  height: o.height,
247
- background: e.background,
248
- fog: e.fog,
227
+ background: i.background,
228
+ fog: i.fog,
249
229
  camera: m,
250
- lights: $,
251
- worlds: r,
252
- triangles: p,
253
- drawables: M,
254
- meshes: h,
230
+ lights: I,
231
+ worlds: s,
232
+ triangles: g,
233
+ drawables: w,
234
+ meshes: d,
255
235
  time: o.time ?? 0
256
236
  };
257
237
  }
258
- function $t(t, n) {
259
- const o = n.get("color"), e = t.kind === "trail";
238
+ function bt(t, n) {
239
+ const o = n.get("color"), i = t.kind === "trail";
260
240
  return {
261
241
  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),
242
+ width: E(n.get("width")) ?? t.width ?? 0.05,
243
+ taper: t.taper ?? (i ? 1 : 0),
244
+ fade: t.fade ?? (i ? 1 : 0),
245
+ opacity: (E(n.get("opacity")) ?? 1) * (t.opacity ?? 1),
266
246
  additive: t.blend === "add"
267
247
  };
268
248
  }
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)) };
272
- }
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 }
249
+ function vt(t, n) {
250
+ const i = (t.closed ? [...t.points, t.points[0]] : t.points).map((r) => C.transformPoint(n, r));
251
+ return { points: i, ages: i.map((r, l) => 1 - l / (i.length - 1)) };
252
+ }
253
+ function xt(t, n, o, i) {
254
+ if (!i.valuesAt) return null;
255
+ const r = i.time ?? 0, l = E(o.get(`${n.id}/${t.id}`)?.get("length")) ?? t.length, s = lt(
256
+ (c) => B(nt(n, t.follow, c === r ? o : i.valuesAt(c))),
257
+ r,
258
+ { length: l, samples: t.samples ?? 32, period: t.period ?? i.period }
279
259
  );
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]]));
260
+ return s.length >= 2 ? { points: s.map((c) => c.at), ages: s.map((c) => c.age) } : null;
261
+ }
262
+ function nt(t, n, o) {
263
+ const i = t.objects.find((l) => l.id === n);
264
+ if (!i) return C.identity();
265
+ const r = j(i, o.get(`${t.id}/${n}`) ?? q);
266
+ return i.parent ? C.multiply(nt(t, i.parent, o), r) : r;
267
+ }
268
+ function L(t, n, o, i, r, l, s) {
269
+ const c = t.positions.length / 3, a = [], y = [];
270
+ for (let d = 0; d < c; d++) {
271
+ const w = C.transformPoint(n, [t.positions[d * 3], t.positions[d * 3 + 1], t.positions[d * 3 + 2]]);
272
+ a.push(w), y.push(C.transformPoint(i.view, w));
273
+ }
274
+ const p = t.indices.length / 3, m = [], M = [];
275
+ for (let d = 0; d < p; d++) {
276
+ const [w, b, e] = [0, 1, 2].map((k) => a[t.indices[d * 3 + k]]), f = A.normalize(A.cross(A.subtract(b, w), A.subtract(e, w)));
277
+ m.push(f);
278
+ const h = i.orthographic ? A.scale(i.forward, -1) : A.subtract(i.position, w);
279
+ M.push(A.dot(f, h) > 0);
280
+ }
281
+ const I = (d) => -y[d][2] >= i.near, g = [];
282
+ for (let d = 0; d < p; d++) {
283
+ const w = M[d];
284
+ if (!w && !l.doubleSided) continue;
285
+ const b = [t.indices[d * 3], t.indices[d * 3 + 1], t.indices[d * 3 + 2]], e = b.map((u) => y[u]);
286
+ if (e.every((u) => -u[2] > i.far)) continue;
287
+ const f = mt(e, i.near);
288
+ if (f.length < 3) continue;
289
+ const h = w ? 1 : -1, k = A.scale(m[d], h), v = b.map((u) => A.scale(yt(o, t.normals[u * 3], t.normals[u * 3 + 1], t.normals[u * 3 + 2]), h)), x = A.scale(A.add(A.add(a[b[0]], a[b[1]]), a[b[2]]), 1 / 3), P = -(e[0][2] + e[1][2] + e[2][2]) / 3, T = [], D = [];
290
+ if (s.ink && w)
291
+ for (const u of t.faceEdges[d]) {
292
+ const z = u.across, Y = z === -1 || !M[z], N = l.creases !== !1 && !Y && d < z && A.dot(m[d], m[z]) < ut;
293
+ (Y || N) && I(u.a) && I(u.b) && (T.push([r(y[u.a]), r(y[u.b])]), D.push([-y[u.a][2], -y[u.b][2]]));
314
294
  }
315
- const S = r.opacity * At(r.nearFade, I);
295
+ const S = s.opacity * Mt(s.nearFade, P);
316
296
  if (S <= 0) continue;
317
- const E = d.map(i);
318
- for (let y = 1; y + 1 < E.length; y++)
319
- p.push({
320
- objectId: r.objectId,
321
- objectIndex: r.objectIndex,
322
- layer: r.layer,
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,
331
- material: a,
332
- color: r.color ?? t.faceColors?.[h],
297
+ const $ = f.map(r);
298
+ for (let u = 1; u + 1 < $.length; u++)
299
+ g.push({
300
+ objectId: s.objectId,
301
+ objectIndex: s.objectIndex,
302
+ layer: s.layer,
303
+ face: d,
304
+ part: u - 1,
305
+ screen: [$[0], $[u], $[u + 1]],
306
+ depth: P,
307
+ depths: [-f[0][2], -f[u][2], -f[u + 1][2]],
308
+ centroid: x,
309
+ normal: k,
310
+ vertexNormals: v,
311
+ material: l,
312
+ color: s.color ?? t.faceColors?.[d],
333
313
  opacity: S,
334
- outline: y === 1 ? T : [],
335
- outlineDepths: y === 1 ? D : [],
336
- ink: r.ink
314
+ outline: u === 1 ? T : [],
315
+ outlineDepths: u === 1 ? D : [],
316
+ ink: s.ink
337
317
  });
338
318
  }
339
- return p;
319
+ return g;
340
320
  }
341
- class Xt {
321
+ class zt {
342
322
  ctx;
343
323
  constructor(n) {
344
324
  this.ctx = n;
345
325
  }
346
326
  render(n) {
347
- st(this.ctx, n);
327
+ ot(this.ctx, n);
348
328
  }
349
329
  }
350
- function st(t, n) {
330
+ function ot(t, n) {
351
331
  if (t.save(), n.background && n.background !== "transparent") {
352
332
  if (typeof n.background == "string") t.fillStyle = n.background;
353
333
  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;
334
+ const s = t.createLinearGradient(0, 0, 0, n.height);
335
+ s.addColorStop(0, n.background.top), s.addColorStop(1, n.background.bottom), t.fillStyle = s;
356
336
  }
357
337
  t.fillRect(0, 0, n.width, n.height);
358
338
  }
359
339
  t.lineJoin = "round", t.lineCap = "round";
360
340
  let o = 0;
361
- const e = (r, l) => {
341
+ const i = (s, c) => {
362
342
  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++;
343
+ const a = n.drawables[o];
344
+ if (a.layer > s || a.layer === s && a.depth <= c) break;
345
+ t.save(), a.draw(t, n), t.restore(), o++;
366
346
  }
367
347
  };
368
- let i = [];
369
- const a = (r) => {
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;
348
+ let r = [];
349
+ const l = (s) => {
350
+ if (r.length === 0) return;
351
+ const c = [];
352
+ for (const a of r)
353
+ s && s.objectId === a.objectId && s.layer === a.layer && a.depth - s.depth <= It * a.depth ? c.push(a) : At(t, a.triangle, n);
354
+ r = c;
375
355
  };
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);
356
+ for (const s of n.triangles) {
357
+ l(s), i(s.layer, s.depth);
358
+ const { color: c, alpha: a } = U(s, n.lights, n.camera, n.fog), [y, p, m] = s.screen;
359
+ t.globalAlpha = a, t.beginPath(), t.moveTo(y.x, y.y), t.lineTo(p.x, p.y), t.lineTo(m.x, m.y), t.closePath(), t.fillStyle = c, t.fill(), a >= 1 && (t.strokeStyle = c, t.lineWidth = 0.75, t.stroke()), s.ink && s.outline.length > 0 && r.push({ objectId: s.objectId, layer: s.layer, depth: s.depth, triangle: s });
360
+ }
361
+ l(), i(1 / 0, -1 / 0), t.restore();
362
+ }
363
+ const It = 0.04;
364
+ function At(t, n, o) {
365
+ const i = n.ink;
366
+ t.globalAlpha = n.opacity, t.strokeStyle = Q(i.color, o.fog, A.distance(n.centroid, o.camera.position)), t.lineWidth = i.width, t.beginPath();
367
+ for (const [r, l] of n.outline)
368
+ t.moveTo(r.x, r.y), t.lineTo(l.x, l.y);
389
369
  t.stroke();
390
370
  }
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);
371
+ function St(t, n = {}) {
372
+ const o = t.width, i = t.height, r = new Uint8ClampedArray(o * i * 4), l = new Float32Array(o * i).fill(1 / 0);
373
+ if (n.under && n.under.length === r.length) r.set(n.under);
394
374
  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);
375
+ const p = F(typeof t.background == "string" ? t.background : t.background.top), m = F(typeof t.background == "string" ? t.background : t.background.bottom);
376
+ for (let M = 0; M < i; M++) {
377
+ const I = i > 1 ? M / (i - 1) : 0, g = Math.round((p[0] + (m[0] - p[0]) * I) * 255), d = Math.round((p[1] + (m[1] - p[1]) * I) * 255), w = Math.round((p[2] + (m[2] - p[2]) * I) * 255);
398
378
  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;
379
+ const e = M * o + b;
380
+ r[e * 4] = g, r[e * 4 + 1] = d, r[e * 4 + 2] = w, r[e * 4 + 3] = 255;
401
381
  }
402
382
  }
403
383
  }
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;
384
+ const s = { width: o, height: i, data: r, depth: l };
385
+ let c = -1 / 0;
386
+ const a = [], y = () => {
387
+ for (const p of a) K(s, t, p, !1);
388
+ a.length = 0;
409
389
  };
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);
390
+ for (const p of t.triangles)
391
+ p.layer !== c && (y(), c = p.layer, l.fill(1 / 0)), p.opacity < 1 ? a.push(p) : K(s, t, p, !0);
392
+ return y(), s;
393
+ }
394
+ function K(t, n, o, i) {
395
+ const { color: r, alpha: l } = U(o, n.lights, n.camera, n.fog), s = F(r).map((c) => Math.round(c * 255));
396
+ if (Tt(t, o.screen, o.depths, s, l, i), o.ink && o.outline.length > 0) {
397
+ const c = F(Q(o.ink.color, n.fog, A.distance(o.centroid, n.camera.position))).map((a) => Math.round(a * 255));
398
+ o.outline.forEach((a, y) => {
399
+ const p = o.outlineDepths[y] ?? [o.depth, o.depth];
400
+ $t(t, a[0], a[1], p, o.ink.width, c, l);
421
401
  });
422
402
  }
423
403
  }
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;
404
+ function it(t, n, o, i) {
405
+ const r = n * 4;
406
+ if (i >= 1) {
407
+ t[r] = o[0], t[r + 1] = o[1], t[r + 2] = o[2], t[r + 3] = 255;
428
408
  return;
429
409
  }
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));
410
+ const l = t[r + 3] / 255, s = i + l * (1 - i);
411
+ if (!(s <= 0)) {
412
+ for (let c = 0; c < 3; c++) t[r + c] = Math.round((o[c] * i + t[r + c] * l * (1 - i)) / s);
413
+ t[r + 3] = Math.round(s * 255);
414
+ }
415
+ }
416
+ const Pt = 4e-3;
417
+ function Tt(t, n, o, i, r, l) {
418
+ const [s, c, a] = n, y = (c.x - s.x) * (a.y - s.y) - (c.y - s.y) * (a.x - s.x);
419
+ if (y === 0) return;
420
+ const p = Math.max(0, Math.floor(Math.min(s.x, c.x, a.x))), m = Math.min(t.width - 1, Math.ceil(Math.max(s.x, c.x, a.x))), M = Math.max(0, Math.floor(Math.min(s.y, c.y, a.y))), I = Math.min(t.height - 1, Math.ceil(Math.max(s.y, c.y, a.y)));
421
+ if (p > m || M > I) return;
422
+ const g = [1 / Math.max(1e-9, o[0]), 1 / Math.max(1e-9, o[1]), 1 / Math.max(1e-9, o[2])], d = y > 0 ? 1 : -1;
423
+ for (let w = M; w <= I; w++) {
424
+ const b = w + 0.5;
425
+ for (let e = p; e <= m; e++) {
426
+ const f = e + 0.5, h = ((c.x - f) * (a.y - b) - (c.y - b) * (a.x - f)) * d, k = ((a.x - f) * (s.y - b) - (a.y - b) * (s.x - f)) * d, v = ((s.x - f) * (c.y - b) - (s.y - b) * (c.x - f)) * d;
427
+ if (h < 0 || k < 0 || v < 0) continue;
428
+ const P = (h + k + v) / (h * g[0] + k * g[1] + v * g[2]), T = w * t.width + e;
429
+ P >= t.depth[T] || (it(t.data, T, i, r), l && (t.depth[T] = P));
450
430
  }
451
431
  }
452
432
  }
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);
433
+ function $t(t, n, o, i, r, l, s) {
434
+ const c = Math.max(0.5, r / 2), a = Math.max(0, Math.floor(Math.min(n.x, o.x) - c)), y = Math.min(t.width - 1, Math.ceil(Math.max(n.x, o.x) + c)), p = Math.max(0, Math.floor(Math.min(n.y, o.y) - c)), m = Math.min(t.height - 1, Math.ceil(Math.max(n.y, o.y) + c)), M = o.x - n.x, I = o.y - n.y, g = M * M + I * I, d = c * c;
435
+ for (let w = p; w <= m; w++) {
436
+ const b = w + 0.5;
437
+ for (let e = a; e <= y; e++) {
438
+ const f = e + 0.5, h = g > 0 ? Math.min(1, Math.max(0, ((f - n.x) * M + (b - n.y) * I) / g)) : 0, k = n.x + M * h, v = n.y + I * h;
439
+ if ((f - k) ** 2 + (b - v) ** 2 > d) continue;
440
+ const x = (i[0] + (i[1] - i[0]) * h) * (1 - Pt), P = w * t.width + e;
441
+ x > t.depth[P] || it(t.data, P, l, s);
462
442
  }
463
443
  }
464
444
  }
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();
445
+ function et(t, n) {
446
+ const i = !n.background || n.background === "transparent" ? t.getImageData(0, 0, n.width, n.height).data : void 0, r = St(n, { under: i }), l = t.createImageData(n.width, n.height);
447
+ l.data.set(r.data), t.putImageData(l, 0, 0), t.save(), t.lineJoin = "round", t.lineCap = "round";
448
+ for (const s of n.drawables)
449
+ t.save(), s.draw(t, n), t.restore();
470
450
  t.restore();
471
451
  }
472
- class Yt {
452
+ class Ft {
473
453
  ctx;
474
454
  constructor(n) {
475
455
  this.ctx = n;
476
456
  }
477
457
  render(n) {
478
- at(this.ctx, n);
458
+ et(this.ctx, n);
479
459
  }
480
460
  }
481
- class Wt {
461
+ class Ot {
482
462
  renderer;
483
463
  width;
484
464
  height;
@@ -505,121 +485,37 @@ class Wt {
505
485
  time = 0;
506
486
  render() {
507
487
  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 }));
488
+ this.renderer.render(tt(n, this.values, { width: this.width, height: this.height, time: this.time, valuesAt: this.valuesAt }));
509
489
  }
510
490
  }
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);
491
+ function Rt(t, n, o, i) {
492
+ const r = i.stateAt, l = i.valuesAt ?? (r && ((c) => r(c).values)), s = tt(n, o ?? /* @__PURE__ */ new Map(), { width: i.width, height: i.height, time: i.time, period: i.period, valuesAt: l });
493
+ i.depthBuffer ? et(t, s) : ot(t, s);
514
494
  }
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}`,
495
+ function Xt(t = {}) {
496
+ const n = t.id ?? "penrose", o = t.length ?? 4, i = t.thickness ?? 0.8, r = t.material ?? "penrose", [l, s, c] = t.position ?? [0, 0, 0], a = i / 2, y = (g, d, w) => ({
497
+ id: `${n}-${g}`,
518
498
  kind: "mesh",
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), $ = {
499
+ geometry: { type: "box", size: [w[0] - d[0], w[1] - d[1], w[2] - d[2]] },
500
+ material: r,
501
+ position: [l + (d[0] + w[0]) / 2, s + (d[1] + w[1]) / 2, c + (d[2] + w[2]) / 2]
502
+ }), p = [
503
+ y("x", [-a, -a, -a], [o - a, a, a]),
504
+ y("y", [o - a, -a, -a], [o + a, o - a, a]),
505
+ y("z", [o - a, o - a, -a], [o + a, o + a, o])
506
+ ], m = [l + 2 * o / 3, s + o / 3, c + o / 3], M = (t.distance ?? 20) / Math.sqrt(3), I = {
527
507
  id: `${n}-camera`,
528
508
  kind: "camera",
529
509
  projection: "orthographic",
530
510
  height: o * 1.6,
531
511
  near: 0.1,
532
512
  far: (t.distance ?? 20) * 3,
533
- position: [m[0] + v, m[1] + v, m[2] + v],
513
+ position: [m[0] + M, m[1] + M, m[2] + M],
534
514
  lookAt: m
535
515
  };
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;
516
+ return { objects: p, camera: I };
573
517
  }
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 = {
518
+ const _ = {
623
519
  day: {
624
520
  lights: [
625
521
  { id: "key", kind: "light", light: "directional", color: "#fff6e0", intensity: 0.95, position: [4, 8, 3] },
@@ -658,34 +554,34 @@ const V = {
658
554
  fog: { color: "#0a0612", near: 8, far: 24 }
659
555
  }
660
556
  };
661
- function jt(t, n = {}) {
662
- const o = V[t];
557
+ function Yt(t, n = {}) {
558
+ const o = _[t];
663
559
  if (!o) throw new Error(`lightingPreset: unknown mood "${t}" (day, dusk, night, stage)`);
664
- const e = n.prefix ? `${n.prefix}-` : "";
560
+ const i = n.prefix ? `${n.prefix}-` : "";
665
561
  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 })),
562
+ objects: o.lights.map((r) => ({ ...r, id: `${i}${r.id}`, position: r.position ? [...r.position] : void 0, target: r.target ? [...r.target] : void 0 })),
667
563
  background: { ...o.background },
668
564
  fog: { ...o.fog }
669
565
  };
670
566
  }
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 });
567
+ function Nt(t, n, o) {
568
+ const i = _[t], r = _[n];
569
+ if (!i || !r) throw new Error(`lightingTracks: unknown mood "${i ? n : t}" (day, dusk, night, stage)`);
570
+ const l = o.prefix ? `${o.prefix}-` : "", s = /* @__PURE__ */ new Set([...i.lights.map((a) => a.id), ...r.lights.map((a) => a.id)]), c = [];
571
+ for (const a of s) {
572
+ const y = i.lights.find((b) => b.id === a), p = r.lights.find((b) => b.id === a), m = `${o.scene}/${l}${a}`, M = (b, e, f) => {
573
+ const h = [{ time: o.start, value: e }, { time: o.end, value: f, easing: o.easing ?? "ease-in-out" }];
574
+ c.push({ id: `${m}-${b}`, target: m, property: b, keyframes: h });
679
575
  };
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]);
576
+ M("intensity", y?.intensity ?? 0, p?.intensity ?? 0), M("color", y?.color ?? p.color, p?.color ?? y.color);
577
+ const I = y?.position ?? p?.position, g = p?.position ?? y?.position;
578
+ I && g && M("position", [...I], [...g]);
579
+ const d = y?.target ?? p?.target, w = p?.target ?? y?.target;
580
+ d && w && M("target", [...d], [...w]);
685
581
  }
686
- return l;
582
+ return c;
687
583
  }
688
- function nn(t = {}) {
584
+ function Wt(t = {}) {
689
585
  const n = t.id ?? "ground", o = t.size ?? 24;
690
586
  return {
691
587
  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] }],
@@ -693,55 +589,55 @@ function nn(t = {}) {
693
589
  };
694
590
  }
695
591
  export {
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
592
+ zt as Canvas2DRenderer,
593
+ _ as LIGHTING_PRESETS,
594
+ _t as MeshBuilder,
595
+ Ot as Scene3DAdapter,
596
+ Ft as SoftwareRenderer,
597
+ Bt as boxMesh,
598
+ cn as cameraFollowTracks,
599
+ ln as cameraHandheldTracks,
600
+ dn as cameraMoveTracks,
601
+ hn as cameraPoseAt,
602
+ gn as checkShots,
603
+ Vt as coneMesh,
604
+ Zt as cylinderMesh,
605
+ fn as dollyPosition,
606
+ ot as drawResolvedScene,
607
+ et as drawResolvedSceneWithDepth,
608
+ Rt as drawScene3D,
609
+ Gt as extrudeMesh,
610
+ gt as fogAmount,
611
+ Jt as geometryMesh,
612
+ Wt as ground,
613
+ Q as inkColor,
614
+ vn as lightAt,
615
+ Yt as lightingPreset,
616
+ Nt as lightingTracks,
617
+ Kt as loadScene3D,
618
+ dt as lookAtView,
619
+ Ut as meshEdges,
620
+ un as orbitPosition,
621
+ F as parseColor,
622
+ Xt as penroseTriangle3D,
623
+ Qt as planeMesh,
624
+ qt as pointInPolygon,
625
+ jt as prepareMesh,
626
+ Z as projectionMatrix,
627
+ St as rasterizeResolvedScene,
628
+ tn as rawMesh,
629
+ tt as resolveScene3D,
630
+ ht as rollView,
631
+ U as shadeTriangle,
632
+ pn as shotAt,
633
+ yn as shotMarkers,
634
+ mn as shotTracks,
635
+ nn as signedArea,
636
+ kn as snapShotsToBeats,
637
+ on as sphereMesh,
638
+ en as torusMesh,
639
+ wn as transitionAt,
640
+ sn as triangulate,
641
+ rn as validateScene3D,
642
+ Mn as withActiveCamera
747
643
  };