Skip to content

Commit

Permalink
docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedh committed Oct 25, 2023
1 parent 8adb33f commit 6b4cda1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions trimesh/interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

def intersection(a: NDArray[float64], b: NDArray[float64]) -> NDArray[float64]:
"""
Given a pair of ranges, merge them in to
one range if they overlap at all
Given pairs of ranges merge them in to
one range if they overlap.
Parameters
--------------
Expand All @@ -27,7 +27,7 @@ def intersection(a: NDArray[float64], b: NDArray[float64]) -> NDArray[float64]:
--------------
inter : (2, ) or (2, 2) float
The unioned range from the two inputs,
if not overlapping ptp will be zero.
if not `inter.ptp(axis=1)` will be zero.
"""
a = np.array(a, dtype=np.float64)
b = np.array(b, dtype=np.float64)
Expand Down
2 changes: 2 additions & 0 deletions trimesh/path/segments.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,11 @@ def clean(segments: NDArray[float64], digits: int = 10) -> NDArray[float64]:
# collect new unified paramameters
p, o, v = [], [], []
for g in group_rows(np.column_stack((origins, vectors)), digits=digits):
# union the intervals sorting ourselves to skip the `sort(axis=1)` we did above
group = param[g]
u = interval.union(group[group[:, 0].argsort()], sort=False)
p.extend(u)
# use the origins for the subsetted union
o.extend(origins[g[: len(u)]])
v.extend(vectors[g[: len(u)]])

Expand Down

0 comments on commit 6b4cda1

Please sign in to comment.