diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-11-12 09:29:54 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-11-12 09:29:54 +0400 |
commit | 428e5b7a99eeae77caccbabbf32a7e596d0907d7 (patch) | |
tree | fc912ea24fe4419af7c6a5d7bab38223a588e3f8 /source/blender/bmesh/operators/bmo_bevel.c | |
parent | 97b7154142edd2ab72cb2637bb4caa66536039b2 (diff) |
bmesh bevel todo: don't loop through all faces to find faces connected to a vertex.
Diffstat (limited to 'source/blender/bmesh/operators/bmo_bevel.c')
-rw-r--r-- | source/blender/bmesh/operators/bmo_bevel.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/source/blender/bmesh/operators/bmo_bevel.c b/source/blender/bmesh/operators/bmo_bevel.c index 2c9f3a1cc6e..7fededd0635 100644 --- a/source/blender/bmesh/operators/bmo_bevel.c +++ b/source/blender/bmesh/operators/bmo_bevel.c @@ -1265,19 +1265,17 @@ static void rebuild_polygon(BMesh *bm, BevelParams *bp, BMFace *f) /* All polygons touching v need rebuilding because beveling v has made new vertices */ static void bevel_rebuild_existing_polygons(BMesh *bm, BevelParams *bp, BMVert *v) { - BMFace *f; - BMIter iter; + int faces_len, f_index; + BMFace **faces = BM_iter_as_arrayN(bm, BM_FACES_OF_VERT, v, &faces_len); + + if (LIKELY(faces != NULL)) { + for (f_index = 0; f_index < faces_len; f_index++) { + BMFace *f = faces[f_index]; + rebuild_polygon(bm, bp, f); + BM_face_kill(bm, f); + } - /* TODO: don't iterate through all faces, but just local geometry around v */ - BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) { - BMLoop *l = f->l_first; - do { - if (l->v == v) { - rebuild_polygon(bm, bp, f); - BM_face_kill(bm, f); - } - l = l->next; - } while (l != f->l_first); + MEM_freeN(faces); } } |