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

Geodesic Path Issues: Computing length of 1D mesh and finding shortest path doesn't always work #260

Closed
banesullivan opened this issue Jun 14, 2019 · 7 comments
Labels
bug Uh-oh! Something isn't working as expected.

Comments

@banesullivan
Copy link
Member

The length calculation for the geodesic path is not correctly implemented:

length = self.geodesic(start_vertex, end_vertex).GetLength()

The GetLength() method of a VTK mesh actually returns the length of the diagonal of that mesh's bounding box:

V.GetLength() -> float
C++: double GetLength()

Return the length of the diagonal of the bounding box. THIS
METHOD IS THREAD SAFE IF FIRST CALLED FROM A SINGLE THREAD AND
THE DATASET IS NOT MODIFIED

Note that this is relevant to #252

Pinging @supersubscript - are you using this feature? If so you may be getting incorrect results...

@banesullivan banesullivan added the bug Uh-oh! Something isn't working as expected. label Jun 14, 2019
@banesullivan banesullivan changed the title Computing length of 1D mesh Geodesic Path Issues: Computing length of 1D mesh and doesn't always work Jun 14, 2019
@banesullivan
Copy link
Member Author

Also note that the shortest path is not always found:

import pyvista as pv
from pyvista import examples

sphere = examples.load_globe()

geodesic = sphere.geodesic(10, sphere.n_points-40)

p = pv.Plotter(notebook=0)
p.add_mesh(geodesic, line_width=10, color='red', label='Geodesic Path')
p.add_mesh(sphere, show_edges=True, )
p.camera_position = [-1,-1,1]
p.add_legend()
p.show()

Screen Shot 2019-06-14 at 11 17 25 AM

@banesullivan banesullivan changed the title Geodesic Path Issues: Computing length of 1D mesh and doesn't always work Geodesic Path Issues: Computing length of 1D mesh and finding shortest path doesn't always work Jun 14, 2019
@banesullivan
Copy link
Member Author

The length issue should be resolved by #261 but I'm still concerned that the path is not always the shortest path as shown in #260 (comment)

@supersubscript
Copy link
Member

Huh, that's confusing. Thanks for raising the issue, @banesullivan. It does indeed affect my computations.

Also very strange that path isn't always the shortest one.

@banesullivan
Copy link
Member Author

I suppose the shortest path issue is on the VTK side with the vtkDijkstraGraphGeodesicPath algorithm and not something we can fix in PyVista? I’ll post this issue on VTKs discourse to see if anyone there has insight.

@banesullivan
Copy link
Member Author

@banesullivan
Copy link
Member Author

Closing issue as I don't think there is anything we can do on the PyVista side

@banesullivan
Copy link
Member Author

banesullivan commented Jun 15, 2019

So this is actually just an artifact of how I created this Globe mesh - it’s split on the 0 degree meridian so the path has to go to the poles to get around it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Uh-oh! Something isn't working as expected.
Projects
None yet
Development

No branches or pull requests

2 participants