From 02598e629eb3a3291784b297528c8596c964cd37 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 8 Apr 2020 00:43:47 +1000 Subject: Fix T73566: Mesh analysis, error showing intersecting faces --- source/blender/blenlib/intern/math_geom.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to '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 4c0d7e08a3c..a26824bd2b5 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -2379,7 +2379,10 @@ bool isect_tri_tri_epsilon_v3(const float t_a0[3], if (UNLIKELY(edge_fac == -1.0f)) { /* pass */ } - else if (edge_fac > 0.0f && edge_fac < 1.0f) { + /* Important to include 0.0f and 1.0f as one of the triangles vertices may be placed + * exactly on the plane. In this case both it's edges will have a factor of 0 or 1, + * but not be going through the plane. See T73566. */ + else if (edge_fac >= 0.0f && edge_fac <= 1.0f) { float ix_tri[3]; float span_fac; -- cgit v1.2.3