sandify icon indicating copy to clipboard operation
sandify copied to clipboard

Ability to build a custom l-system shape

Open bobnik opened this issue 5 years ago • 0 comments

The new l-system (Fractal Line Writer) shape is constructed using a set of predefined rules that essentially tell a robot (turtle) to move and rotate. The instructions are then rewritten recursively over a given number of iterations to produce an interesting pattern.

It would be cool if a user could build their own l-system rules or tinker with an existing one. To do this, we need a few things for a "buildable" shape:

  • When "programming" the shape, the user may not always produce a valid result. We need the ability to delay rendering until the user asks for a redraw, and to handle parsing errors gracefully.
  • Open-ended l-system rules can be expensive to calculate (and lock/crash the browser), especially as iteration level increases. We need the ability to offload shape rendering to a web worker, as well as a way to let the user know rendering is in progress.
  • Finally, it would be nice to introduce some kind of shape-based caching to avoid recalculation of expensive shapes. See #139.

bobnik avatar Apr 25 '20 12:04 bobnik