sketch_2022_02_01 #Processing #Python #py5 imported mode #shapely #trimesh #P3D
import trimesh
import shapely
# https://iamkate.com/data/12-bit-rainbow/
palette = (
'#817', '#a35', '#c66', '#e94',
'#ed0', '#9d5', '#4d8', '#2cb',
'#0bc', '#09c', '#36b', '#639'
)
def setup():
global m
size(400, 400, P3D)
no_stroke()
polygon = shapely.geometry.Polygon([(-100, -100), (0, -100),
(0, 0), (-50, -50), (-100, 0)])
m = trimesh.creation.extrude_polygon(polygon, 30)
def draw():
background(0)
translate(width /2, height / 2)
rotate_x(QUARTER_PI)
rotate_y(radians(mouse_x))
for i, face in enumerate(m.faces):
fill(palette[i % 12])
with begin_closed_shape():
vertices([m.vertices[v] for v in face])
#processing #python #py5 #shapely #trimesh #p3d #a35 #c66 #e94 #ed0 #9d5 #4d8 #2cb #0bc #09c #36b
#Processing #Python #py5 #genuary #genuary31 #トゥートProcessing
# https://iamkate.com/data/12-bit-rainbow/
palette = (
'#817', '#a35', '#c66', '#e94',
'#ed0', '#9d5', '#4d8', '#2cb',
'#0bc', '#09c', '#36b', '#639'
)
def setup():
size(800, 800)
no_stroke()
background(0)
def draw():
xc = yc = 400
for i in range(6):
m = 1 - abs(cos(radians(frame_count / 2))) ** 5
r = 150 + 150 * m
a = radians(frame_count / 2 + 60 * i)
x = xc + r * cos(a)
y = yc + r * sin(a)
fill(palette[i])
circle(x, y, 150)
r = 300 - 150 * m
a = a + radians(30)
x = xc + r * cos(a)
y = yc + r * sin(a)
fill(palette[-1 -i])
circle(x, y, 150)
#processing #python #py5 #genuary #genuary31 #トゥートprocessing #a35 #c66 #e94 #ed0 #9d5 #4d8 #2cb #0bc #09c #36b
#Processing #Python #py5 imported mode #genuary #genuary30 #トゥートProcessing
# Kate Rose Morley's palette
# https://iamkate.com/data/12-bit-rainbow/
from itertools import product
palette = (
'#817', '#a35', '#c66', '#e94',
'#ed0', '#9d5', '#4d8', '#2cb',
'#0bc', '#09c', '#36b', '#639'
)
def setup():
global palavras
size(800, 800)
no_loop()
rect_mode(CENTER)
no_stroke()
def draw():
w = 400
i = 0
for x, y in product(range(0, width, w), repeat=2):
for z in range(3):
fill(palette[i])
square(w / 2 + x, w / 2 + y, w / (z / 2 + 1))
i += 1
#processing #python #py5 #genuary #genuary30 #トゥートprocessing #a35 #c66 #e94 #ed0 #9d5 #4d8 #2cb #0bc #09c #36b