Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inverse of parametrization #150

Closed
jonnest opened this issue Dec 13, 2022 · 2 comments · Fixed by #182
Closed

Inverse of parametrization #150

jonnest opened this issue Dec 13, 2022 · 2 comments · Fixed by #182

Comments

@jonnest
Copy link

jonnest commented Dec 13, 2022

Hello all,
I am working on a python project, where I want to use the "as-rigid-as-possible" parametrization to transform a 3D mesh to a 2D disk.
I got the "faces" and "vertices" of my 3D triangulated surface.

Then, I use the code from the tutorial to map the 3D geometry onto the 2D disk.

# get boundary id's from faces
bnd = igl.boundary_loop(faces)
# map boundary on circle
bnd_uv = igl.map_vertices_to_circle(vertices, bnd)

# Harmonic parametrization for the internal vertices
uv = igl.harmonic_weights(vertices, faces, bnd, bnd_uv, algorithm_nr)

arap = igl.ARAP(vertices, faces, 2, np.zeros(0))

uva = arap.solve(np.zeros((0, 0)), uv)

v_p = np.hstack([uva, np.zeros((uv.shape[0],1))])

Now, what I am trying to do is, to get the inverse transformation from the "v_p" back to my 3D triangulated mesh.
Basically, I want to use another 'uniform' mesh of the 2D disk and back-transform it in the original 3D space.

Is there any possibility to get this inverse transformation?

@alecjacobson
Copy link
Contributor

There's a reasonably good way to do this but unfortunately we're missing some crucial bindings (#170). There may be a hacky way around it for now that I'll try to post later.

@jonnest
Copy link
Author

jonnest commented Feb 8, 2023

Thank you @alecjacobson for your response!

I really would be interested in some solution, also in the hacky way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants