kopia lustrzana https://github.com/villares/sketch-a-day
main
rodzic
ac48d8e679
commit
3150be81db
Plik binarny nie jest wyświetlany.
Po Szerokość: | Wysokość: | Rozmiar: 71 KiB |
|
@ -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
|
|
@ -20,6 +20,11 @@ You may also support my artistic work, open teaching resources and research with
|
|||
|
||||
---
|
||||
|
||||

|
||||
|
||||
[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...
|
||||
|
||||
---
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue