mikedh / trimesh

Python library for loading and using triangular meshes.
https://trimesh.org
MIT License
3.02k stars 583 forks source link

Fix vertex_attributes subdivisions and corresponding test added. #2322

Closed dbukenberger closed 1 week ago

dbukenberger commented 2 weeks ago

Hey Mike,

I think in the simple subdivision routine, the vertex attribute computation somehow got a bit jumbled. There is some linear triangle-edge interpolation going on - but the new attributes do not match the values that I would have expected.

Thus, I have simplified the per-edge attribute interpolation to be analog to the actual subdiv-vertex position computation and added a testcase to verify.

Cheers Dennis

mikedh commented 1 week ago

Looks good, thanks for the fix and test! Yeah I agree simpler is probably better here.