Skip to content

Commit d202d26

Browse files
authored
Fix find_intersection in space_ops.py (#2580)
* revert a change to find_intersections * fix new implementation
1 parent a038288 commit d202d26

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

manim/utils/space_ops.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,8 @@ def find_intersection(
570570

571571
for p0, v0, p1, v1 in zip(*[p0s, v0s, p1s, v1s]):
572572
normal = np.cross(v1, np.cross(v0, v1))
573-
result += [p0 + np.dot(p1 - p0, normal) / np.dot(v0, normal) * v0]
573+
denom = max(np.dot(v0, normal), threshold)
574+
result += [p0 + np.dot(p1 - p0, normal) / denom * v0]
574575
return result
575576

576577

0 commit comments

Comments
 (0)