[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [42203] branches/bmesh/blender/source/ blender/modifiers/intern/MOD_edgesplit.c: change edge split modifier to loop over all edges and compare the face angles , rather then looping over all faces and looking at every faces-edges-fance which would compare faces twice .
Campbell Barton
ideasman42 at gmail.com
Mon Nov 28 04:41:29 CET 2011
Revision: 42203
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42203
Author: campbellbarton
Date: 2011-11-28 03:41:14 +0000 (Mon, 28 Nov 2011)
Log Message:
-----------
change edge split modifier to loop over all edges and compare the face angles, rather then looping over all faces and looking at every faces-edges-fance which would compare faces twice.
Modified Paths:
--------------
branches/bmesh/blender/source/blender/modifiers/intern/MOD_edgesplit.c
Modified: branches/bmesh/blender/source/blender/modifiers/intern/MOD_edgesplit.c
===================================================================
--- branches/bmesh/blender/source/blender/modifiers/intern/MOD_edgesplit.c 2011-11-28 03:07:12 UTC (rev 42202)
+++ branches/bmesh/blender/source/blender/modifiers/intern/MOD_edgesplit.c 2011-11-28 03:41:14 UTC (rev 42203)
@@ -67,9 +67,7 @@
BMesh *bm;
BMEditMesh *em;
DerivedMesh *cddm;
- BMIter iter, liter;
- BMFace *f;
- BMLoop *l;
+ BMIter iter;
BMEdge *e;
/* int allocsize[] = {512, 512, 2048, 512}; */ /* UNUSED */
float threshold = cos((emd->split_angle + 0.00001) * M_PI / 180.0);
@@ -85,16 +83,14 @@
BMO_push(bm, NULL);
if (emd->flags & MOD_EDGESPLIT_FROMANGLE) {
- BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
- BM_ITER(l, &liter, bm, BM_LOOPS_OF_FACE, f) {
- float edge_angle_cos;
-
- if (l->radial_next == l)
- continue;
-
- edge_angle_cos = dot_v3v3(f->no, l->radial_next->f->no);
- if (edge_angle_cos < threshold) {
- BMO_SetFlag(bm, l->e, EDGE_MARK);
+ BM_ITER(e, &iter, bm, BM_EDGES_OF_MESH, NULL) {
+ /* check for 1 edge having 2 face users */
+ BMLoop *l1, *l2;
+ if ( (l1= e->l) &&
+ (l2= e->l->radial_next) != l1)
+ {
+ if (dot_v3v3(l1->f->no, l2->f->no) < threshold) {
+ BMO_SetFlag(bm, e, EDGE_MARK);
}
}
}
More information about the Bf-blender-cvs
mailing list