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

Poor geodesic distance accuracy in a simple case #5

Closed
brucedjones opened this issue Oct 6, 2021 · 3 comments
Closed

Poor geodesic distance accuracy in a simple case #5

brucedjones opened this issue Oct 6, 2021 · 3 comments

Comments

@brucedjones
Copy link

Forgive me if my expectations for accuracy are unreasonable for the HEAT method. I have the following minimal example

import numpy as np
from potpourri3d import MeshHeatMethodDistanceSolver

solver = MeshHeatMethodDistanceSolver(np.array([[0, 0, 0], [1, 0, 0], [0, 1, 0]]), np.array([[0, 1, 2]]))
solver.compute_distance(0) # -> array([0.        , 0.70710654, 0.70710654])
solver.compute_distance(1) # -> array([0.91430181, 0.        , 1.31933315])
solver.compute_distance(2) # -> array([0.91430181, 1.31933315, 0.        ])

The fact that the first example is returning distances of sqrt(2)/2 makes it seem like this is a bug rather than a limitation of the method somehow.

Its worth noting that setting t_coef=0.001 makes the results of the second two cases more accurate, but the first case returns [0. , 0.70710654, 0.70710654] no matter the value of t_coef

@nmwsharp
Copy link
Owner

Hi! Thanks for reaching out.

What you observe here sounds correct and is the typical behavior of this algorithm. The Heat Method is a PDE-based method, so it works by solving a sequence of partial differential equations on the surface. This is great because it gives it nice smooth results and allows us to leverage fast numerical solvers, but a small downside is that your mesh needs to have enough vertices to accurately represent the solution. This is similar to simulation problems, where simulating on an extremely coarse mesh often doesn't work well.

You should find that if you refine the mesh to have more vertices, the solution quickly becomes more accurate.

For a fancier solution to this problem, intrinsic refinement quickly produce meshes on which PDEs are very accurately solved, while avoiding many of the usual pitfalls of remeshing (however, this refinement is not currently exposed in Potpourri3d, only a simpler intrinsic flipping :) )

I also just added a small note to the potpourri3d readme about topic.

@brucedjones
Copy link
Author

Understood, thanks for the response! It would be great to expose more of the functionality supported by the intrinsic triangulation in general!

@brucedjones
Copy link
Author

Will close this issue since it doesn't seem like theres much actually actionable on this.

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

No branches or pull requests

2 participants