Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # cmd > pip install simple_draw
- import simple_draw as sd
- from random import randint
- sd.resolution = (1200, 600)
- def branch(point, angle, length, width):
- if length < 5:
- return
- if length < 20:
- width = 1
- elif length < 100:
- width = 2
- vector = sd.get_vector(start_point=point, angle=angle, length=length, width=width)
- vector.draw()
- point_2 = vector.end_point
- angle_2 = angle - randint(10,40)
- length_2 = length * .75
- branch(point=point_2, angle=angle_2, length=length_2, width=width)
- angle_3 = angle + randint(10,40)
- branch(point=point_2, angle=angle_3, length=length_2, width=width)
- point_0 = sd.get_point(600, 5)
- angle_0 = 90
- length_0 = 150
- branch(point=point_0, angle=angle_0, length=length_0, width=5)
- sd.pause()
Advertisement
Add Comment
Please, Sign In to add comment