Last active
March 11, 2020 21:19
-
-
Save justvanrossum/76945a2804057aededd0865be2e1f37d to your computer and use it in GitHub Desktop.
DrawBot script to recreate 'Untitled Computer Assisted Drawing' by Paul Brown from 1975
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Original: | |
# Paul Brown, 'Untitled Computer Assisted Drawing' (1975) | |
# The program was written in Fortran and drawn with Calcomp's drum pen plotter. | |
# https://twitter.com/satoshi_aizawa/status/1218786881631965186 | |
def drawArc(center, radius, startAngle, endAngle): | |
bez = BezierPath() | |
bez.arc(center, radius, startAngle, endAngle, False) | |
drawPath(bez) | |
def tile1(x, y, q=0): | |
with savedState(): | |
translate(x, y) | |
rotate(q * 90, center=(0.5, 0.5)) | |
for r in [0.2, 0.4, 0.6, 0.8]: | |
drawArc((0, 0), r, 0, 90) | |
if r == 0.8: | |
drawArc((1, 1), r, 180, 198) | |
drawArc((1, 1), r, 252, 270) | |
else: | |
drawArc((1, 1), r, 180, 270) | |
def tile2(x, y): | |
tile1(x, y, 1) | |
def tile3(x, y): | |
tile1(x, y, 2) | |
def tile4(x, y): | |
tile1(x, y, 3) | |
def tile5(x, y): | |
with savedState(): | |
translate(x, y) | |
for i in range(4): | |
drawArc((0, 0.5), 0.1, 270, 90) | |
drawArc((0, 0.5), 0.3, 270, 90) | |
rotate(90, center=(0.5, 0.5)) | |
def tile6(x, y): | |
with savedState(): | |
translate(x, y) | |
oval(0.3, 0.3, 0.4, 0.4) | |
for i in range(4): | |
drawArc((0, 0), 0.2, 0, 90) | |
drawArc((0, 0), 0.4, 0, 90) | |
rotate(90, center=(0.5, 0.5)) | |
allTiles = [tile1, tile2, tile3, tile4, tile5, tile6] | |
numTiles = 16 | |
fill(1) | |
rect(0, 0, 1000, 1000) # white background | |
scale(1000 / numTiles) | |
scale(0.9, center=(numTiles/2, numTiles/2)) | |
fill(None) | |
stroke(0) | |
strokeWidth(0.05) | |
rect(0, 0, numTiles, numTiles) | |
strokeWidth(0.1) | |
for i in range(numTiles): | |
for j in range(numTiles): | |
tile = choice(allTiles) | |
tile(i, j) | |
saveImage("PaulBrownPattern.png") |
Author
justvanrossum
commented
Jan 19, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment