Skip to content

Phase 2: walk + spiral presets - #2

Merged
zolizoli merged 1 commit into
mainfrom
phase-2-walk-spiral
Jul 1, 2026
Merged

Phase 2: walk + spiral presets#2
zolizoli merged 1 commit into
mainfrom
phase-2-walk-spiral

Conversation

@zolizoli

Copy link
Copy Markdown
Member

Phase 2 — walk + spiral

Ports the walk math and the Archimedean spiral from the evolved Wittgenstein project, rebuilding the renderers in matplotlib. Stacked on #1 (phase-1-spine) — review/merge that first, or re-target this to main once it lands.

Layouts

  • layout/walk.pywalk_layout (2-D turtle: step forward by a per-unit length, turn 90°) + heading_angles, ported from the piece's compute_path. Returns N+1 vertices so a per-unit colour aligns with the N segments.
  • layout/spiral.pyspiral_layout, equal-arc-length placement along r = r0 + b·θ, + tangent_angles.
  • layout/widths.pyrendered_widths: the width-step, measured headlessly with matplotlib TextPath (no display/canvas/Blender), robust to degenerate glyphs.

Presets

  • text_walk — sentences as a space-filling walk; "path" (multi-coloured ribbon) and "glyphs" (calligraphy-on-path) modes. Built-in length/position channels mean it works with no analysis stack; colour accepts any per-sentence array (auto/categorical/continuous).
  • punctuation_spiral — a text's marks on a spiral, accenting logical/mathematical/Greek signs in gold on a dark plate.

Verification

  • make ci green: 102 tests incl. Hypothesis geometry properties (segment lengths == steps, determinism, bounded box, 90° turn sequence, monotone spiral radius, near-uniform arc spacing).
  • mkdocs build --strict green; both examples/ figures render headlessly and were eyeballed.

🤖 Generated with Claude Code

Port the walk math and Archimedean spiral from the Wittgenstein piece;
rebuild the renderers in matplotlib.

- layout/walk.py: walk_layout (2-D turtle — step forward, turn 90°) and
  heading_angles, ported from compute_path. Returns N+1 vertices so a
  per-unit colour aligns with the N segments render_path draws.
- layout/spiral.py: spiral_layout (equal-arc-length Archimedean placement)
  and tangent_angles for orienting glyphs.
- layout/widths.py: rendered_widths — headless rendered-width measurement
  via matplotlib TextPath (the width-step), robust to degenerate glyphs.
- presets/text_walk.py: sentences as a space-filling walk; "path" (coloured
  ribbon) and "glyphs" (calligraphy-on-path) modes; dependency-free
  length/position channels by default; auto/categorical/continuous colour.
- presets/punctuation_spiral.py: a text's marks on a spiral, accenting
  logical/mathematical/Greek signs in gold on a dark plate.
- render/mpl.py: frame_axes promoted to a public shared helper.
- Public API re-exports; examples and docs for both presets; CHANGELOG.

make ci green (102 tests, incl. Hypothesis geometry properties);
mkdocs build --strict green; both example figures render headlessly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@zolizoli
zolizoli changed the base branch from phase-1-spine to main July 1, 2026 09:30
@zolizoli
zolizoli merged commit 4fb478c into main Jul 1, 2026
@zolizoli
zolizoli deleted the phase-2-walk-spiral branch July 1, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant