• attempts
  • succesful
  • unsuccesful
  • unused ends
  • rejected
successful branches before rejecting roots
  • Trunk (at step 0)
  • ×4 (at step 0)
  • ×2 (at step )
  • ×1 (at step )
  • ×0.8 (at step )
  • ×0.6 (at step )
  • ×0.4 (at step )
App Info
Sprouting Leaves


This is a work in progress version, it might work it might not. Check previous version(s).


A refresh will do the trick

v0.4.1 > 0.4.3 changes

  • Did some significant tweaking with some calculations of 'where not to draw anymore'
  • bigger and relatively more tree like draw space, so the script does not end up every single time with a Grace Jones haircut 😏
  • Show/hide options now look like buttons so it's more clear what they do
  • Sprouts are now different shapes and comes in colours from a modest green pallete

What does the script do?

  1. Start with 2 base coordinates
  2. Draw the trunk (bit random) from the 2 coordinates to the root
  3. Calculate 5 other coordinates, with some randomness to make it more organic. And while calculating:
    1. Check what size to draw; Step by step (based on how many successful branches) the branches become smaller
    2. Check if a new coordinate occurs in the not to use coordinates Set()¹ If it occurs then skip to a new attempt
    3. Check if the script draw enough branches and if so start rejecting the unsuccessful coordinates (after one last attempt
  4. Determine a (bit smaller) square of the object and put all coordinates of that square in the Set()¹
  5. Draw the 4 lines
  6. Delete the used coordinates couple from the array
  7. Put the 2 new coordinates couples in the array for later use
  8. Pick one unused coordinates couple, and start again from step 2. Repeats 1000 times. And if that number is hit:
    1. try every unused couple once more (with the smallest branch
    2. if still no luck reject the couple
    3. if it results in another branch the two new couples goes into the unused couple pool
    4. This is repeated till all open end are rejected
    5. Add sprouting leaves on all unused coordinates

¹ A Set() is used because it only store unique values by default

Other Versions