Publicações públicas de @villares@ciberlandia.pt

Recent twts from @villares@ciberlandia.pt

I really like @bitartbot@bitartbot an I always wanted to try some of the patterns with #py5 (#Processing + #Python), also #numpy vectorization seemed cool to try…

#print(pattern) img = py5.create_image_from_numpy(pattern * 255, 'L') py5.image(img, 0, 0, py5.width, py5.height) py5.save('out.png') @np.vectorize def func(x, y): try: return (~(int((x & y) / (x ^ 8)) | ((y * 10) % (~x)))) % 3 > 0 except ZeroDivisionError: return 0 py5.run_sketch(block=False) " target="_blank"> Image

⤋ Read More

#Processing #Python #numpy #shapely #py5 #sketchAday for 24th and 25th May

#def draw(): background(200) fill(255, 100) draw_shapely(mp) fill(0, 200, 0, 200) draw_shapely(union) save('out.png') def draw_shapely(shp): if isinstance(shp, (MultiPolygon, MultiLineString)): for p in shp.geoms: draw_shapely(p) elif isinstance(shp, Polygon): begin_shape() for x,y in shp.exterior.coords: vertex(x,y) for hole in shp.interiors: begin_contour() for x,y in hole.coords: vertex(x,y) end_contour() end_shape(CLOSE) elif isinstance(shp, LineString): with push_style(): no_fill() begin_shape() for x,y in shp.coords: vertex(x,y) end_shape()" target="_blank"> Image


⤋ Read More