@MauriceMeilleur
An arbitrary amount of circles seemingly overlapping:
import random
number_of_circles = 10
radius = 100
wobble = 400
canvas_size = 1000
circles = []
drawn_circles = []
center = canvas_size / 2
# Create circles
for i in range(number_of_circles):
x = center - (wobble * 0.5) + random.random() * wobble
y = center - (wobble * 0.5) + random.random() * wobble
circle = BezierPath()
circle.oval(x - radius, y - radius, radius * 2, radius * 2)
circles.append(circle)
# Check if circles overlap
for circle in circles:
for i in range(len(drawn_circles)):
intersecting_shape = circle.intersection(circles[i])
if len(intersecting_shape.points) > 0:
circle = circle.difference(circles[i])
drawn_circles.append(circle)
# Draw circles, or what’s left of them
newPage(canvas_size, canvas_size)
fill(None)
stroke(0)
for circle in drawn_circles:
drawPath(circle)