Skip to content

Commit

Permalink
Format readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
fire committed Oct 1, 2024
1 parent 849111f commit a4049e9
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions modules/robust_skin_weight_transfer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,16 @@ be loaded in other 3D software (Blender, Unreal, etc.).

Blender addon (by Sent From Space) - https://sentfromspacevr.gumroad.com/l/robust-weight-transfer


## Shrinkwrap operator

iFire — Today
I have that operator.
def find_closest_point_on_surface(points, mesh_vertices, mesh_triangles):
"""
Args:
points (np.ndarray): An array of shape (#points, 3), where each row represents the coordinates of a point in 3D space.
mesh_vertices (np.ndarray): An array of shape (#mesh_vertices, 3), representing the vertices of the target mesh surface.
mesh_triangles (np.ndarray): An array of shape (#mesh_triangles, 3), where each row contains indices that correspond to the vertices forming a triangle on the target mesh surface.
"""
Args:
points (np.ndarray): An array of shape (#points, 3), where each row represents the coordinates of a point in 3D space.
mesh_vertices (np.ndarray): An array of shape (#mesh_vertices, 3), representing the vertices of the target mesh surface.
mesh_triangles (np.ndarray): An array of shape (#mesh_triangles, 3), where each row contains indices that correspond to the vertices forming a triangle on the target mesh surface.

Returns:
tuple: A tuple containing four elements:
Expand All @@ -57,27 +56,27 @@ def find_closest_point_on_surface(points, mesh_vertices, mesh_triangles):
- closest_points (np.ndarray): An array of shape (#points, 3), representing the coordinates of the closest points on the target mesh surface for each input point.
- barycentric_coordinates (np.ndarray): An array of shape (#points, 3), providing the barycentric coordinates of each closest point relative to the vertices of the triangle it lies on.
"""

I feel like I have all the pieces, but missing something obvious.
given barycentric_coordinates we can find the normal on the triangle index / triangle positions
given barycentric_coordinates we can find the normal on the triangle index / triangle positions

janie bean — Today

A shrinkwrap operator takes verts and snaps them to the closest point on a mesh + offset * normal, right?
A shrinkwrap operator takes verts and snaps them to the closest point on a mesh + offset \* normal, right?
the only part i don't know how to do is that "find closest point on mesh" operation
and then...find the normal of it

janie bean — Today

Yeah, so like, to create a "cage" for a mesh you basically just take the position of each vert and add the normal * an offset
Yeah, so like, to create a "cage" for a mesh you basically just take the position of each vert and add the normal \* an offset
and a shrinkwrap basically takes a mesh and snaps it to the cage of another mesh

if find_closest_point_on_surface can get the normal of that point, then can it also get the weight?

Chev — Today

you can use the index of the triangle to look up other informations
it's the backend of robust weight transfer. trying to port it from python to c++
it's the backend of robust weight transfer. trying to port it from python to c++

janie bean — Today

Expand Down

0 comments on commit a4049e9

Please sign in to comment.