diff --git a/2021/sketch_2021_01_19a/sketch_2021_01_19a.png b/2021/sketch_2021_01_19a/sketch_2021_01_19a.png new file mode 100644 index 00000000..86a1de9c Binary files /dev/null and b/2021/sketch_2021_01_19a/sketch_2021_01_19a.png differ diff --git a/2021/sketch_2021_01_19a/sketch_2021_01_19a.pyde b/2021/sketch_2021_01_19a/sketch_2021_01_19a.pyde new file mode 100644 index 00000000..e4f14071 --- /dev/null +++ b/2021/sketch_2021_01_19a/sketch_2021_01_19a.pyde @@ -0,0 +1,37 @@ + +def setup(): + size(512 +128, 512 + 128) #, PDF, "a.pdf") + rectMode(CENTER) + noFill() + stroke(0, 0, 255) + noSmooth() + noLoop() + +def draw(): + background(0) + rec_grid(width / 2, height / 2, 8, width) + saveFrame("###.png") + +def keyPressed(): + redraw() + +def rec_grid(x, y, n, tw): + cw = float(tw) / n + margin = (cw - tw) / 2.0 + for i in range(n): + nx = x + cw * i + margin + for j in range(n): + ny = y + cw * j + margin + if cw > 8 and random(10) < 9: + rec_grid(nx, ny, 2, cw) + else: + squarish(nx, ny, cw-2) + +def squarish(x, y, w): + xa, ya = x - w / 2, y - w / 2 + xb, yb = x + w / 2, y - w / 2 + xc, yc = x + w / 2, y + w / 2 + xd, yd = x - w / 2, y + w / 2 + coords = (xa, ya, xb, yb, xc, yc, xd, yd) + rnd_coords = (c + int(random(-10, 10) * (y / height)) for c in coords) + quad(*rnd_coords) diff --git a/README.md b/README.md index 30833204..0468e9d0 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,12 @@ Here are listed some of the tools I have been using: --- +![sketch_2021_01_19a](2021/sketch_2021_01_19a/sketch_2021_01_19a.png) + +[sketch_2021_01_19a](https://github.com/villares/sketch-a-day/tree/master/2021/sketch_2021_01_19a) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)] + +--- + ![sketch_2021_01_18a](2021/sketch_2021_01_18a/sketch_2021_01_18a.gif) [sketch_2021_01_18a](https://github.com/villares/sketch-a-day/tree/master/2021/sketch_2021_01_18a) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]