From 9c07f8157bc9eb73fd4e3a1556ff891ebd9e4390 Mon Sep 17 00:00:00 2001 From: srivtx Date: Sat, 24 Oct 2026 01:50:17 +0530 Subject: [PATCH 1/2] morpho: build from scratch, timing, layout notes, video and fit From making a poster with nothing but morpho, the gaps were: adding things, seeing when things move, judging layout, exporting video, and matching a reference without guessing. Now: - new / add (text, shape, line, path, modifier, group, font, image) / remove / duplicate / arrange, with presets, recipes and placement; Layer.preset= and Layer.recipe= work in any assignment - align: lines layers up by what they draw, not their anchors - timing: entrances, exits, loops and keyframes as bars on the clock, with notes on rhythm (all at once, dead air, cut off by the clock) - layout, and in check: boxes and margins, near-miss edges, nearly centred, crowded edges, no clear lead, visual weight and palette - video: MP4, WebM, GIF or PNG frames, drawn frame by frame and piped to ffmpeg (a 4 s loop exports in about 3 s) - fit: tunes settings until the design matches a reference picture Fixes found on the way: a new loop or entrance kind takes its own default amount (spin was 16 turns); motion pops are judged against the frames either side, so fast smooth moves aren't flagged; loop seams against the frame before; embedded fonts survive reloads; weight is measured from pixel centres. Co-Authored-By: Claude Opus 5.5 --- scripts/morpho.mjs | 203 +++++++++++++++++++++++++- ui/src/agent/agent.test.ts | 161 +++++++++++++++++++- ui/src/agent/build.ts | 292 +++++++++++++++++++++++++++++++++++++ ui/src/agent/check.ts | 27 ++-- ui/src/agent/edit.ts | 40 ++--- ui/src/agent/find.ts | 26 ++++ ui/src/agent/layout.ts | 150 +++++++++++++++++++ ui/src/agent/node.ts | 2 + ui/src/agent/page.ts | 191 ++++++++++++++++++++++-- ui/src/agent/timing.ts | 108 ++++++++++++++ 10 files changed, 1143 insertions(+), 57 deletions(-) create mode 100644 ui/src/agent/build.ts create mode 100644 ui/src/agent/find.ts create mode 100644 ui/src/agent/layout.ts create mode 100644 ui/src/agent/timing.ts diff --git a/scripts/morpho.mjs b/scripts/morpho.mjs index 8423b0c..5e9db86 100644 --- a/scripts/morpho.mjs +++ b/scripts/morpho.mjs @@ -7,6 +7,11 @@ // npm run morpho -- describe the design as a text tree (changed settings only) // npm run morpho -- scene