villares 2019-07-21 23:02:09 -03:00
rodzic ac48d8e679
commit 3150be81db
3 zmienionych plików z 33 dodań i 0 usunięć

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 71 KiB

Wyświetl plik

@ -0,0 +1,28 @@
"""Grid study"""
shapes = []
def setup():
size(500, 500)
rectMode(CENTER)
shapes.extend(grid(10, 12, 25, thing))
def draw():
translate(width / 2, height / 2)
rect(0, 0, 250, 300)
for s in shapes:
shape(s)
def grid(cols, rows, space, func):
result = []
half_w = -cols * space / 2.
half_h = -rows * space / 2.
for ix in range(cols):
x = half_w + ix * space + space / 2
for iy in range(rows):
y = half_h + iy * space + space / 2
result.append(func(x, y))
return result
def thing(x=0, y=0, w=10, h=10):
t = createShape(ELLIPSE, x, y, w, h)
return t

Wyświetl plik

@ -20,6 +20,11 @@ You may also support my artistic work, open teaching resources and research with
---
![sketch_190721a](2019/sketch_190721png/sketch_190721a.png)
[sketch_190721a](https://github.com/villares/sketch-a-day/tree/master/2019/sketch_190721a) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
Grid studies...
---