Skip to content

Commit

Permalink
fix spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
m-reuter committed Dec 16, 2024
1 parent 989a716 commit b92fc48
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lapy/tria_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -1210,8 +1210,8 @@ def reduce_edges_to_path(edges, start_idx=None, get_edge_idx=False):
Array of length n+1 containing indices as single path from start to
endpoint.
edge_idx: array
Array of length n containing coresponding edge idx into edges for each
path segment. Ony passed if get_edges_idx is True.
Array of length n containing corresponding edge idx into edges for each
path segment. Only passed if get_edges_idx is True.
"""
from scipy.sparse.csgraph import shortest_path

Expand Down Expand Up @@ -1314,7 +1314,7 @@ def level_path(self, vfunc, level, get_tria_idx=False, n_points=None):
Length of level set.
tria_idx : array
Array of triangle index for each edge segment on the path (length n-1
if path is langth n). Will only be returned if get_tria_idx is True.
if path is length n). Will only be returned if get_tria_idx is True.
"""
if vfunc.ndim > 1:
raise ValueError(f"vfunc needs to be 1-dim, but is {vfunc.ndim}-dim!")
Expand Down Expand Up @@ -1371,7 +1371,7 @@ def level_path(self, vfunc, level, get_tria_idx=False, n_points=None):
p1 = np.squeeze(p[edge_idxs[:, 0]])
p2 = np.squeeze(p[edge_idxs[:, 1]])
llength = np.sqrt(((p1 - p2) ** 2).sum(1)).sum()
# compute path from undordered, not-directed edge list
# compute path from unordered, not-directed edge list
# and return path as list of points, and path length
if get_tria_idx:
path, edge_idx = TriaMesh.reduce_edges_to_path(
Expand All @@ -1381,7 +1381,7 @@ def level_path(self, vfunc, level, get_tria_idx=False, n_points=None):
tria_idx = t_idx[edge_idx]
else:
path = TriaMesh.reduce_edges_to_path(edge_idxs, get_tria_idx)
# remove dupliacte vertices (happens when levelset hits a vertex almost
# remove duplicate vertices (happens when levelset hits a vertex almost
# perfectly)
path3d = p[path, :]
dd = ((path3d[0:-1, :] - path3d[1:, :]) ** 2).sum(1)
Expand All @@ -1392,7 +1392,7 @@ def level_path(self, vfunc, level, get_tria_idx=False, n_points=None):
path3d = path3d[dd > eps, :]
if get_tria_idx:
if n_points:
raise ValueError("n_points cannot be combined wiht get_tria_idx=True.")
raise ValueError("n_points cannot be combined with get_tria_idx=True.")
tria_idx = tria_idx[dd[:-1] > eps]
return path3d, llength, tria_idx
else:
Expand Down

0 comments on commit b92fc48

Please sign in to comment.