[Bf-blender-cvs] [a4e1517] master: Fix isect_point_tri_v3 w/ degenerate faces
Campbell Barton
noreply at git.blender.org
Thu Dec 3 12:44:29 CET 2015
Commit: a4e151704fe2e586a93a9beb5010cd830200b485
Author: Campbell Barton
Date: Thu Dec 3 22:32:01 2015 +1100
Branches: master
https://developer.blender.org/rBa4e151704fe2e586a93a9beb5010cd830200b485
Fix isect_point_tri_v3 w/ degenerate faces
Ensure point_in_slice returns false when zero area faces are passed.
===================================================================
M source/blender/blenlib/intern/math_geom.c
===================================================================
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c
index f8bcbae..14e494a 100644
--- a/source/blender/blenlib/intern/math_geom.c
+++ b/source/blender/blenlib/intern/math_geom.c
@@ -2355,7 +2355,9 @@ static bool point_in_slice(const float p[3], const float v1[3], const float l1[3
sub_v3_v3v3(rp, p, v1);
h = dot_v3v3(q, rp) / dot_v3v3(q, q);
- return (h < 0.0f || h > 1.0f) ? false : true;
+ /* note: when 'h' is nan/-nan, this check returns false
+ * without explicit check - covering the degenerate case */
+ return (h >= 0.0f && h <= 1.0f);
}
#if 0
More information about the Bf-blender-cvs
mailing list