lsystem_tree.sf 308 B

123456789101112131415161718192021222324
  1. #!/usr/bin/ruby
  2. include('LSystem/LSystem.sf')
  3. var rules = Hash(
  4. S => 'T[-S]+S',
  5. T => 'TT',
  6. );
  7. var lsys = LSystem(
  8. width: 1000,
  9. height: 1000,
  10. scale: 0.4,
  11. xoff: 100,
  12. yoff: 700,
  13. len: 5,
  14. angle: 35,
  15. color: 'dark green',
  16. );
  17. lsys.execute('S', 9, "tree.png", rules);