@@ -26,10 +26,12 @@ def geodesic_distance_matrix(surface: SurfaceData) -> np.ndarray:
2626
2727 """
2828 import gdist
29+ from .._utils import sanitize_faces
2930
3031 # Reorder the faces of the surface to ensure consistent orientation
31- faces = np .asarray (surface [1 ], dtype = np .int32 )
32- vertices = np .asarray (surface [0 ], dtype = np .float64 )
32+ sanitized_surface = sanitize_faces (surface )
33+ vertices = sanitized_surface [0 ]
34+ faces = sanitized_surface [1 ]
3335
3436 distance_matrix = gdist .local_gdist_matrix (
3537 vertices , faces , max_distance = 1e9 ).toarray ()
@@ -62,8 +64,13 @@ def geodesic_path(
6264
6365 """
6466 import potpourri3d as pp3d
67+ from .._utils import sanitize_faces
6568
66- path_solver = pp3d .EdgeFlipGeodesicSolver (surface [0 ], surface [1 ])
69+ sanitized_surface = sanitize_faces (surface )
70+ vertices = sanitized_surface [0 ]
71+ faces = sanitized_surface [1 ]
72+
73+ path_solver = pp3d .EdgeFlipGeodesicSolver (vertices , faces )
6774 path = path_solver .find_geodesic_path (index_1 , index_2 )
6875
6976 # convert points to vectors from point to point
@@ -224,8 +231,10 @@ def local_extrema_analysis(
224231 - `min_max_pair_distances`: Distances between all pairs of local minima and maxima.
225232 - `min_max_pair_anisotropies`: Difference in input value `(vertices, faces, values)` between all pairs of local minima and maxima.
226233 """
227- triangles = surface [ 1 ]
234+ from .. _utils import sanitize_faces
228235 feature = surface [2 ]
236+ surface = sanitize_faces (surface )
237+ triangles = surface [1 ]
229238
230239 quad_fit = len (feature )
231240
0 commit comments