[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19214] branches/bmesh/blender/source/ blender/bmesh/intern/bmesh_eulers.c: -> Added new restrction to Join Face Kill Edge Euler
Geoffrey Bantle
hairbat at yahoo.com
Fri Mar 6 20:42:00 CET 2009
Revision: 19214
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19214
Author: briggs
Date: 2009-03-06 20:41:57 +0100 (Fri, 06 Mar 2009)
Log Message:
-----------
-> Added new restrction to Join Face Kill Edge Euler
Join Face Kill Edge now checks to make sure it wont create
a face where the same vertex appears twice in the loop cycle.
Note to Joe:
This is what we talked about on IRC a while back. It
seems to work from here, but you should probably give it a
really good test in the vert dissolve code.
Modified Paths:
--------------
branches/bmesh/blender/source/blender/bmesh/intern/bmesh_eulers.c
Modified: branches/bmesh/blender/source/blender/bmesh/intern/bmesh_eulers.c
===================================================================
--- branches/bmesh/blender/source/blender/bmesh/intern/bmesh_eulers.c 2009-03-06 18:57:43 UTC (rev 19213)
+++ branches/bmesh/blender/source/blender/bmesh/intern/bmesh_eulers.c 2009-03-06 19:41:57 UTC (rev 19214)
@@ -903,6 +903,8 @@
* A BMFace pointer
*/
+//disregarding f1loop and f2loop, if a vertex appears in a joined face more than once, we cancel
+
BMFace *bmesh_jfke(BMesh *bm, BMFace *f1, BMFace *f2, BMEdge *e)
{
@@ -935,7 +937,7 @@
if(f1loop->v == f2loop->v) return NULL;
/*
- Finally validate that for each face, each vertex has another edge in its disk cycle that is
+ validate that for each face, each vertex has another edge in its disk cycle that is
not e, and not shared.
*/
if(bmesh_radial_find_face( ((BMLoop*)(f1loop->head.next))->e,f2)) return NULL;
@@ -947,6 +949,29 @@
shared = BM_Face_Sharededges(f1,f2);
if(shared > 1) return NULL;
+ /*validate no internal joins*/
+ for(i=0, curloop = f1->loopbase; i < f1len; i++, curloop = ((BMLoop*)(curloop->head.next)) ) curloop->v->head.eflag1 = 0;
+ for(i=0, curloop = f2->loopbase; i < f2len; i++, curloop = ((BMLoop*)(curloop->head.next)) ) curloop->v->head.eflag1 = 0;
+
+ for(i=0, curloop = f1->loopbase; i < f1len; i++, curloop = ((BMLoop*)(curloop->head.next)) ){
+ if(curloop != f1loop)
+ curloop->v->head.eflag1++;
+ }
+ for(i=0, curloop = f2->loopbase; i < f2len; i++, curloop = ((BMLoop*)(curloop->head.next)) ){
+ if(curloop != f2loop)
+ curloop->v->head.eflag1++;
+ }
+
+ for(i=0, curloop = f1->loopbase; i < f1len; i++, curloop = ((BMLoop*)(curloop->head.next)) ){
+ if(curloop->v->head.eflag1 > 1)
+ return NULL;
+ }
+
+ for(i=0, curloop = f2->loopbase; i < f2len; i++, curloop = ((BMLoop*)(curloop->head.next)) ){
+ if(curloop->v->head.eflag1 > 1)
+ return NULL;
+ }
+
/*join the two loops*/
f1loop->head.prev->next = f2loop->head.next;
f2loop->head.next->prev = f1loop->head.prev;
More information about the Bf-blender-cvs
mailing list