kopia lustrzana https://github.com/villares/sketch-a-day
18 & rename wrong 2021_02_12 sphere!
rodzic
8c09c399ab
commit
253e9cae5f
Przed Szerokość: | Wysokość: | Rozmiar: 3.4 MiB Po Szerokość: | Wysokość: | Rozmiar: 3.4 MiB |
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1,75 @@
|
|||
|
||||
add_library('geomerative')
|
||||
|
||||
linhas = []
|
||||
DIST_PONTOS = 4 # na conversão da fonte em polígonos
|
||||
RAIO = 100
|
||||
texto = "ABC123"
|
||||
tamanho = 100
|
||||
x = 10
|
||||
y = 120
|
||||
|
||||
def setup():
|
||||
size(400, 400)
|
||||
noStroke()
|
||||
RG.init(this)
|
||||
RG.setPolygonizer(RG.UNIFORMLENGTH)
|
||||
RG.setPolygonizerLength(DIST_PONTOS)
|
||||
s = 40
|
||||
glifos = [RG.getText(letra, "Tomorrow-Bold.ttf", s, LEFT) for letra in texto]
|
||||
|
||||
global point_groups
|
||||
point_groups = []
|
||||
for g in glifos:
|
||||
point_groups.append(g.getPointsInPaths())
|
||||
calcTam(point_groups)
|
||||
|
||||
def draw():
|
||||
|
||||
background(255)
|
||||
for pg in point_groups:
|
||||
fill(0)
|
||||
noStroke()
|
||||
for glifo in pg:
|
||||
if glifo:
|
||||
beginShape()
|
||||
# path dentro de cada Linha
|
||||
for i_contorno, contorno in enumerate(glifo):
|
||||
if i_contorno > 0:
|
||||
beginContour() # se a Linha tiver olho
|
||||
# pontos de cada path
|
||||
for vertice in contorno:
|
||||
y = vertice.y + sy
|
||||
x = vertice.x + sx
|
||||
vertex(x, y)
|
||||
if i_contorno > 0:
|
||||
endContour()
|
||||
endShape(CLOSE)
|
||||
|
||||
|
||||
def calcTam(glifos):
|
||||
tamLetras = [PVector()] * len(glifos)
|
||||
wTotal = 0
|
||||
hTotal = 0
|
||||
for i, glifo in enumerate(glifos): # Linha
|
||||
wLetra = 0
|
||||
hLetra = 0
|
||||
if glifo:
|
||||
# path dentro de cada Linha
|
||||
for contorno in glifo:
|
||||
# pontos de cada path
|
||||
for vertice in contorno:
|
||||
x = vertice.x
|
||||
y = vertice.y
|
||||
if x > wLetra:
|
||||
wLetra = x
|
||||
if y > hLetra:
|
||||
hLetra = y
|
||||
x += wTotal
|
||||
vertice.x += wTotal
|
||||
else:
|
||||
wLetra += tamLetras[i - 1].x
|
||||
tamLetras[i] = PVector(wLetra, hLetra)
|
||||
if hLetra > hTotal:
|
||||
hTotal = hLetra
|
||||
wTotal += wLetra
|
Plik binarny nie jest wyświetlany.
Po Szerokość: | Wysokość: | Rozmiar: 91 KiB |
|
@ -0,0 +1,14 @@
|
|||
def setup():
|
||||
size(512, 512)
|
||||
background (0, 0, 0)
|
||||
blendMode(ADD)
|
||||
|
||||
|
||||
|
||||
def draw():
|
||||
if mousePressed and mouseButton == LEFT:
|
||||
fill(mouseX / 2, mouseY / 2, 0)
|
||||
circle(mouseX, mouseY, 10) # x, y, diâmetro
|
||||
|
||||
if keyPressed and key =='a':
|
||||
clear()
|
33
README.md
33
README.md
|
@ -26,6 +26,30 @@ Here are listed some of the tools I have been using:
|
|||
|
||||
---
|
||||
|
||||

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

|
||||
|
||||
[sketch_2021_02_17_aspas](https://github.com/villares/sketch-a-day/tree/master/2021/sketch_2021_02_17_aspas) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||
|
||||
|
||||
---
|
||||
|
||||
I have to produce lighter gif files!
|
||||
(check on repo...)
|
||||
|
||||
sketch_2021_02_16
|
||||
|
||||
sketch_2021_02_15
|
||||
|
||||
sketch_2021_02_14
|
||||
|
||||
---
|
||||
|
||||

|
||||
|
||||
[sketch_2021_02_13a_cores](https://github.com/villares/sketch-a-day/tree/master/2021/sketch_2021_02_13a_cores) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||
|
@ -36,6 +60,15 @@ Here are listed some of the tools I have been using:
|
|||
|
||||
[sketch_2021_02_13_shoebot](https://github.com/villares/sketch-a-day/tree/master/2021/sketch_2021_02_13_shoebot) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||
|
||||
|
||||
---
|
||||
|
||||

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

|
||||
|
|
Ładowanie…
Reference in New Issue