Guest User

Untitled

a guest
Mar 1st, 2018
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1.  
  2. # cmd > pip install simple_draw
  3. import simple_draw as sd
  4.  
  5. sd.resolution = (1200, 600)
  6.  
  7. def branch(point, angle, length):
  8.     if length < 5:
  9.         return
  10.     vector = sd.get_vector(start_point=point, angle=angle, length=length, width=5)
  11.     vector.draw()
  12.     point_2 = vector.end_point
  13.     angle_2 = angle - 30
  14.     length_2 = length * .75
  15.     branch(point=point_2, angle=angle_2, length=length_2)
  16.  
  17. point_0 = sd.get_point(600, 5)
  18. angle_0 = 90
  19. length_0 = 150
  20.  
  21. branch(point=point_0, angle=angle_0, length=length_0)
  22.  
  23. sd.pause()
Advertisement
Add Comment
Please, Sign In to add comment