kopia lustrzana https://github.com/villares/sketch-a-day
190908
rodzic
b1665ca8c9
commit
0982c507c9
Plik binarny nie jest wyświetlany.
|
Po Szerokość: | Wysokość: | Rozmiar: 212 KiB |
|
|
@ -0,0 +1,30 @@
|
|||
from __future__ import division
|
||||
|
||||
def setup():
|
||||
size(600, 600)
|
||||
rectMode(CENTER)
|
||||
fill(0)
|
||||
noStroke()
|
||||
rec_grid(width / 2, height / 2, 4, 580)
|
||||
|
||||
def rec_grid(x, y, n, tw):
|
||||
pushMatrix()
|
||||
translate(x, y)
|
||||
cw = tw / n
|
||||
margin = (cw - tw) / 2
|
||||
for i in range(n):
|
||||
nx = cw * i + margin
|
||||
for j in range(n):
|
||||
ny = cw * j + margin
|
||||
if cw > 5 and random(10) < 9:
|
||||
rec_grid(nx, ny, 2, cw)
|
||||
else:
|
||||
square(nx, ny, cw - 2)
|
||||
popMatrix()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Ładowanie…
Reference in New Issue