• attempts
  • succesful
  • unsuccesful
  • unused ends
  • rejected
successful branches before rejecting roots
draws
  • Trunk
  • ×4
  • ×2
  • ×1
  • ×0.8
  • ×0.6
  • ×0.4
hide / show App Info
hide / show Sprouting Leaves

v0.4.1

Manual

A refresh will do the trick

v0.4.0 > 0.4.1 changes

  • Did some significant tweaking with some calculations of 'where not to draw anymore'
  • bigger and relatively more tree like draw space
  • Show the info within the draw space (but never overlapping the tree)
  • You can hide/show the info

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