Hey there I was playing trying to recreate the Unknown Pleasures cover art, and this is the result if you've ever done it before I would love to see how did you solve it.
Cheers!!
# Tribute for Joy Division's Unknown Pleasures album cover
side = 1080
def lsPts(num):
points = []
m = side*0.3
for i in range(0, side, 12):
if i <= side*0.2:
x = i
y = sin((i*(randint(1, 3))))
points.append((x, y))
if i > side*0.2 and i <= side*0.4:
x = i
y = i*sin(radians(i*(randint(-100, 100))))/(10**1)
if y < 0:
points.append((x, y * -1))
else:
points.append((x, y))
if i > side*0.4 and i <= side*0.6:
x = i
y = m*sin(radians(m*(randint(-100, 100))))/(10**1)
if y < 0:
points.append((x, y * -1))
else:
points.append((x, y))
m -= 1
if i > side*0.6 and i <= side*0.8:
x = i
y = sin((i*(randint(1, 3))))
points.append((x, y))
return points
def lineGrid(steps):
for j in range(steps):
newPage(side, side)
fill(0)
rect(0, 0, side, side)
m = 0
for i in range(int(side*0.8/13.5)):
points = lsPts(1)
fill(None)
stroke(1)
strokeWidth(1)
path = BezierPath()
with savedState():
translate(side*0.1, side*0.1 + m)
path.moveTo((0, 0))
path.curveTo(*points)
drawPath(path)
m += 13.5
for i in range(12):
lineGrid(i)
saveImage('~/Desktop/unknown_pleasures.gif')