3 circ1
= path
.normpath(path
.circle(0, 0, 1)) # you don't really need normpath,
4 circ2
= path
.normpath(path
.circle(1, 1, 1)) # but its better to have it once
6 (circ1a
, circ1b
), (circ2a
, circ2b
) = circ1
.intersect(circ2
)
7 intersection
= (circ1
.split([circ1a
, circ1b
])[0]
8 << circ2
.split([circ2b
, circ2a
])[0])
9 intersection
.append(path
.closepath())
11 union
= (circ1
.split([circ1a
, circ1b
])[1]
12 << circ2
.split([circ2b
, circ2a
])[1])
13 union
.append(path
.closepath())
16 c
.fill(union
, [color
.rgb
.blue
])
17 c
.fill(intersection
, [color
.rgb
.red
])
20 c
.writeEPSfile("circles")