-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample_vectoriel_geometry.py
More file actions
43 lines (34 loc) · 954 Bytes
/
example_vectoriel_geometry.py
File metadata and controls
43 lines (34 loc) · 954 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from visual import Point, expend, fill_rect, bezier_curve
from random import randint
from time import sleep
# Example 1
A,B,C,D = Point(0,0),Point(320,0),Point(320,222),Point(0,222)
def animation_1(color):
n = 0
while n > -0.8:
fill_rect(0, 0, 320, 222, "white")
bezier_curve(expend([A,B,C,D,A,B], n), color)
sleep(0.1)
n -= 0.1
animation_1("green")
# Example 2
A,B,C,D,E = Point(50,50),Point(100,200),Point(150,50),Point(200,200),Point(250,50)
def animation_2(color):
n = 0
while n > -1:
fill_rect(0, 0, 320, 222, "white")
bezier_curve(expend([A,B,C,D,E], n), color)
sleep(0.1)
n -= 0.1
#animation_2("green")
# Example 3
def animation_3(color):
while True:
liste = [Point(randint(0, 320), randint(0, 222)) for _ in range(10)]
n = 0
while n > -1:
fill_rect(0, 0, 320, 222, "white")
bezier_curve(expend(liste, n), color)
sleep(0.1)
n -= 0.1
#animation_3("green")