[Bf-blender-cvs] [17f0a01] master: Correct last commit checking knife edges

Campbell Barton noreply at git.blender.org
Tue Dec 9 20:57:37 CET 2014


Commit: 17f0a01a5664b37f7ae26fef13ffed68794cc066
Author: Campbell Barton
Date:   Tue Dec 9 20:26:00 2014 +0100
Branches: master
https://developer.blender.org/rB17f0a01a5664b37f7ae26fef13ffed68794cc066

Correct last commit checking knife edges

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

M	source/blender/editors/mesh/editmesh_knife.c

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

diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c
index f771192..6b68eef 100644
--- a/source/blender/editors/mesh/editmesh_knife.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -1476,16 +1476,19 @@ static void knife_find_line_hits(KnifeTool_OpData *kcd)
 	for (val = BLI_smallhash_iternew(&kfes, &hiter, (uintptr_t *)&kfe); val;
 	     val = BLI_smallhash_iternext(&hiter, (uintptr_t *)&kfe))
 	{
+		int kfe_verts_in_cut;
 		/* if we intersect both verts, don't attempt to intersect the edge */
-		if (BLI_smallhash_lookup(&kfvs, (intptr_t)kfe->v1) &&
-		    BLI_smallhash_lookup(&kfvs, (intptr_t)kfe->v2))
-		{
+
+		kfe_verts_in_cut = (BLI_smallhash_lookup(&kfvs, (intptr_t)kfe->v1) != NULL) +
+		                   (BLI_smallhash_lookup(&kfvs, (intptr_t)kfe->v2) != NULL);
+
+		if (kfe_verts_in_cut == 2) {
 			continue;
 		}
 
 		knife_project_v2(kcd, kfe->v1->cageco, se1);
 		knife_project_v2(kcd, kfe->v2->cageco, se2);
-		isect_kind = isect_seg_seg_v2_point(s1, s2, se1, se2, sint);
+		isect_kind = (kfe_verts_in_cut) ? -1 : isect_seg_seg_v2_point(s1, s2, se1, se2, sint);
 		if (isect_kind == -1) {
 			/* isect_seg_seg_v2 doesn't do tolerance test around ends of s1-s2 */
 			closest_to_line_segment_v2(sint, s1, se1, se2);




More information about the Bf-blender-cvs mailing list