kopia lustrzana https://github.com/villares/sketch-a-day
main
rodzic
54405ce97e
commit
cdea3c82ee
Plik binarny nie jest wyświetlany.
Po Szerokość: | Wysokość: | Rozmiar: 795 KiB |
|
@ -0,0 +1,46 @@
|
||||||
|
# shoebot (code to be run with sbot runner)
|
||||||
|
|
||||||
|
from math import *
|
||||||
|
from random import randint
|
||||||
|
PI, QUARTER_PI, HALF_PI = pi, pi / 4, pi / 2
|
||||||
|
# frame_count = 0
|
||||||
|
|
||||||
|
def setup():
|
||||||
|
size(600, 600)
|
||||||
|
strokewidth(1)
|
||||||
|
colorrange(255)
|
||||||
|
speed(1)
|
||||||
|
|
||||||
|
def draw():
|
||||||
|
global frame_count
|
||||||
|
background(200)
|
||||||
|
stroke(0)
|
||||||
|
pontos = []
|
||||||
|
for i in range(12):
|
||||||
|
r = randint(WIDTH / 10, WIDTH / 4)
|
||||||
|
xo = randint(r, WIDTH - r)
|
||||||
|
yo = randint(r, HEIGHT - r)
|
||||||
|
for a in range (36):
|
||||||
|
x = xo + r * sin(radians(a * 10))
|
||||||
|
y = yo + r * cos(radians(a * 10))
|
||||||
|
pontos.append((x, y))
|
||||||
|
for xa, ya in pontos:
|
||||||
|
for xb, yb in pontos:
|
||||||
|
not_same = (xa, ya) != (xb, yb)
|
||||||
|
if not_same and 30 < dist((xa, ya), (xb, yb)) < 50:
|
||||||
|
stroke(0, 0, 128)
|
||||||
|
line(xa, ya, xb, yb)
|
||||||
|
if not_same and dist((xa, ya), (xb, yb)) < 30:
|
||||||
|
stroke(0, 128, 0 )
|
||||||
|
line(xa, ya, xb, yb)
|
||||||
|
|
||||||
|
# frame_count += 1
|
||||||
|
|
||||||
|
def lerp(a, b, t):
|
||||||
|
return a * (1 - t) + b * t
|
||||||
|
|
||||||
|
|
||||||
|
def lerp_tuple(a, b, t):
|
||||||
|
return tuple(lerp_tuple(ca, cb, t) if isinstance(ca, tuple)
|
||||||
|
else lerp(ca, cb, t)
|
||||||
|
for ca, cb in zip(a, b))
|
|
@ -27,6 +27,12 @@ Here are listed some of the tools I have been using:
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
[sketch_2021_08_16b_shoebot](https://github.com/villares/sketch-a-day/tree/master/2021/sketch_2021_08_16b_shoebot) [[shoebot](http://shoebot.net/)]
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
[sketch_2021_08_15b_shoebot](https://github.com/villares/sketch-a-day/tree/master/2021/sketch_2021_08_15b_shoebot) [[shoebot](http://shoebot.net/)]
|
[sketch_2021_08_15b_shoebot](https://github.com/villares/sketch-a-day/tree/master/2021/sketch_2021_08_15b_shoebot) [[shoebot](http://shoebot.net/)]
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
#! /usr/bin/python3
|
||||||
|
|
||||||
|
# [ ] add this to terminal aliases
|
||||||
|
# check last folder...
|
||||||
|
# doplicate/rename new folder
|
||||||
|
# remove images
|
||||||
|
# rename file
|
||||||
|
|
||||||
|
import os
|
||||||
|
from helpers import is_img_ext
|
||||||
|
|
||||||
|
cwd = os.getcwd()
|
||||||
|
nome_pasta = os.path.split(cwd)[-1]
|
||||||
|
# nomes_arquivos = sorted(os.listdir(cwd))
|
||||||
|
# # Procura imagens no diretório corrente
|
||||||
|
# nomes_imagens = [file_name for file_name in nomes_arquivos
|
||||||
|
# if is_img_ext(file_name)]
|
||||||
|
# # Imagens boas são as que tem o mesmo nome da pasta!
|
||||||
|
# imagens_boas = [nome_imagem for nome_imagem in nomes_imagens
|
||||||
|
# if nome_imagem.startswith(nome_pasta)]
|
||||||
|
# if imagens_boas:
|
||||||
|
# print('Não precisei fazer nada!')
|
||||||
|
# elif nomes_imagens:
|
||||||
|
# # vai renomear a primeira para ficar com o nome da pasta
|
||||||
|
# nome_imagem = nomes_imagens[0]
|
||||||
|
# ext = nome_imagem.split('.')[-1]
|
||||||
|
# novo_nome = nome_pasta + '.' + ext
|
||||||
|
# os.rename(nome_imagem, novo_nome)
|
||||||
|
# print(nome_imagem + ' -> ' + novo_nome)
|
||||||
|
# else:
|
||||||
|
# print('Não encontrei imagens!')
|
||||||
|
#
|
Ładowanie…
Reference in New Issue