@logomarks/generate 0.4.1 → 0.5.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.
@@ -0,0 +1,98 @@
1
+ /**
2
+ * Cloud: a bold cloud, two to five round puffs on a flat or round base, unioned, with ONE move: cut into level bands,
3
+ * split by one slanted gap, a slot run in from one side, drawn as a heavy outline broken once, or stacked over a smaller
4
+ * cloud a gap above. The commonest infrastructure mark in the owner's tech-brand audit (2026-11-27), which the set
5
+ * lacked. Never rain, a bolt or a sun (weather icons): nothing is drawn under or behind the cloud, and no piece is a
6
+ * whole disc. A plain solid cloud is the cloud icon itself: by hand only.
7
+ */
8
+ import { U, D, I, rect, rr, circle, poly, grow } from '@logomarks/core/geometry';
9
+ import { BOX, GAP, tidy } from '../draw.js';
10
+
11
+ /** @type {import('../index.js').Control[]} */
12
+ export const controls = [
13
+ { key: 'puffs', label: 'Puffs', type: 'range', min: 2, max: 5, step: 1, value: 3 },
14
+ { key: 'base', label: 'Base', type: 'choice', options: ['flat', 'round'], value: 'flat' },
15
+ { key: 'rise', label: 'Tallest puff', type: 'choice', options: ['middle', 'left', 'right'], value: 'left' },
16
+ { key: 'move', label: 'Move', type: 'choice', options: ['bands', 'split', 'slot', 'outline', 'stack', 'none'], value: 'bands' },
17
+ { key: 'height', label: 'Height', type: 'range', min: 0.5, max: 0.78, step: 0.01, value: 0.62 },
18
+ { key: 'bands', label: 'Bands', type: 'range', min: 2, max: 4, step: 1, value: 2 },
19
+ { key: 'at', label: 'Cut at', type: 'range', min: 0.3, max: 0.7, step: 0.01, value: 0.5 },
20
+ { key: 'angle', label: 'Cut angle', type: 'range', min: -40, max: 40, step: 1, value: -24 },
21
+ { key: 'weight', label: 'Outline weight', type: 'range', min: 0.12, max: 0.2, step: 0.005, value: 0.15 },
22
+ { key: 'spacing', label: 'Gap', type: 'range', min: 1, max: 1.8, step: 0.05, value: 1.2 },
23
+ ];
24
+
25
+ /** Each puff's radius and centre, as shares of the cloud's width, for a count and which puff stands tallest. */
26
+ function puffsOf(n, rise) {
27
+ const P = {
28
+ 2: [[0.2, 0.3], [0.27, 0.64]],
29
+ 3: [[0.17, 0.25], [0.26, 0.54], [0.155, 0.8]],
30
+ 4: [[0.14, 0.2], [0.21, 0.42], [0.2, 0.64], [0.13, 0.84]],
31
+ 5: [[0.12, 0.15], [0.16, 0.32], [0.2, 0.5], [0.16, 0.68], [0.11, 0.85]],
32
+ }[n];
33
+ if (rise === 'right') return P;
34
+ if (rise === 'left') return P.map(([r, x]) => [r, 1 - x]).reverse();
35
+ // the tallest in the middle: the radii sorted onto the slots from the middle out
36
+ const rs = P.map(([r]) => r).sort((a, b) => b - a), mid = (n - 1) / 2;
37
+ const slots = P.map(([, x], k) => ({ x, d: Math.abs(k - mid) + k * 0.01 })).sort((a, b) => a.d - b.d);
38
+ return slots.map((sl, i) => [rs[i], sl.x]).sort((a, b) => a[1] - b[1]);
39
+ }
40
+
41
+ /** The cloud's height for a width: its tallest puff over its base. */
42
+ const cloudH = (w, p) => w * 0.26 * 0.95 + w * Math.max(...puffsOf(p.puffs, p.rise).map(([r]) => r)) * p.height / 0.62;
43
+
44
+ /** A cloud `w` wide with its bottom-left at (x0, y1): a round-ended base and its puffs standing on it. */
45
+ function cloud(x0, y1, w, p) {
46
+ const hb = w * 0.26, yc = y1 - hb * 0.95, k = p.height / 0.62;
47
+ const base = p.base === 'round' ? rr(x0, y1 - hb, w, hb, hb / 2) : rr(x0, y1 - hb, w, hb, [hb / 2, hb / 2, hb * 0.14, hb * 0.14]);
48
+ const puffs = puffsOf(p.puffs, p.rise).map(([r0, fx]) => {
49
+ const r = w * r0 * k, cx = Math.min(Math.max(x0 + w * fx, x0 + r), x0 + w - r);
50
+ return circle(cx, yc, r, 120);
51
+ });
52
+ // nothing hangs below the base
53
+ return I(U(base, ...puffs), rect(x0 - 4, BOX.y0 - BOX.size, w + 8, y1 - BOX.y0 + BOX.size));
54
+ }
55
+
56
+ /** The mark for resolved params. */
57
+ export function build(p) {
58
+ const W = BOX.size, g = GAP * p.spacing;
59
+ if (p.move === 'stack') {
60
+ // a smaller cloud a gap above a full one, its tallest puff on the other side
61
+ const w2 = W * 0.66, q = { ...p, rise: p.rise === 'left' ? 'right' : 'left', puffs: Math.max(2, p.puffs - 1) };
62
+ const h1 = cloudH(W, p), h2 = cloudH(w2, q), y1 = BOX.cy + (h1 + h2 + g) / 2;
63
+ const low = cloud(BOX.cx - W / 2, y1, W, p);
64
+ const high = cloud(BOX.cx - w2 / 2 + (p.rise === 'left' ? W * 0.1 : -W * 0.1), y1 - h1 - g * 0.4, w2, q);
65
+ return tidy(U(low, D(high, grow(low, g))));
66
+ }
67
+ const H = cloudH(W, p), x0 = BOX.cx - W / 2, y1 = BOX.cy + H / 2, c = cloud(x0, y1, W, p);
68
+ if (p.move === 'bands') {
69
+ // level gaps through the cloud, the bands of like height
70
+ // the cloud lifted off a strip of its own base by one gap, low in the base (cut at the base's top, a dome over a
71
+ // slab, it read as a burger); more bands cut the puffs level above it
72
+ const n = p.bands, hb = W * 0.26, foot = Math.max(GAP * 1.2, hb * 0.42), cuts = [rect(x0 - 8, y1 - foot - g, W + 16, g)];
73
+ const top = y1 - H, upper = H - foot - g, bandH = (upper - (n - 2) * g) / (n - 1);
74
+ for (let k = 1; k < n - 1; k++) cuts.push(rect(x0 - 8, top + k * bandH + (k - 1) * g, W + 16, g));
75
+ return tidy(D(c, U(...cuts)));
76
+ }
77
+ if (p.move === 'split') {
78
+ // one straight gap across the cloud at an angle, through its middle
79
+ const cy = y1 - H * p.at, t = Math.tan((p.angle * Math.PI) / 180), L = W * 0.8;
80
+ const cut = poly([[BOX.cx - L, cy - t * L - g / 2], [BOX.cx + L, cy + t * L - g / 2], [BOX.cx + L, cy + t * L + g / 2], [BOX.cx - L, cy - t * L + g / 2]]);
81
+ return tidy(D(c, cut));
82
+ }
83
+ if (p.move === 'slot') {
84
+ // a round-ended slot run in from the left end through the base, more than half the way across
85
+ const sh = g * 1.3, sy = y1 - W * 0.26 * 0.5 - sh / 2;
86
+ return tidy(D(c, rr(x0 - W, sy, W + W * (0.38 + p.at * 0.36), sh, sh / 2)));
87
+ }
88
+ if (p.move === 'outline') {
89
+ // a heavy outline, broken once on the base's right half
90
+ const t = W * p.weight, ring = D(c, grow(c, -t));
91
+ const bx = x0 + W * (0.5 + p.at * 0.3);
92
+ return tidy(D(ring, rect(bx, y1 - t - 4, g, t + 8)));
93
+ }
94
+ return tidy(c);
95
+ }
96
+
97
+ /** One cloud and its cuts. */
98
+ export const guard = {};
@@ -32,8 +32,18 @@ export const controls = [
32
32
  export const shapesOf = (p) => [p.body, unlike('counter', p.body, p.hole, HOLES)];
33
33
 
34
34
  /** The mark for resolved params. */
35
- export function build(p) {
36
- const { x0, y0, size, cx, cy } = BOX, [body, hole] = shapesOf(p), [mx, my, reach, most] = ROOM[body] || ROOM.square;
35
+ export function build(params) {
36
+ const p = { ...params };
37
+ // a half or a quarter disc is a lens turned, and a hole in its middle, or any round, almond or diamond hole, is an eye:
38
+ // there the hole sits low or in the corner, a square or a half
39
+ if (p.body === 'half' || p.body === 'quarter') {
40
+ if (p.place === 'centre' || p.place === 'high') p.place = p.body === 'half' ? 'low' : 'corner';
41
+ if (['disc', 'leaf', 'diamond', 'pill', 'hexagon'].includes(p.hole)) p.hole = 'square';
42
+ }
43
+ // (steered within the shapes that are no eye there: a half disc and a square are banned together, so it takes a quarter)
44
+ const lens = p.body === 'half' || p.body === 'quarter';
45
+ const body = p.body, hole = lens ? unlike('counter', p.body, p.hole, ['square', 'quarter', 'half']) : shapesOf(p)[1];
46
+ const { x0, y0, size, cx, cy } = BOX, [mx, my, reach, most] = ROOM[body] || ROOM.square;
37
47
  const s = size * Math.min(p.size, most), [dx, dy] = MOVE[p.place] || MOVE.centre;
38
48
  const hx = x0 + size * (mx + dx * reach) - s / 2, hy = y0 + size * (my + dy * reach) - s / 2;
39
49
  const cut = D(prim(body, [x0, y0, size, size]), prim(hole, [hx, hy, s, s], Number(p.holeTurn) / 90));
@@ -64,6 +64,11 @@ function cutShape(p) {
64
64
  /** The mark for resolved params. */
65
65
  export function build(params) {
66
66
  const p = { ...params };
67
+ // a wedge, a corner, a notch, a step or a bite taken out of a circle is a mouth (Pac-Man) or a pie chart at any turn: in a
68
+ // circle it is a slim slot instead (or an arc)
69
+ if (p.body === 'circle' && p.cut !== 'slot' && p.cut !== 'arc') { p.cut = 'slot'; if (Math.abs(p.at - 0.5) < 0.2) p.at = p.at < 0.5 ? 0.28 : 0.72; }
70
+ // a slot in a circle on the slant is a knob or a dial's hand: in a circle every cut runs square to its side
71
+ if (p.body === 'circle') p.angle = '0';
67
72
  // a centred notch or slot from the top of a circle is the power icon: slide it off centre
68
73
  if (p.body === 'circle' && (p.cut === 'slot' || p.cut === 'notch') && Math.abs(p.at - 0.5) < 0.2) p.at = p.at < 0.5 ? 0.28 : 0.72;
69
74
  const turn = { top: 0, right: 90, bottom: 180, left: 270 }[p.side];
@@ -37,7 +37,10 @@ function at(rule, r, c, k, rows, cols) {
37
37
  }
38
38
 
39
39
  /** The mark for resolved params. */
40
- export function build(p) {
40
+ export function build(params) {
41
+ const p = { ...params };
42
+ // two by two, rows of triangles facing one way are fast-forward (or play twice): the zigzag rule there is a checker
43
+ if ((!p.grid || p.grid === '2x2') && (p.rule === 'zigzag' || p.rule === 'rows')) p.rule = 'checker';
41
44
  const [cols, rows] = (/^[23]x[23]$/.test(p.grid) ? p.grid : '2x2').split('x').map(Number), k0 = Number(p.facing) / 90 || 0;
42
45
  const s = BOX.size / Math.max(cols, rows), x0 = BOX.cx - (cols * s) / 2, y0 = BOX.cy - (rows * s) / 2, h = (GAP * (p.spacing || 1)) / 2;
43
46
  const parts = [];
@@ -56,6 +56,11 @@ import * as ribbon from './ribbon.js';
56
56
  import * as field from './field.js';
57
57
  import * as zigzag from './zigzag.js';
58
58
  import * as halfstripe from './halfstripe.js';
59
+ import * as cloud from './cloud.js';
60
+ import * as layers from './layers.js';
61
+ import * as bubble from './bubble.js';
62
+ import * as check from './check.js';
63
+ import * as peak from './peak.js';
59
64
  import { FINISH, finish } from '../finish.js';
60
65
  import { TUNING } from '../tuning.js';
61
66
 
@@ -121,5 +126,10 @@ export const RECIPES = {
121
126
  ribbon: R('ribbon', 'Ribbon', 'One thick band folding back with round turns and a slot.', ribbon),
122
127
  field: R('field', 'Bar Field', 'A field of upright bars broken by one stepped line.', field),
123
128
  zigzag: R('zigzag', 'Zigzag', 'A striped shape broken by a zigzag, one side slid.', zigzag),
129
+ cloud: R('cloud', 'Cloud', 'Puffs on a base with one move: bands, a split, a slot, an outline or a stack.', cloud),
130
+ layers: R('layers', 'Layers', 'Two to four plates stacked with the gap between, flat or with a thickness.', layers),
131
+ bubble: R('bubble', 'Bubble', 'A speech bubble with one move: a parted tail, a pair, bands, a cut-out or a fold.', bubble),
132
+ check: R('check', 'Check', 'A heavy tick with one move: a parted heel, doubled, cut from a shape, or folded.', check),
133
+ peak: R('peak', 'Peak', 'The letter A as a peak: two heavy legs, no crossbar, with one move.', peak),
124
134
  halfstripe: R('halfstripe', 'Half Stripe', 'A shape half solid, half bars stepping down.', halfstripe),
125
135
  };
@@ -24,7 +24,12 @@ function outline(shape, r) {
24
24
  }
25
25
 
26
26
  /** The mark for resolved params. */
27
- export function build(p) {
27
+ export function build(params) {
28
+ const p = { ...params };
29
+ // rings swapped across a half of a circle leave one straight seam through them: on the slant a no-entry sign, upright a
30
+ // slashed zero
31
+ // and a quarter swapped is a pie chart or Pac-Man, a disc swapped a C in rings (©): in a circle the swap is a band
32
+ if (p.shape === 'circle') p.region = 'band';
28
33
  const { cx, cy, size } = BOX, R = size / 2, n = p.count;
29
34
  // n rings round an open centre: 2n + 1 steps of ink and ground, the ink `weight` of each pair
30
35
  const pair = R / (n + 0.5), t = Math.max(GAP * 1.4, pair * p.weight), parts = [];
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Layers: two to four plates stacked with the house gap between them, the "platform" mark of the owner's tech-brand
3
+ * audit (2026-11-27). Each plate is a flat rhombus, a rhombus with round corners, a chevron (a rhombus's lower half, so
4
+ * the stack reads from above), or a slab (a rhombus with a thickness below it). Laid as a stack (each plate showing only
5
+ * what the one above leaves, the gap round it), apart (whole plates a gap apart), offset (each a step to one side) or
6
+ * tapered (each smaller than the one below). Never level bars (a menu icon): every plate is a rhombus or a part of one.
7
+ * The plain stack of three equal rhombus plates is one company's mark and the UI "layers" icon: a shuffle always adds a
8
+ * move (a thickness, an offset, a taper, a fourth plate or an outlined top).
9
+ */
10
+ import { U, D, poly, grow, roundPoly } from '@logomarks/core/geometry';
11
+ import { BOX, GAP, tidy } from '../draw.js';
12
+
13
+ /** @type {import('../index.js').Control[]} */
14
+ export const controls = [
15
+ { key: 'plate', label: 'Plate', type: 'choice', options: ['rhombus', 'rounded', 'chevron', 'slab'], value: 'slab' },
16
+ { key: 'count', label: 'Plates', type: 'range', min: 2, max: 4, step: 1, value: 3 },
17
+ { key: 'lay', label: 'Laid', type: 'choice', options: ['stack', 'apart', 'offset', 'taper'], value: 'offset' },
18
+ { key: 'flat', label: 'Flatness', type: 'range', min: 0.36, max: 0.62, step: 0.01, value: 0.5 },
19
+ { key: 'pitch', label: 'Pitch', type: 'range', min: 0.18, max: 0.42, step: 0.01, value: 0.26 },
20
+ { key: 'shift', label: 'Offset', type: 'range', min: 0.06, max: 0.2, step: 0.01, value: 0.12 },
21
+ { key: 'top', label: 'Top plate', type: 'choice', options: ['solid', 'outline'], value: 'solid' },
22
+ { key: 'thick', label: 'Slab thickness', type: 'range', min: 0.1, max: 0.24, step: 0.01, value: 0.15 },
23
+ { key: 'spacing', label: 'Gap', type: 'range', min: 1, max: 1.6, step: 0.05, value: 1.15 },
24
+ ];
25
+
26
+ /** A rhombus plate `w` wide and `h` tall about (cx, cy), with a slab's thickness `t` hung below its front edges. */
27
+ function plate(cx, cy, w, h, kind, t, soft) {
28
+ const top = [[cx, cy - h / 2], [cx + w / 2, cy], [cx, cy + h / 2], [cx - w / 2, cy]];
29
+ if (kind === 'slab' && t > 0) return poly([[cx, cy - h / 2], [cx + w / 2, cy], [cx + w / 2, cy + t], [cx, cy + h / 2 + t], [cx - w / 2, cy + t], [cx - w / 2, cy]]);
30
+ if (kind === 'rounded') return [roundPoly(top, soft)];
31
+ return poly(top);
32
+ }
33
+
34
+ /** The mark for resolved params. */
35
+ export function build(q) {
36
+ // flat plates stacked plain (rhombus, rounded or chevron, the top solid) are the UI layers icon and one company's mark:
37
+ // they always taper
38
+ // they always taper. Slabs stacked straight or tapered outline one hexagon or pyramid, two other brands' marks: slabs
39
+ // always step aside
40
+ const p = q.plate === 'slab' && q.lay !== 'offset' ? { ...q, lay: 'offset' } : q.lay === 'stack' && q.top === 'solid' ? { ...q, lay: 'taper' } : q;
41
+ const g = GAP * p.spacing, n = p.count, W = BOX.size * 0.92, h = W * p.flat;
42
+ const t = p.plate === 'slab' ? BOX.size * p.thick : 0;
43
+ // apart: whole plates, each a gap below the last; otherwise they overlap by the pitch
44
+ const pitch = p.lay === 'apart' ? (p.plate === 'chevron' ? h * 0.5 : h * 0.5 + t) + g : BOX.size * p.pitch;
45
+ const total = h + t + pitch * (n - 1), y0 = BOX.cy - total / 2 + h / 2;
46
+ const plates = [];
47
+ for (let k = 0; k < n; k++) {
48
+ const scale = p.lay === 'taper' ? 1 - (n - 1 - k) * 0.16 : 1;
49
+ const dx = p.lay === 'offset' ? (k - (n - 1) / 2) * BOX.size * p.shift : 0;
50
+ plates.push(plate(BOX.cx + dx, y0 + k * pitch, W * scale, h * scale, p.plate === 'chevron' ? 'rhombus' : p.plate, t * scale, h * 0.22 * scale));
51
+ }
52
+ // from the top down: each plate keeps what the ones above leave it, the gap round them
53
+ let s = [], above = [];
54
+ for (const [k, pl] of plates.entries()) {
55
+ let piece = above.length ? D(pl, grow(U(...above), g)) : pl;
56
+ // a chevron plate is the lower half of a rhombus: the top plate stays whole, the rest only their fronts
57
+ if (p.plate === 'chevron' && k > 0) piece = D(piece, poly([[BOX.cx - BOX.size, y0 + k * pitch], [BOX.cx + BOX.size, y0 + k * pitch], [BOX.cx + BOX.size, BOX.y0 - BOX.size], [BOX.cx - BOX.size, BOX.y0 - BOX.size]]));
58
+ if (k === 0 && p.top === 'outline') piece = D(piece, grow(pl, -Math.max(GAP * 1.3, h * 0.2)));
59
+ s = s.length ? U(s, piece) : piece;
60
+ above.push(pl);
61
+ }
62
+ return tidy(s);
63
+ }
64
+
65
+ /** Plates and their fronts. */
66
+ export const guard = {};
@@ -26,7 +26,29 @@ function tile(kind, x, y, s, k) {
26
26
  }
27
27
 
28
28
  /** The mark for resolved params. */
29
- export function build(p) {
29
+ /** Even-odd: whether (x, y) is in the ink. */
30
+ const inRing = (r, x, y) => { let c = false; for (let i = 0, j = r.length - 1; i < r.length; j = i++) { const [xi, yi] = r[i], [xj, yj] = r[j]; if ((yi > y) !== (yj > y) && x < ((xj - xi) * (y - yi)) / (yj - yi) + xi) c = !c; } return c; };
31
+ const inked = (shape, x, y) => shape.some((poly) => inRing(poly[0], x, y) && !poly.slice(1).some((h) => inRing(h, x, y)));
32
+
33
+ /**
34
+ * Whether four tiles read as one solid parted by a plus (a cross) or round a four-pointed star (the AI sparkle): the
35
+ * share of each gap line with ink close on both sides (a plus: most of both lines), or ink along the lines' outer ends
36
+ * with the middle hollow (the tiles' points round a star).
37
+ */
38
+ export function plusRead(shape, g) {
39
+ const { cx, cy, x0, size } = BOX, d = g / 2 + 4, N = 60;
40
+ let v = 0, h = 0;
41
+ for (let i = 0; i < N; i++) { const t = x0 + (size * (i + 0.5)) / N; if (inked(shape, cx - d, t) && inked(shape, cx + d, t)) v++; if (inked(shape, t, cy - d) && inked(shape, t, cy + d)) h++; }
42
+ if (Math.min(v, h) / N >= 0.55) return 'a plus';
43
+ let o = 0, n = 0;
44
+ for (let i = 0; i < 40; i++) {
45
+ const t = x0 + 8 + i * 2.5;
46
+ for (const [ax, ay, bx, by] of [[cx - d, t, cx + d, t], [cx - d, 512 - t, cx + d, 512 - t], [t, cy - d, t, cy + d], [512 - t, cy - d, 512 - t, cy + d]]) { n++; if (inked(shape, ax, ay) && inked(shape, bx, by)) o++; }
47
+ }
48
+ return o / n >= 0.3 && !inked(shape, cx + size * 0.13, cy + size * 0.13) ? 'a sparkle' : '';
49
+ }
50
+
51
+ function draw(p) {
30
52
  const g = GAP * p.spacing, s = (BOX.size - g) / 2, parts = [];
31
53
  // each cell's turn: the square corner to the middle (outward leaves), away from it, round in a pinwheel, by rows
32
54
  const base = { outward: [180, 270, 0, 90], inward: [0, 90, 180, 270], pinwheel: [0, 90, 180, 270].map((a) => a + 90), rows: [0, 0, 180, 180], same: [0, 0, 0, 0] }[p.order];
@@ -35,8 +57,21 @@ export function build(p) {
35
57
  const x = BOX.x0 + c * (s + g), y = BOX.y0 + r * (s + g);
36
58
  parts.push(rot(tile(p.tile, x, y, s, p.softness), base[i] + Number(p.facing), x + s / 2, y + s / 2));
37
59
  });
38
- let out = U(...parts);
39
- if (p.centre === 'disc') { const d = circle(BOX.cx, BOX.cy, s * 0.3, 96); out = U(mapClear(out, d, g), d); }
60
+ return { out: U(...parts), g, s };
61
+ }
62
+
63
+ export function build(params) {
64
+ const p = { ...params };
65
+ // four tiles that close into one solid parted by a plus (a disc or a rounded square in four: a cross), or whose points
66
+ // ring a four-pointed star (the AI sparkle), are measured on the drawing and turned another way: the next order that
67
+ // reads as neither (0.4.2; in 0.4.1 only inward leaves and outward quarters were caught, by name)
68
+ let d = draw(p);
69
+ for (const order of ['pinwheel', 'rows', 'same', 'outward', 'inward']) {
70
+ if (!plusRead(d.out, d.g)) break;
71
+ if (order !== p.order) d = draw({ ...p, order });
72
+ }
73
+ let out = d.out;
74
+ if (p.centre === 'disc') { const c = circle(BOX.cx, BOX.cy, d.s * 0.3, 96); out = U(mapClear(out, c, d.g), c); }
40
75
  return out;
41
76
  }
42
77
 
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Peak: the letter A drawn as a peak, the commonest single letter of the owner's tech-brand audit (2026-11-27): two heavy
3
+ * legs meeting at the apex, no crossbar, and ONE move: the right leg parted from the apex by the gap, a slot run up one
4
+ * leg, the feet cut off by a level gap, a small triangle seated in the counter for the crossbar, or a second peak nested
5
+ * under the first. The apex pointed or cut flat; the feet level or cut square to the legs. A rounded apex, and a wide
6
+ * peak, crowd tech brands' own A marks (the owner's audit references): the apex stays sharp or flat and the A narrow. It always reads as an
7
+ * A: taller than wide (a wide, low peak is a caret), heavy legs (a thin one is the ^ key), nothing up the middle (an
8
+ * arrow's stem), the counter open at the foot. It never turns (an A on its side is a chevron, an arrow).
9
+ */
10
+ import { U, D, I, poly, rect, circle, grow, mitreBand } from '@logomarks/core/geometry';
11
+ import { BOX, GAP, tidy } from '../draw.js';
12
+
13
+ /** @type {import('../index.js').Control[]} */
14
+ export const controls = [
15
+ { key: 'move', label: 'Move', type: 'choice', options: ['part', 'slot', 'feet', 'seat', 'nest', 'none'], value: 'part' },
16
+ { key: 'apex', label: 'Apex', type: 'choice', options: ['point', 'flat'], value: 'flat' },
17
+ { key: 'feet', label: 'Feet', type: 'choice', options: ['level', 'square'], value: 'level' },
18
+ { key: 'width', label: 'Width', type: 'range', min: 0.58, max: 0.78, step: 0.01, value: 0.68 },
19
+ { key: 'weight', label: 'Leg weight', type: 'range', min: 0.18, max: 0.3, step: 0.005, value: 0.23 },
20
+ { key: 'contrast', label: 'Thin left leg', type: 'range', min: 0.6, max: 1, step: 0.01, value: 1 },
21
+ { key: 'at', label: 'Cut at', type: 'range', min: 0.2, max: 0.45, step: 0.01, value: 0.3 },
22
+ { key: 'spacing', label: 'Gap', type: 'range', min: 1, max: 1.7, step: 0.05, value: 1.2 },
23
+ ];
24
+
25
+ /** An A peak `W` wide and `H` tall on the baseline `yb`, its legs `wl` and `wr` wide: the solid, its apex and feet shaped. */
26
+ function peak(cx, yb, W, H, wl, wr, p) {
27
+ const top = [cx, yb - H], L = [cx - W / 2, yb], R = [cx + W / 2, yb];
28
+ // each leg a band along its outer edge, run on past the apex and the foot, then clipped
29
+ const far = H * 0.6, run = (a, b, k) => [a[0] + (a[0] - b[0]) * k, a[1] + (a[1] - b[1]) * k];
30
+ const inset = (a, b, w, side) => {
31
+ const dx = b[0] - a[0], dy = b[1] - a[1], l = Math.hypot(dx, dy), nx = (-dy / l) * side, ny = (dx / l) * side;
32
+ return [[a[0] + nx * w / 2, a[1] + ny * w / 2], [b[0] + nx * w / 2, b[1] + ny * w / 2]];
33
+ };
34
+ const [l0, l1] = inset(L, top, wl, 1), [r0, r1] = inset(R, top, wr, -1);
35
+ const legs = U(mitreBand([run(l0, l1, 0.2), run(l1, l0, far / H)], wl), mitreBand([run(r0, r1, 0.2), run(r1, r0, far / H)], wr));
36
+ // clip: the outline of the A (its outer edges, the baseline), its apex pointed or cut flat
37
+ const tri = poly([L, top, R]);
38
+ let clip = tri;
39
+ if (p.apex === 'flat') clip = D(tri, rect(cx - W, yb - H - 4, W * 2, H * 0.09 + 4));
40
+ let s = I(legs, clip);
41
+ if (p.feet === 'square') {
42
+ // the feet cut square to each leg instead of level
43
+ const fl = poly([[L[0] - W, yb + 4], [L[0] + wl * 1.4, yb + 4], [L[0] - W, yb - W * 0.7]]), fr = poly([[R[0] + W, yb + 4], [R[0] - wr * 1.4, yb + 4], [R[0] + W, yb - W * 0.7]]);
44
+ s = D(s, U(fl, fr));
45
+ }
46
+ return s;
47
+ }
48
+
49
+ /** The mark for resolved params. */
50
+ export function build(p) {
51
+ const g = GAP * p.spacing, H = BOX.size, W = H * p.width, yb = BOX.cy + H / 2, cx = BOX.cx;
52
+ const wr = W * p.weight, wl = wr * p.contrast;
53
+ const a = peak(cx, yb, W, H, wl, wr, p);
54
+ if (p.move === 'part') {
55
+ // the right leg parted: a gap square across it, `at` of the way down from the apex
56
+ // at the height where the counter's apex meets the right leg's inner edge, so the cut runs right through the leg
57
+ const half = Math.atan2(W / 2, H), ca = Math.min(0.8, (wl + wr) / 2 / Math.sin(half) / H);
58
+ const t = ca + (p.at - 0.3) * 0.3, pt = [cx + (W / 2) * t, yb - H + H * t], l = Math.hypot(H, W / 2), n = [H / l, -(W / 2) / l];
59
+ const cut = mitreBand([[pt[0] - n[0] * W, pt[1] - n[1] * W], [pt[0] + n[0] * W, pt[1] + n[1] * W]], g);
60
+ return tidy(D(a, I(cut, rect(cx + 1, BOX.y0 - 4, W, H + 8))));
61
+ }
62
+ if (p.move === 'slot') {
63
+ // a slot run up the middle of the right leg from its foot
64
+ const k = (1 - p.at * 1.4), foot = [cx + W / 2 - wr / 2, yb + 4], up = [cx + (W / 2 - wr / 2) * k, yb - H * (1 - k) + 4];
65
+ return tidy(D(a, mitreBand([foot, up], g * 0.9)));
66
+ }
67
+ if (p.move === 'feet') {
68
+ // the feet cut off by a level gap, low on the legs
69
+ return tidy(D(a, rect(cx - W, yb - H * p.at * 0.8 - g / 2, W * 2, g)));
70
+ }
71
+ if (p.move === 'seat') {
72
+ // the crossbar's place: the counter's own top, a gap clear of the legs, cut level below — a small triangle seated
73
+ // in the counter
74
+ const counter = D(poly([[cx - W / 2, yb], [cx, yb - H], [cx + W / 2, yb]]), grow(a, g));
75
+ const low = yb - H * (0.1 + p.at * 0.3);
76
+ const seat = tidy(I(counter, rect(cx - W, BOX.y0 - 8, W * 2, low - BOX.y0 + 8)));
77
+ // legs so heavy the counter has no room for it (or only a crumb the tidy drops): the feet cut instead, never a bare A
78
+ const out = tidy(U(a, seat));
79
+ if (!seat.length || out.length <= tidy(a).length) return tidy(D(a, rect(cx - W, yb - H * p.at * 0.8 - g / 2, W * 2, g)));
80
+ return out;
81
+ }
82
+ if (p.move === 'nest') {
83
+ // a smaller peak nested under the first, a gap below its apex, standing on the same baseline
84
+ const H2 = H * 0.5, W2 = W * 0.5, inner = peak(cx, yb, W2, H2, wl * 0.7, wr * 0.7, { ...p, apex: p.apex === 'flat' ? 'point' : p.apex });
85
+ return tidy(U(a, D(inner, grow(a, g))));
86
+ }
87
+ return tidy(a);
88
+ }
89
+
90
+ /** Two legs and their move. */
91
+ export const guard = {};
@@ -2,7 +2,8 @@
2
2
  * Ribbon: one thick band that folds back on itself, its turns round, slots (round-ended gaps) along its runs, its ends
3
3
  * cut by the box, rounded or angled. After the folded S of the owner's references, widened into a family: one, two or
4
4
  * three steps, a wave of one swing, the turns round or creased (paper folded flat: a mitre opened by the gap), one or
5
- * two slots or none, the whole slanted. Unlike a plain letter (the dropped Fold, mitred, read as
5
+ * two slots or none, the whole slanted, and (0.4.2) any figure as two bands side by side, their turns concentric, or (by
6
+ * hand) a twisted strap. Unlike a plain letter (the dropped Fold, mitred, read as
6
7
  * blocky L, U, S): the round turns and the weight are always there, and the figures that read as a letter (N, Z) are by
7
8
  * hand only; a shuffle never draws them.
8
9
  */
@@ -27,11 +28,15 @@ const FIGURES = {
27
28
  wave: { pts: [[0, 0.5], [0.25, (r) => 0.5 - r * 0.5], [0.75, (r) => 0.5 + r * 0.5], [1, 0.5]], k: 0.92, wave: true },
28
29
  // three steps, a flight
29
30
  flight: { pts: [[0, 1], [0, 0.68], [0.34, 0.68], [0.34, 0.34], [0.68, 0.34], [0.68, 0], [1, 0]], k: 0.62 },
31
+ // a level band with a half twist: two creases across the middle, the slot jumping from one edge to the other
32
+ twist: { twist: true, k: 1 },
30
33
  };
31
34
  /**
32
35
  * The figures a shuffle draws: never one whose main read is a letter. Drawn and dropped (2026-11-27, from sheets): a
33
36
  * loop over itself (a P), a square spiral (an a), a frame round a square (a Q), one round a triangle (a muddle), a
34
37
  * serpent of upright runs (n, N, M), a pleat of level runs (the numerals 2 and 3), a wave of two swings (an M) and a hairpin that steps out (ru).
38
+ * In 0.4.2: a loop round a square or a hexagon with its ends crossing over and under (an ð, a key ring) and the twisted
39
+ * strap (three blocks; by hand only). What a shuffle gained instead: two bands, every figure drawn as a pair.
35
40
  */
36
41
  export const SHUFFLE_FIGURES = ['step', 'stairs', 'flight', 'wave'];
37
42
 
@@ -47,6 +52,7 @@ export const controls = [
47
52
  { key: 'ends', label: 'Ends', type: 'choice', options: ['box', 'round', 'angled'], value: 'box' },
48
53
  { key: 'turns', label: 'Turns', type: 'choice', options: ['round', 'crease'], value: 'round' },
49
54
  { key: 'slant', label: 'Slant', type: 'range', min: -25, max: 25, step: 1, value: 0 },
55
+ { key: 'lanes', label: 'Bands', type: 'choice', options: ['one', 'two'], value: 'one' },
50
56
  ];
51
57
 
52
58
  /** A polyline with each inner corner rounded: a circular-ish quadratic `r` back along both legs. */
@@ -66,11 +72,35 @@ const len = (a, b) => Math.hypot(b[0] - a[0], b[1] - a[1]);
66
72
  /** A point `d` along from `a` towards `b`. */
67
73
  const along = (a, b, d) => { const l = len(a, b) || 1; return [a[0] + ((b[0] - a[0]) * d) / l, a[1] + ((b[1] - a[1]) * d) / l]; };
68
74
 
75
+ /** A twisted strap: a level band, its middle a parallelogram between two creases, the slot above one side, below the other. */
76
+ function twist(p, T) {
77
+ const { cx, cy } = BOX, W = BOX.size * p.width, h = T, x0 = cx - W / 2, x1 = cx + W / 2;
78
+ // the twist: a short slanted stretch between two creases, the right run dropped by most of a band's height
79
+ const s = T * (0.55 + p.reach * 0.5), drop = h * 0.75, yl = cy - (h + drop) / 2, yr = yl + drop;
80
+ const a0 = cx - s / 2, a1 = cx + s / 2;
81
+ let out = [[[x0, yl], [a0, yl], [a1, yr], [x1, yr], [x1, yr + h], [a1, yr + h], [a0, yl + h], [x0, yl + h]]];
82
+ // the creases: a gap along each end of the slanted stretch, square across the band
83
+ out = D(out, pill([a0, yl - T], [a0, yl + h + T], GAP * 0.9));
84
+ out = D(out, pill([a1, yr - T], [a1, yr + h + T], GAP * 0.9));
85
+ if (p.slots !== 'none') {
86
+ // the slot near the top edge on the left, near the bottom edge on the right: the strap shows its other face
87
+ const lx0 = x0 + T * 0.5, lx1 = a0 - T * 0.5, rx0 = a1 + T * 0.5, rx1 = x1 - T * 0.5;
88
+ if (lx1 - lx0 > GAP * 2) out = D(out, pill([lx0, yl + h * 0.3], [lx1, yl + h * 0.3], GAP));
89
+ if (rx1 - rx0 > GAP * 2) out = D(out, pill([rx0, yr + h * 0.7], [rx1, yr + h * 0.7], GAP));
90
+ }
91
+ return out;
92
+ }
93
+
69
94
  /** The mark for resolved params. */
70
95
  export function build(p) {
71
96
  const fig = FIGURES[p.path] || FIGURES.step;
72
- const kW = fig.k ?? 1;
73
- const T = p.weight * BOX.size * kW, W = BOX.size * p.width - T, H = BOX.size - T;
97
+ if (fig.twist) {
98
+ const T = p.weight * BOX.size * 0.85; // a strap, longer than it is tall
99
+ return tidy(p.slant ? shear(twist(p, T), p.slant) : twist(p, T));
100
+ }
101
+ const kW = fig.k ?? 1, two = p.lanes === 'two';
102
+ // two bands side by side are each thinner, so the pair weighs about one band and a gap
103
+ const T = p.weight * BOX.size * kW * (two ? 0.6 : 1), W = BOX.size * p.width - T, H = BOX.size - T;
74
104
  const x0 = BOX.cx - W / 2, y0 = BOX.y0 + T / 2;
75
105
  const at = (v) => (typeof v === 'function' ? v(p.reach) : v);
76
106
  const unit = fig.pts;
@@ -81,8 +111,13 @@ export function build(p) {
81
111
  const ext = (a, b, d) => [b[0] + ((b[0] - a[0]) / len(a, b)) * d, b[1] + ((b[1] - a[1]) / len(a, b)) * d];
82
112
  if (p.ends === 'box') { pts[0] = ext(pts[1], pts[0], T); pts[pts.length - 1] = ext(pts.at(-2), pts.at(-1), T); }
83
113
  else if (p.ends === 'angled') { pts[0] = ext(pts[1], pts[0], T * 0.5); pts[pts.length - 1] = ext(pts.at(-2), pts.at(-1), T * 0.5); }
84
- let s = stroke(crease ? pts : fillet(pts, T * p.bend * (fig.wave ? 3 : 1)), T, { roundCaps: p.ends === 'round' });
85
- if (crease) {
114
+ const line = crease && !two ? pts : fillet(pts, T * p.bend * (fig.wave ? 3 : 1) * (two ? 2 : 1));
115
+ // two bands: the pair's outline with the gap's line taken out of it, so the turns stay concentric
116
+ // (the gap's line runs on through the ends, so round ends split into two rounded corners, never one hairpin: a paperclip)
117
+ const through = two ? [ext(line[1], line[0], T + GAP), ...line.slice(1, -1), ext(line.at(-2), line.at(-1), T + GAP)] : line;
118
+ let s = two ? D(stroke(line, T * 2 + GAP, { roundCaps: p.ends === 'round' }), stroke(through, GAP, { roundCaps: false })) : stroke(line, T, { roundCaps: p.ends === 'round' });
119
+
120
+ if (crease && !two) {
86
121
  // each corner a crease: the mitre line from the inner corner to the outer one, opened by the gap
87
122
  for (let k = 1; k < pts.length - 1; k++) {
88
123
  const a = pts[k - 1], v = pts[k], b = pts[k + 1];
@@ -113,7 +148,7 @@ export function build(p) {
113
148
  runs.push([straight, a, b]);
114
149
  }
115
150
  runs.sort((x, y) => y[0] - x[0]);
116
- const want = p.slots === 'none' ? 0 : p.slots === 'two' ? 2 : 1;
151
+ const want = p.slots === 'none' || two ? 0 : p.slots === 'two' ? 2 : 1;
117
152
  for (const [straight, a, b] of runs.slice(0, want)) {
118
153
  const h = (straight * p.slot) / 2;
119
154
  if (h < GAP * 0.6) continue;
@@ -105,16 +105,19 @@ export function build(params) {
105
105
  // round an open centre the innermost band is a solid disc: two gaps cut it into two sectors meeting in a point (or, opposite,
106
106
  // into the halves of a slashed circle), so a disc takes one gap, a slot to its middle
107
107
  const solid = rOuter - t < GAP; // (a dot centre's own disc is never cut; this only guards a very heavy setting)
108
- // in a round body the innermost ring broken once is a C in a ring, the copyright sign (or, mirrored, copyleft): it takes
109
- // two gaps instead, 150° apart (never opposite, so never a slash)
108
+ // the innermost ring broken once is a C in a ring, the copyright sign (or, mirrored, copyleft), in any body (an octagon
109
+ // or a rounded square too, 0.4.2): it closes. (Two gaps there, the 0.3.2 answer, made two arcs chasing round a
110
+ // centre: the refresh icon, which in a round body any gaps in the innermost ring make, so there it is always whole.)
110
111
  const round = !p.shape || p.shape === 'circle';
111
112
  // (too small for two pieces that both read, the short one a crumb, it closes into a plain ring)
112
113
  const two = rMid * ((150 * Math.PI) / 180) - GAP * p.gapSize >= GAP * 4;
113
- const cuts = solid ? Math.min(1, p.gaps) : round && k === p.count - 1 && p.gaps === 1 ? (two ? 2 : 0) : p.gaps;
114
+ const cuts = solid ? Math.min(1, p.gaps) : k === p.count - 1 && (p.gaps === 1 || round) ? 0 : p.gaps;
114
115
  for (let g = 0; g < cuts; g++) {
115
116
  const a = step * k + gapAt(cuts, g);
116
117
  ring = D(ring, p.breakKind === 'step' && t >= GAP * 3 ? gapCut('step', BOX.cx, cy, R, GAP * p.gapSize, a, t, rMid) : rot(rect(BOX.cx - (GAP * p.gapSize) / 2, cy - R - 10, GAP * p.gapSize, R + 10), a, BOX.cx, cy));
117
118
  }
119
+ // a whole innermost ring in a round body, inside broken ones, is a target: there it is left out (the centre opens)
120
+ if (round && cuts === 0 && k === p.count - 1 && p.count > 1 && p.gaps >= 1 && !solid) continue;
118
121
  parts.push(ring);
119
122
  }
120
123
  const inner = R - p.count * (t + gap);
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Seam: one block parted in two by a single gap-wide seam that jogs on its way across: a step, a square tenon, a
3
- * dovetail, or a corner taken out as its own piece. The two halves read as fitted together.
3
+ * dovetail, or a corner taken out as its own piece. The two halves read as fitted together. Never a corner joint in a
4
+ * disc: a quarter taken out of a round is a pie chart (it draws in a rounded square instead).
4
5
  */
5
6
  import { D, rect, circle, rr, regular, stroke, rot } from '@logomarks/core/geometry';
6
7
  import { BOX, GAP, tidy } from '../draw.js';
@@ -19,7 +20,9 @@ export const controls = [
19
20
  /** The mark for resolved params: the seam drawn top to bottom, then the whole turned. */
20
21
  export function build(p) {
21
22
  const { cx, cy, x0, y0, x1, y1, size } = BOX, g = GAP * p.spacing, R = size / 2;
22
- const body = p.body === 'rounded' ? rr(x0, y0, size, size, size * 0.2) : p.body === 'disc' ? circle(cx, cy, R, 128) : p.body === 'hexagon' ? regular(cx, cy, R * 1.06, 6, 0) : rect(x0, y0, size, size);
23
+ // a corner joint in a disc is a pie chart (a quarter taken out of a round), at any turn: it takes the rounded square
24
+ const kind = p.joint === 'corner' && p.body === 'disc' ? 'rounded' : p.body;
25
+ const body = kind === 'rounded' ? rr(x0, y0, size, size, size * 0.2) : kind === 'disc' ? circle(cx, cy, R, 128) : kind === 'hexagon' ? regular(cx, cy, R * 1.06, 6, 0) : rect(x0, y0, size, size);
23
26
  const x = x0 + size * p.at, h = (size * p.size) / 2, d = size * p.reach, T = y0 - 40, B = y1 + 40;
24
27
  let line;
25
28
  if (p.joint === 'step') line = [[x - d / 2, T], [x - d / 2, cy], [x + d / 2, cy], [x + d / 2, B]];
@@ -38,7 +38,10 @@ function leanOf(lean, r, c, C) {
38
38
  }
39
39
 
40
40
  /** The mark for resolved params. */
41
- export function build(p) {
41
+ export function build(params) {
42
+ const p = { ...params };
43
+ // two rows leaning opposite ways stack into sideways chevrons, << or >> (rewind, fast forward): they lean one way
44
+ if (p.rows === 2 && p.lean === 'rows') p.lean = 'same';
42
45
  const R = p.rows, C = p.cols, g = GAP * p.spacing;
43
46
  const cw = (BOX.size - (C - 1) * g) / C, ch = (BOX.size - (R - 1) * g) / R;
44
47
  const d = Math.min(cw * 0.55, ch * Math.tan((p.angle * Math.PI) / 180)); // past about half the tile, its tips go needle-thin
@@ -27,7 +27,10 @@ function whole(kind) {
27
27
  }
28
28
 
29
29
  /** The mark for resolved params. */
30
- export function build(p) {
30
+ export function build(params) {
31
+ const p = { ...params };
32
+ // a disc cut once (or a second cut spread off its edge) is a slashed circle: in a circle two or three cuts, kept inside
33
+ if (p.shape === 'circle') { p.cuts = Math.max(2, p.cuts); p.spread = Math.min(p.spread, p.cuts === 2 ? 0.55 : 0.75); }
31
34
  const { cx, cy, size } = BOX, n = p.cuts, g = GAP * p.spacing, s = whole(p.shape), parts = [];
32
35
  // the cuts run level in a frame turned `angle`: cut k at offset (k − (n−1)/2) × pitch across the middle
33
36
  const pitch = (size * 0.84 * p.spread) / Math.max(1, n), cuts = Array.from({ length: n }, (_, k) => (k - (n - 1) / 2) * pitch);
@@ -28,7 +28,8 @@ function cellOf(p, r, c, rand) {
28
28
  }
29
29
 
30
30
  /** The mark for resolved params. */
31
- export function build(p) {
31
+ export function build(params, tries = 0) {
32
+ const p = { ...params };
32
33
  const n = p.grid, g = p.gap ? GAP : 0, c = (BOX.size - (n - 1) * g) / n, rand = rng(`tiles:${p.layout}:${n}:${p.set}`);
33
34
  const cells = Array.from({ length: n }, () => Array(n).fill(null));
34
35
  for (let r = 0; r < n; r++) for (let k = 0; k < n; k++) cells[r][k] = cellOf(p, r, k, rand);
@@ -39,6 +40,12 @@ export function build(p) {
39
40
  }
40
41
  for (let r = Math.ceil(n / 2); r < n && p.symmetry === 'both'; r++) for (let k = 0; k < n; k++) { const s = cells[n - 1 - r][k]; cells[r][k] = s && { ...s, flip: s.flip === 'x' ? 'xy' : 'y' }; }
41
42
  for (let r = 0; r < n && p.symmetry === 'turn'; r++) for (let k = 0; k < n; k++) if (r * n + k >= Math.ceil((n * n) / 2)) { const s = cells[n - 1 - r][n - 1 - k]; cells[r][k] = s && { type: s.type, turns: s.turns + 2 }; }
43
+ // a layout whose filled cells make a plus (the middle row and column, the corners empty) is a cross; two filled cells
44
+ // over one in the middle below, the rest empty, is a face: the next layout instead (0.4.2)
45
+ const on = (r, k) => !!cells[r]?.[k];
46
+ const plus = n === 3 && on(1, 1) && on(0, 1) && on(1, 0) && on(1, 2) && on(2, 1) && !on(0, 0) && !on(0, 2) && !on(2, 0) && !on(2, 2);
47
+ const face = n === 3 && on(0, 0) && on(0, 2) && !on(0, 1) && (on(2, 1) || on(1, 1)) && !on(2, 0) && !on(2, 2) && !(on(1, 0) && on(1, 2));
48
+ if ((plus || face) && tries < 12) return build({ ...p, layout: (p.layout % 999) + 1 }, tries + 1);
42
49
  const parts = [];
43
50
  for (let r = 0; r < n; r++) for (let k = 0; k < n; k++) {
44
51
  const cell = cells[r][k]; if (!cell) continue;
@@ -19,13 +19,18 @@ export const controls = [
19
19
  ];
20
20
 
21
21
  /** The mark for resolved params. */
22
- export function build(p) {
22
+ export function build(params) {
23
+ const p = { ...params };
24
+ // in a disc, slits far past the centre and short ones leave one long slit across a circle (a slashed sign): there the
25
+ // lines stay near the centre and the three slits nearly even
26
+ const disc = !p.body || p.body === 'disc';
27
+ if (disc) p.offset = Math.min(p.offset, 0.32);
23
28
  const { cx, cy, size } = BOX, R = size / 2, g = GAP * p.spacing;
24
29
  const body = p.body === 'hexagon' ? regular(cx, cy, R, 6, -90) : p.body === 'triangle' ? regular(cx, cy + R * 0.14, R * 1.16, 3, -90) : p.body === 'square' ? squircle(cx, cy, R, 5) : circle(cx, cy, R, 128);
25
30
  // slit i lies along a line that passes the centre at distance o; it comes in from outside the body and stops short
26
31
  // of where the next slit's line crosses it, by a share of that run (its depth) and never nearer than a gap and a half
27
32
  const o = p.offset * R, k = p.hand === 'left' ? -1 : 1, base = (p.body === 'triangle' ? 30 : 0) + p.spin, meet = o * Math.sqrt(3);
28
- const depths = p.even ? [1, 1, 1] : [1, 0.74, 0.5];
33
+ const depths = p.even ? [1, 1, 1] : disc ? [1, 0.88, 0.76] : [1, 0.74, 0.5];
29
34
  const slits = [];
30
35
  for (let i = 0; i < 3; i++) {
31
36
  const a = ((base + 120 * i) * Math.PI) / 180, n = [Math.cos(a), Math.sin(a)], t = [-n[1] * k, n[0] * k];