bevel: re-order checks so angle checks are done after quick sanity checks.

This commit is contained in:
Campbell Barton
2012-12-04 14:41:40 +00:00
parent 1d0f005093
commit 41b6e700e0

View File

@@ -832,7 +832,7 @@ static void bevel_build_rings(BMesh *bm, BevVert *bv)
EdgeHalf *e1, *e2, *epipe;
BMVert *bmv, *bmv1, *bmv2, *bmv3, *bmv4;
BMFace *f;
float co[3], coa[3], cob[3], midco[3], dir1[3], dir2[3];
float co[3], coa[3], cob[3], midco[3];
float va_pipe[3], vb_pipe[3];
#ifdef USE_ALTERNATE_ADJ
@@ -860,10 +860,11 @@ static void bevel_build_rings(BMesh *bm, BevVert *bv)
if (e1->is_bev) {
for (e2 = &bv->edges[0]; e2 != &bv->edges[bv->edgecount]; e2++) {
if (e1 != e2 && e2->is_bev) {
if ((e1->fnext == e2->fprev) || (e1->fprev == e2->fnext)) {
float dir1[3], dir2[3];
sub_v3_v3v3(dir1, bv->v->co, BM_edge_other_vert(e1->e, bv->v)->co);
sub_v3_v3v3(dir2,BM_edge_other_vert(e2->e, bv->v)->co, bv->v->co);
if (angle_v3v3(dir1, dir2) < 100.0f * (float)BEVEL_EPSILON &&
(e1->fnext == e2->fprev || e1->fprev == e2->fnext)) {
sub_v3_v3v3(dir2, BM_edge_other_vert(e2->e, bv->v)->co, bv->v->co);
if (angle_v3v3(dir1, dir2) < 100.0f * (float)BEVEL_EPSILON) {
epipe = e1;
break;
}
@@ -872,6 +873,7 @@ static void bevel_build_rings(BMesh *bm, BevVert *bv)
}
}
}
}
/* Make initial rings, going between points on neighbors.
* After this loop, will have coords for all (i, r, k) where