Skip to content

Instantly share code, notes, and snippets.

@LettError
Created May 24, 2018 08:35
Show Gist options
  • Save LettError/94d55efa86ce95f2ecd4d4cf25389f8a to your computer and use it in GitHub Desktop.
Save LettError/94d55efa86ce95f2ecd4d4cf25389f8a to your computer and use it in GitHub Desktop.
Drawbot sketch for drawing scribbles.
size(1000,400)
def scribble(pos, width, amplitude):
save()
x, y = pos
start = x
strokeWidth(1)
fill(None)
stroke(1-random()*0.2,0,0)
lineJoin("round")
newPath()
step = 6
drift = 1.5
moveTo((x,y))
while x < (width+start):
lineTo((x+step,y+amplitude+randint(-2,2)))
lineTo((x+step+3,y+amplitude+randint(-2,2)))
if randint(0,3)==2:
moveTo((x+step,y+randint(-2,2)))
else:
lineTo((x+step,y+randint(-2,2)))
lineTo((x+step+2,y))
x += step
y += drift * (random()-.5)
drawPath()
restore()
for l in range(2):
for y in range(20, 160, 10):
scribble((randint(45,55),y), randint(150,220), 4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment