Alexandre B A Villares · @villares
16 followers · 19 posts · Server pynews.com.br
Alexandre B A Villares · @villares
13 followers · 17 posts · Server pynews.com.br
Alexandre B A Villares · @villares
13 followers · 16 posts · Server pynews.com.br

more experiments

#trimesh #processing #python #py5

Last updated 1 year ago

Michał Górny · @mgorny
186 followers · 853 posts · Server pol.social

Myślicie, że jest wam dzisiaj gorąco?

Najpierw walczyłem z nowym segfaultem w 2 z Pythonem 3.12. Nie udało mi się zajść daleko, co najwyżej ustalić, że to .

github.com/pydantic/pydantic/i

Potem testowałem świeży snapshot — tylko po to, by odkryć, że testy znów padly na 32-bitowych platformach. Po bisect'cie, okazało się, że przyczyną była zmiana "NFCi" (niezamierzająca zmian funkcjonalnych) do logiki hashowania — wygląda na to, że LLVM drukuje teraz funkcje w kolejności zależnej od platformy.

reviews.llvm.org/D158217#46009

Na koniec walczyłem z segfaultem w testach . Najwyraźniej jest to regresja związana z betą 1.26.0, więc wypracowałem backtrace i zgłosiłem błąd.

github.com/numpy/numpy/issues/

#python #gentoo #numpy #trimesh #llvm #heisenbug #pydantic

Last updated 1 year ago

Alexandre B A Villares · @villares
13 followers · 15 posts · Server pynews.com.br

experiments github.com/villares/sketch-a-day

#trimesh #processing #python #py5

Last updated 1 year ago

Alexandre B A Villares · @villares
13 followers · 14 posts · Server pynews.com.br
Alexandre B A Villares 🐍 · @villares
918 followers · 1854 posts · Server ciberlandia.pt

Look mom, can export (open on )

#python #trimesh #stl #meshlab

Last updated 2 years ago

Alexandre B A Villares 🐍 · @villares
917 followers · 1847 posts · Server ciberlandia.pt

I don't like much, usually toxic. Some of the Portuguese-language version moderators are plain horrible. On the other hand, once I had super-duper wonderful help from George Profenza stackoverflow.com/questions/56

So, I decide to post a question abour ... let's see if get lambasted.
stackoverflow.com/q/75500937/1

#stackoverflow #trimesh #3dmesh #python

Last updated 2 years ago

Alexandre B A Villares 🐍 · @villares
917 followers · 1844 posts · Server ciberlandia.pt

with +

from shapely import Polygon
import trimesh

pts = ((100, 100), (400, 100), (400, 400), (100, 400))
hole = ((150, 150), (350, 150), (350, 350), (150, 350))
p = Polygon(pts, [hole])
mesh = trimesh.creation.extrude_polygon(p, 100)
= trimesh.primitives.Extrusion(p, height=100)
other = mesh.copy()
other.apply_translation((150, 50, 50))
mesh = mesh.union(other)
.visual = trimesh.visual.ColorVisuals(
# other,
# [[255, 0, 0] for _ in other.visual.face_colors]
# )
for i, face in enumerate(mesh.faces):
x0, y0, z0 = mesh.vertices[face[0]]
x1, y1, z1 = mesh.vertices[face[1]]
x2, y2, z2 = mesh.vertices[face[2]]
if x0 == x1 and y0 != y1:
mesh.visual.face_colors[i][:] = 255, 0, 0, 255
.show()
import py5

def setup():
py5.size(700, 700, py5.P3D)

def draw():
py5.background(100, 200, 100)
py5.translate(350, 0)
py5.rotate_y(py5.radians(py5.mouse_x))
py5.translate(-350, 0)
draw_mesh(mesh)

def draw_mesh(m):
for i, face in enumerate(m.faces):
r, g, b, a = m.visual.face_colors[i]
py5.fill(r, g, b, a)
with py5.begin_closed_shape():
py5.vertices([m.vertices[v] for v in face])

py5.run_sketch()

#experimenting #python #trimesh #py5 #mesh #other

Last updated 2 years ago

Alexandre B A Villares 🐍 · @villares
905 followers · 1678 posts · Server ciberlandia.pt

"tip", on shapely v2.0.1 MultiPolygon is now hasheable!

(this is cool because I have now an easy way to check if my unions have changed before doing costly conversions...)

#python #shapely #trimesh

Last updated 2 years ago

Alexandre B A Villares 🐍 · @villares
886 followers · 1533 posts · Server ciberlandia.pt

today I added rotation to the captured glyphs...

#processing #python #py5 #shapely #trimesh

Last updated 2 years ago

Alexandre B A Villares 🐍 · @villares
877 followers · 1499 posts · Server ciberlandia.pt
Alexandre B A Villares 🐍 · @villares
865 followers · 1466 posts · Server ciberlandia.pt

sketch_2022_02_01 imported mode

import trimesh
import shapely

# iamkate.com/data/12-bit-rainbo
palette = (
'#817', '', '', '',
'', '', '', '',
'', '', '', '#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

Last updated 2 years ago