kopia lustrzana https://github.com/villares/sketch-a-day
main
rodzic
cc5f3e6299
commit
3e55f0d6b3
10
README.md
10
README.md
|
@ -8,6 +8,16 @@ If you enjoy this, be a [patreon](https://patreon.com/arteprog) or make a donati
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|

|
||||||
|
278: [code](https://github.com/villares/sketch-a-day/tree/master/s278) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|
277: [code](https://github.com/villares/sketch-a-day/tree/master/s277) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||

|

|
||||||
276: [code](https://github.com/villares/sketch-a-day/tree/master/s276) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
276: [code](https://github.com/villares/sketch-a-day/tree/master/s276) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||||
|
|
||||||
|
|
Plik binarny nie jest wyświetlany.
Po Szerokość: | Wysokość: | Rozmiar: 226 KiB |
Plik binarny nie jest wyświetlany.
Po Szerokość: | Wysokość: | Rozmiar: 197 KiB |
Plik binarny nie jest wyświetlany.
Po Szerokość: | Wysokość: | Rozmiar: 196 KiB |
Plik binarny nie jest wyświetlany.
Po Szerokość: | Wysokość: | Rozmiar: 228 KiB |
|
@ -0,0 +1,65 @@
|
||||||
|
# Alexandre B A Villares - https://abav.lugaralgum.com/sketch-a-day
|
||||||
|
SKETCH_NAME = "s278" # 20181003
|
||||||
|
OUTPUT = ".png"
|
||||||
|
|
||||||
|
from random import choice
|
||||||
|
from random import randint
|
||||||
|
|
||||||
|
#ascii = """ .`:,';-_*"~!i|/\rI^)+(l?{><=}tc[]sjvJL7f1xzTyYF5e23onuaV4$SkC#EPhZX96U0pqKdbGA%gH8wRBmODN&Q@WM"""
|
||||||
|
ascii = """ .`:'-_*"~|/\^)+{><=}[]#"""
|
||||||
|
|
||||||
|
|
||||||
|
def setup():
|
||||||
|
size(1200, 600)
|
||||||
|
rectMode(CENTER)
|
||||||
|
colorMode(HSB)
|
||||||
|
fill(0)
|
||||||
|
f = createFont("SourceCodePro-Bold", 14)
|
||||||
|
textFont(f)
|
||||||
|
textSize(14)
|
||||||
|
global mi, ma
|
||||||
|
mi, ma = 3, 15
|
||||||
|
|
||||||
|
def draw():
|
||||||
|
noLoop()
|
||||||
|
background(200)
|
||||||
|
grid(width/4, height/2, 4, 150, ensamble, 4) # ensamble of 5 , on grid also order=5
|
||||||
|
grid(width/4*3, height/2, 4, 150, ensamble, 4) # ensamble of 5 , on grid also order=5
|
||||||
|
|
||||||
|
|
||||||
|
def ensamble(ex, ey, order):
|
||||||
|
with pushMatrix():
|
||||||
|
translate(ex, ey)
|
||||||
|
# #rotate(QUARTER_PI)
|
||||||
|
gliph = lambda x, y, l: text(l, x, y)
|
||||||
|
for _ in range(order):
|
||||||
|
# rotate(QUARTER_PI)
|
||||||
|
c = choice(ascii)
|
||||||
|
order = randint(mi, ma)
|
||||||
|
spacing, side = randint(5, ma*2), randint(5, ma*2)
|
||||||
|
x, y = int(random(-5, 5)) * side, int(random(-5, 5)) * side
|
||||||
|
#fill(randint(1 , 5) * 48, 255, 255) # H, S, B
|
||||||
|
grid(x, y, order, spacing, gliph, c)
|
||||||
|
|
||||||
|
|
||||||
|
def grid(x, y, order, spacing, function, *args):
|
||||||
|
with pushMatrix():
|
||||||
|
translate(x - order * spacing / 2, y- order * spacing / 2)
|
||||||
|
for i in range(order):
|
||||||
|
gx = spacing/2 + i * spacing
|
||||||
|
for j in range(order):
|
||||||
|
gy = spacing/2 + j * spacing
|
||||||
|
function(gx, gy, *args)
|
||||||
|
|
||||||
|
def keyPressed():
|
||||||
|
if key == " ": loop()
|
||||||
|
if key == "s": saveFrame("###.png")
|
||||||
|
|
||||||
|
# print text to add to the project's README.md
|
||||||
|
def settings():
|
||||||
|
println(
|
||||||
|
"""
|
||||||
|

|
||||||
|
{1}: [code](https://github.com/villares/sketch-a-day/tree/master/{0}) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||||
|
""".format(SKETCH_NAME, SKETCH_NAME[1:], OUTPUT)
|
||||||
|
)
|
Ładowanie…
Reference in New Issue