Counters

  • attempts
  • succesful
  • unsuccesful
  • unused ends
  • cleaned

Info

successful branches before cleaning unlucky branche roots

Draws

  • Trunk

Branches size

  • ×4
  • ×2
  • ×1
  • ×0.8
  • ×0.6
  • ×0.4
hide / show Sprouting Leaves

v0.4.0

Manual

A refresh will do the trick

Tip: view the console for some intel

v0.3.2 > 0.4.0 changes

  • Different branche sizes, start with one big one and step by step (depending on how many successfull branches) they become smaller
  • After an x ammount (see 'Info') of successful branches it start cleaning up unsuccessful branche roots
  • A few counters en some info about what's happening
  • Trunk is added

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 if a new coordinate occurs in the not to use coordinates Set()¹ If it occurs then skip to a new attempt
    2. Check what size to draw; Step by step (based on how many successful branches) the branches become smaller
    3. Check if the script draw enough branches and if so start cleaning 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 line and 7 circles
  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 1500 times. And if it's done:
  9. Add sprouting leaves on all unused coordinates

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

Other Versions