You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does trimesh provide a way to slice a mesh with a plane and not drop the texture visual?
As of version 3.21.5, in mesh.slice_plane, the sliced vertices/faces are assigned to a new mesh without any material, because no uvs are computed for the newly created vertices.
In theory it seems almost straightforward - for every vertex that is created by cutting one edge, compute the barycentric coordinates of said vertex with respect to the vertices that make the edge, and interpolate their uvs.
The slice_mesh_plane could accept uvs (or any attribute for that matter, e.g. vertex normals) and return them interpolated.
In practice I'm finding it difficult to patch the function to do that, so I was wondering if you had a fix planned or something in the making already?
Thanks!
The text was updated successfully, but these errors were encountered:
Yeah that's just not implemented and there's no fixes on the horizon, PR's welcome!! I like the idea of doing it for arbitrary vertex attributes too. Agreed the logic in there is pretty dense and it's hard to figure out exactly where to plug in the barycentric interpolation, when I briefly looked into it.
Does trimesh provide a way to slice a mesh with a plane and not drop the texture visual?
As of version 3.21.5,
in mesh.slice_plane
, the sliced vertices/faces are assigned to a new mesh without any material, because no uvs are computed for the newly created vertices.In theory it seems almost straightforward - for every vertex that is created by cutting one edge, compute the barycentric coordinates of said vertex with respect to the vertices that make the edge, and interpolate their uvs.
The
slice_mesh_plane
could accept uvs (or any attribute for that matter, e.g. vertex normals) and return them interpolated.In practice I'm finding it difficult to patch the function to do that, so I was wondering if you had a fix planned or something in the making already?
Thanks!
The text was updated successfully, but these errors were encountered: