Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-11-17 01:05:27 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-11-17 01:05:27 +0400
commit6de13de7ab6a8b625dedd8a46de2d6181328f7cf (patch)
tree7fd8f287b27198f2becf17cb921df4a11f9a3e47 /source/blender/bmesh/operators/bmo_bevel.c
parentabc122205a00aac4623b868fe8b3fe7890a2bdfb (diff)
more straightforward way to implement quad-strip face filling suggested by Howard Trickey,
also some other changes - no need to check the new loops face is larger and no longer split up the ngon more times then there are subdivisions in the face strip (now ngons will remain on both sides).
Diffstat (limited to 'source/blender/bmesh/operators/bmo_bevel.c')
-rw-r--r--source/blender/bmesh/operators/bmo_bevel.c40
1 files changed, 15 insertions, 25 deletions
diff --git a/source/blender/bmesh/operators/bmo_bevel.c b/source/blender/bmesh/operators/bmo_bevel.c
index 1b1fc53011f..c76693d5347 100644
--- a/source/blender/bmesh/operators/bmo_bevel.c
+++ b/source/blender/bmesh/operators/bmo_bevel.c
@@ -1193,48 +1193,38 @@ static void bevel_build_quadstrip(BMesh *bm, BevVert *bv)
if (f) {
/* we have a polygon which we know starts at this vertex, make it into strips */
- EdgeHalf *eh_first, *eh_iter;
- EdgeHalf *eh_a = NULL, *eh_b = NULL;
- BMVert *v_a_first, *v_b_first;
+ EdgeHalf *eh_a = bv->vmesh->boundstart->elast;
+ EdgeHalf *eh_b = next_bev(bv, eh_a->next); /* since (selcount == 2) we know this is valid */
+ BMLoop *l_a = BM_face_vert_share_loop(f, eh_a->rightv->nv.v);
+ BMLoop *l_b = BM_face_vert_share_loop(f, eh_b->leftv->nv.v);
+ int seg_count = bv->vmesh->seg; /* ensure we don't walk past the segments */
- BMLoop *l_a;
- BMLoop *l_b;
-
- /* find both edges */
- eh_iter = eh_first = bv->vmesh->boundstart->efirst;
- do {
- if (eh_iter->seg) {
- if (eh_a == NULL) {
- eh_a = eh_iter;
- }
- else if (eh_b == NULL) {
- eh_b = eh_iter;
- break;
- }
- }
- } while ((eh_iter = eh_iter->next) != NULL);
-
- v_a_first = eh_a->rightv->nv.v;
- v_b_first = eh_b->leftv->nv.v;
-
- l_a = BM_face_vert_share_loop(f, v_a_first);
- l_b = BM_face_vert_share_loop(f, v_b_first);
if (l_a == l_b) {
/* step once around if we hit the same loop */
l_a = l_a->prev;
l_b = l_b->next;
+ seg_count--;
}
+ BLI_assert(l_a != l_b);
+
while (f->len > 4) {
BMLoop *l_new;
BLI_assert(l_a->f == f);
BLI_assert(l_b->f == f);
BM_face_split(bm, f, l_a->v, l_b->v, &l_new, NULL, FALSE);
+ if (seg_count-- == 0) {
+ break;
+ }
+ /* turns out we don't need this,
+ * because of how BM_face_split works we always get the loop of the larger face */
+#if 0
if (l_new->f->len < l_new->radial_next->f->len) {
l_new = l_new->radial_next;
}
+#endif
f = l_new->f;
/* walk around the new face to get the next verts to split */