[Bf-blender-cvs] [16355d545b9] master: Fix T52834: Polyfill2D fails with co-linear edges

Campbell Barton noreply at git.blender.org
Tue Sep 19 20:19:01 CEST 2017


Commit: 16355d545b936f42008f1eeac7835f8b4130048d
Author: Campbell Barton
Date:   Wed Sep 20 04:29:04 2017 +1000
Branches: master
https://developer.blender.org/rB16355d545b936f42008f1eeac7835f8b4130048d

Fix T52834: Polyfill2D fails with co-linear edges

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

M	source/blender/blenlib/intern/polyfill2d.c
M	tests/gtests/blenlib/BLI_polyfill2d_test.cc

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

diff --git a/source/blender/blenlib/intern/polyfill2d.c b/source/blender/blenlib/intern/polyfill2d.c
index 5f9b92198a5..26f8709b16e 100644
--- a/source/blender/blenlib/intern/polyfill2d.c
+++ b/source/blender/blenlib/intern/polyfill2d.c
@@ -411,11 +411,11 @@ static bool kdtree2d_isect_tri_recursive(
 	}
 
 #define KDTREE2D_ISECT_TRI_RECURSE_NEG \
-	(((node->neg != KDNODE_UNSET) && (co[node->axis] > bounds[node->axis].min)) &&   \
+	(((node->neg != KDNODE_UNSET) && (co[node->axis] >= bounds[node->axis].min)) &&  \
 	  (kdtree2d_isect_tri_recursive(tree, tri_index, tri_coords, tri_center, bounds, \
 	                                &tree->nodes[node->neg])))
 #define KDTREE2D_ISECT_TRI_RECURSE_POS \
-	(((node->pos != KDNODE_UNSET) && (co[node->axis] < bounds[node->axis].max)) &&   \
+	(((node->pos != KDNODE_UNSET) && (co[node->axis] <= bounds[node->axis].max)) &&  \
 	  (kdtree2d_isect_tri_recursive(tree, tri_index, tri_coords, tri_center, bounds, \
 	                                &tree->nodes[node->pos])))
 
diff --git a/tests/gtests/blenlib/BLI_polyfill2d_test.cc b/tests/gtests/blenlib/BLI_polyfill2d_test.cc
index 5f10837fca1..ca3a67bd0a7 100644
--- a/tests/gtests/blenlib/BLI_polyfill2d_test.cc
+++ b/tests/gtests/blenlib/BLI_polyfill2d_test.cc
@@ -540,7 +540,6 @@ TEST(polyfill2d, IssueT41986_axis_align)
 	TEST_POLYFILL_TEMPLATE_STATIC(poly, false);
 }
 
-#if 0
 /* Blender bug T52834 */
 TEST(polyfill2d, IssueT52834_axis_align_co_linear)
 {
@@ -554,5 +553,3 @@ TEST(polyfill2d, IssueT52834_axis_align_co_linear)
 
 	TEST_POLYFILL_TEMPLATE_STATIC(poly, false);
 }
-#endif
-



More information about the Bf-blender-cvs mailing list