more #trimesh experiments #Processing #Python #py5
#trimesh #processing #python #py5
Myślicie, że jest wam dzisiaj gorąco?
Najpierw walczyłem z nowym segfaultem w #pydantic 2 z Pythonem 3.12. Nie udało mi się zajść daleko, co najwyżej ustalić, że to #heisenbug.
https://github.com/pydantic/pydantic/issues/7181
Potem testowałem świeży snapshot #LLVM — 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.
https://reviews.llvm.org/D158217#4600956
Na koniec walczyłem z segfaultem w testach #trimesh. Najwyraźniej jest to regresja związana z betą #numpy 1.26.0, więc wypracowałem backtrace i zgłosiłem błąd.
#python #gentoo #numpy #trimesh #llvm #heisenbug #pydantic
#trimesh experiments github.com/villares/sketch-a-day #Processing #Python #py5
#trimesh #processing #python #py5
I don't like #StackOverflow 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 https://stackoverflow.com/questions/56999816/is-it-possible-to-use-jcsg-library-with-processing
So, I decide to post a question abour #trimesh... let's see if get lambasted.
https://stackoverflow.com/q/75500937/19771
#stackoverflow #trimesh #3dmesh #python
#experimenting with #Python #trimesh + #py5
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)
#mesh = trimesh.primitives.Extrusion(p, height=100)
other = mesh.copy()
other.apply_translation((150, 50, 50))
mesh = mesh.union(other)
#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
#mesh.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
#Processing #Python #py5 #shapely #trimesh today I added rotation to the captured glyphs...
#processing #python #py5 #shapely #trimesh
sketch 2022_02_03 #Processing #Python #py5 #trimesh #shapely
#processing #python #py5 #trimesh #shapely
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