[yt-svn] commit/yt: ngoldbaum: Merged in atmyers/yt (pull request #2267)

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Sat Jul 9 14:52:16 PDT 2016


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/96474e2371d1/
Changeset:   96474e2371d1
Branch:      yt
User:        ngoldbaum
Date:        2016-07-09 21:51:46+00:00
Summary:     Merged in atmyers/yt (pull request #2267)

[BUGFIX] Fix divide-by-zero error that occasionally happens in triangle_plane_intersect.
Affected #:  1 file

diff -r def3048e837a3e747938bf8529273816f17c3a56 -r 96474e2371d16811f1cc105b5e0c7fdb6a9f5dc3 yt/utilities/lib/geometry_utils.pyx
--- a/yt/utilities/lib/geometry_utils.pyx
+++ b/yt/utilities/lib/geometry_utils.pyx
@@ -490,6 +490,8 @@
     cdef np.float64_t t
     for j in range(3):
         vec[j] = p1[j] - p0[j]
+    if vec[ax] == 0.0:
+        return  # bail if the line is in the plane
     t = (coord - p0[ax])/vec[ax]
     # We know that if they're on opposite sides, it has to intersect.  And we
     # won't get called otherwise.
@@ -521,7 +523,7 @@
         for j in range(3):
             p0[j] = triangles[i, 0, j]
             p1[j] = triangles[i, 1, j]
-            p3[j] = triangles[i, 2, j]            
+            p3[j] = triangles[i, 2, j]
             plane_norm[j] = 0.0
         plane_norm[ax] = 1.0
         subtract(p1, p0, E0)

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list