3 circ1
= path
.circle(0, 0, 1.5)
4 circ2
= path
.circle(1, 1, 1)
5 (circ1a
, circ1b
), (circ2a
, circ2b
) = circ1
.intersect(circ2
)
6 intersection
= (circ2
.split([circ2b
, circ2a
])[1]
7 << circ1
.split([circ1a
, circ1b
])[1])
8 intersection
[-1].close()
10 union
= (circ1
.split([circ1a
, circ1b
])[0]
11 << circ2
.split([circ2b
, circ2a
])[0])
15 c
.fill(union
, [color
.rgb
.blue
])
16 c
.fill(intersection
, [color
.rgb
.red
])
19 c
.writeEPSfile("circles")
20 c
.writePDFfile("circles")