mikedh / trimesh

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

Mapping vertex-centered data to face centered-data #1736

Open nrgrady opened 1 year ago

nrgrady commented 1 year ago

I feel like this is a silly question that is easily answered, but I keep finding innovative ways of doing this wrong.

I have data that is vertex-centered with the corresponding vertices. I know how to get the indices of the corresponding faces, but I can't seem to Google-up the function that easily and conveniently allows me to map the data to the faces using the built-in barycentric capabilities of trimesh. It seems like there is a way, I'm just missing it.

mikedh commented 1 year ago

No worries, does the trimesh.triangles.points_to_barycentric example I put in #1733 help?

nrgrady commented 1 year ago

I don't think so. I suppose I had poor choice of wording in the original question.

I think my question is even easier since I don't want to remap the data, simply interpolate the vertex data to the corresponding faces.