-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflip_connector.py
More file actions
32 lines (26 loc) · 943 Bytes
/
flip_connector.py
File metadata and controls
32 lines (26 loc) · 943 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
import cmath
import svg
import jigsaw
with svg.SVG(0, 2.5, 700, 500, __file__) as s:
with s.transformation(shift=-1.5, rotate=0):
path = svg.Path(1-2j)
path.line(1 + 1j)
jigsaw.linear_tab(1 + 1j, -1 - 1j, 0.3, path, left=True)
path.line(-1 - 2j)
s.draw_path(path, svg.COLORS[0])
path = svg.Path(1+2j)
path.line(1 + 1j)
jigsaw.linear_tab(1 + 1j, -1 - 1j, 0.3, path, left=True)
path.line(-1 + 2j)
s.draw_path(path, svg.COLORS[1])
with s.transformation(shift=1.5, rotate=0):
path = svg.Path(2+1j)
path.line(1 + 1j)
jigsaw.linear_tab(1 + 1j, -1 - 1j, 0.3, path, left=True)
path.line(2 - 1j)
s.draw_path(path, svg.COLORS[0])
path = svg.Path(1+2j)
path.line(1 + 1j)
jigsaw.linear_tab(1 + 1j, -1 - 1j, 0.3, path, left=True)
path.line(-1 + 2j)
s.draw_path(path, svg.COLORS[1])