Skip to content

Add L-system garden at /lsystem - #163

Merged
ianalloway merged 2 commits into
mainfrom
claude/lsystem-729tge
Jul 22, 2026
Merged

Add L-system garden at /lsystem#163
ianalloway merged 2 commits into
mainfrom
claude/lsystem-729tge

Conversation

@ianalloway

Copy link
Copy Markdown
Owner

Summary

  • Adds /lsystem — fractal plants and curves grown from L-system rewrite rules with turtle graphics
  • src/features/lsystem/turtle.ts: rule expansion (400k-symbol cap), turtle interpreter (F/G draw, f move, +/− turn, [ ] state stack with per-segment bracket depth), bounds tracking; five presets
  • src/pages/Lsystem.tsx: progressive canvas rendering (400 segments/frame) with depth-based thickness/brightness, preset buttons, depth and angle sliders, auto-fit to bounds
  • src/App.tsx: lazy-loaded /lsystem route with SEO metadata

How it works

  • Each preset is an axiom + rewrite rules expanded N times, then walked by a turtle: draw symbols emit segments, brackets push/pop position and heading — that stack is what makes branching plants possible
  • Segments deeper in the bracket stack draw thinner and dimmer, giving plants a natural taper
  • The angle slider deforms the figure away from its canonical angle — the fern at 25° is textbook; at 90° it becomes something alien
  • Expansion caps at 400k symbols so a max-depth dragon curve can't freeze the tab; drawing is progressive so big figures sweep in over a second or two
  • Footer shows the live axiom and rules; the plot auto-fits its bounding box at any size

Test plan

  • Load /lsystem — fern plant draws in progressively, branching visibly
  • All five presets render their canonical shapes (dragon at depth 10+, Koch closed snowflake, Sierpiński triangle)
  • Depth slider grows/simplifies the figure; max depths stay responsive
  • Angle slider morphs the shape live (fern at 90° ≠ fern at 25°)
  • Deeper branches are visibly thinner/dimmer on plant/bush
  • Segment count in header matches figure complexity
  • Redraw replays the drawing animation; resize refits

Generated by Claude Code

Rewrite-rule expansion (capped at 400k symbols so deep dragon curves
cannot hang the tab) plus a turtle interpreter supporting F/G draw,
f move, +/- turns, and [ ] state stack with bracket depth tracked per
segment. Deeper branches render thinner and dimmer for a natural plant
look. Five presets: fern plant, dragon curve, Sierpinski triangle,
Koch snowflake, and bush; depth and angle sliders rebuild live (the
angle slider mutates the form away from the canonical value). Segments
draw progressively at 400/frame; the figure auto-fits its bounds.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WgEKRuVdor8KhaiPkv38aQ
@netlify

netlify Bot commented Jul 19, 2026

Copy link
Copy Markdown

Deploy Preview for ianalloway ready!

Name Link
🔨 Latest commit 20c398f
🔍 Latest deploy log https://app.netlify.com/projects/ianalloway/deploys/6a614b0ed5944f0008f7f351
😎 Deploy Preview https://deploy-preview-163--ianalloway.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@vercel

vercel Bot commented Jul 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ian-web-forge Ready Ready Preview, Comment Jul 22, 2026 10:58pm

@ianalloway
ianalloway marked this pull request as ready for review July 19, 2026 04:39
Copilot AI review requested due to automatic review settings July 19, 2026 04:39
@cursor

cursor Bot commented Jul 19, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ianalloway
ianalloway merged commit eaa6cc0 into main Jul 22, 2026
4 of 5 checks passed
@ianalloway
ianalloway deleted the claude/lsystem-729tge branch July 22, 2026 22:58
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.

3 participants