=bmesh= made bridge tool better. probably need to rewrite, coded this too quickly.

This commit is contained in:
Joseph Eagar 2011-08-21 00:59:08 +00:00
parent cb9d2488e9
commit c3819bf780

@ -189,6 +189,9 @@ void bmesh_bridge_loops_exec(BMesh *bm, BMOperator *op)
if (v && !e2) { if (v && !e2) {
if (c==0) { if (c==0) {
if (BLI_array_count(vv1) && v == vv1[BLI_array_count(vv1)-1]) {
printf("eck!\n");
}
BLI_array_append(vv1, v); BLI_array_append(vv1, v);
} else { } else {
BLI_array_append(vv2, v); BLI_array_append(vv2, v);
@ -209,7 +212,7 @@ void bmesh_bridge_loops_exec(BMesh *bm, BMOperator *op)
if (ee1 && ee2) { if (ee1 && ee2) {
int i, j; int i, j;
BMVert *v1, *v2, *v3, *v4; BMVert *v1, *v2, *v3, *v4;
int starti=0, lenv1=BLI_array_count(vv1); int starti=0, lenv1=BLI_array_count(vv1), lenv2=BLI_array_count(vv1);
/*handle case of two unclosed loops*/ /*handle case of two unclosed loops*/
if (!cl1 && !cl2) { if (!cl1 && !cl2) {
@ -238,15 +241,27 @@ void bmesh_bridge_loops_exec(BMesh *bm, BMOperator *op)
} }
j = 0; j = 0;
if (lenv1 && vv1[0] == vv1[lenv1-1]) {
lenv1--;
}
if (lenv2 && vv2[0] == vv2[lenv2-1]) {
lenv2--;
}
for (i=0; i<BLI_array_count(ee1); i++) { for (i=0; i<BLI_array_count(ee1); i++) {
BMFace *f; BMFace *f;
if (j >= BLI_array_count(ee2)) if (j >= BLI_array_count(ee2))
break; break;
f = BM_Make_QuadTri(bm, vv1[(i + starti)%lenv1], vv2[i], vv2[i+1], vv1[(i+1 + starti)%lenv1], NULL, 1); if (vv1[(i + starti)%lenv1] == vv1[(i + 1 + starti)%lenv1]) {
if (!f) { j++;
printf("eek!\n"); continue;
}
f = BM_Make_QuadTri(bm, vv1[(i + starti)%lenv1], vv2[i], vv2[(i+1)%lenv2], vv1[(i+1 + starti)%lenv1], NULL, 1);
if (!f || f->len != 4) {
printf("eek in bridge!\n");
} }
j++; j++;