Phase 2: walk + spiral presets - #2
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 tomainonce it lands.Layouts
layout/walk.py—walk_layout(2-D turtle: step forward by a per-unit length, turn 90°) +heading_angles, ported from the piece'scompute_path. ReturnsN+1vertices so a per-unit colour aligns with theNsegments.layout/spiral.py—spiral_layout, equal-arc-length placement alongr = r0 + b·θ, +tangent_angles.layout/widths.py—rendered_widths: the width-step, measured headlessly with matplotlibTextPath(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;colouraccepts 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 cigreen: 102 tests incl. Hypothesis geometry properties (segment lengths == steps, determinism, bounded box, 90° turn sequence, monotone spiral radius, near-uniform arc spacing).mkdocs build --strictgreen; bothexamples/figures render headlessly and were eyeballed.🤖 Generated with Claude Code