2 import sys
; sys
.path
[:0] = ["../.."]
7 def drawexample(canvas
, corner
, linealign
):
10 canvas
.stroke(path
.path(path
.arc(5, 5, r
, 0, 360)))
12 canvas
.stroke(path
.path(path
.arc(5.5, 5+math
.sqrt(3)/6, r
, 0, 360)))
14 while phi
< 2 * math
.pi
+ 1e-10:
16 b
= box
.polygon(center
=(5, 5), corners
=((5, 5), (6, 5), (5.5, 5+math
.sqrt(3)/2)))
18 b
= box
.polygon(center
=(5.5, 5+math
.sqrt(3)/6), corners
=((5, 5), (6, 5), (5.5, 5+math
.sqrt(3)/2)))
20 b
.linealign(r
, math
.cos(phi
), math
.sin(phi
))
22 b
.circlealign(r
, math
.cos(phi
), math
.sin(phi
))
23 if round(phi
/ math
.pi
* 2 * 100) % 100:
24 canvas
.stroke(b
.path(centerradius
=0.05))
26 canvas
.stroke(b
.path(centerradius
=0.05), [color
.rgb
.red
])
30 sc
= c
.insert(canvas
.canvas([trafo
.translate(0, 6)]))
32 sc
= c
.insert(canvas
.canvas([trafo
.translate(6, 6)]))
34 sc
= c
.insert(canvas
.canvas([trafo
.translate(0, 0)]))
36 sc
= c
.insert(canvas
.canvas([trafo
.translate(6, 0)]))
38 c
.writeEPSfile("test_box", paperformat
=document
.paperformat
.A4
)
39 c
.writePDFfile("test_box", paperformat
=document
.paperformat
.A4
)