[Bf-blender-cvs] [54ad576] master: Small tri intersect fails when not normalized

Campbell Barton noreply at git.blender.org
Thu Sep 3 18:08:52 CEST 2015


Commit: 54ad5766669a23976b9a9fab379bb44ba740c9be
Author: Campbell Barton
Date:   Fri Sep 4 01:56:51 2015 +1000
Branches: master
https://developer.blender.org/rB54ad5766669a23976b9a9fab379bb44ba740c9be

Small tri intersect fails when not normalized

Logic was ok, but would run into precision issues.

===================================================================

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 65625db..feb9f7d 100644
--- a/source/blender/blenlib/intern/math_geom.c
+++ b/source/blender/blenlib/intern/math_geom.c
@@ -1600,8 +1600,9 @@ bool isect_tri_tri_epsilon_v3(
 
 	BLI_assert((r_i1 != NULL) == (r_i2 != NULL));
 
-	cross_tri_v3(no_a, UNPACK3(tri_pair[0]));
-	cross_tri_v3(no_b, UNPACK3(tri_pair[1]));
+	/* normalizing is needed for small triangles T46007 */
+	normal_tri_v3(no_a, UNPACK3(tri_pair[0]));
+	normal_tri_v3(no_b, UNPACK3(tri_pair[1]));
 
 	if (isect_plane_plane_v3(plane_co, plane_no, t_a0, no_a, t_b0, no_b)) {
 		/**




More information about the Bf-blender-cvs mailing list