diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/bmesh/tools/bmesh_bevel.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c index 90df3cd225e..c317d064086 100644 --- a/source/blender/bmesh/tools/bmesh_bevel.c +++ b/source/blender/bmesh/tools/bmesh_bevel.c @@ -3837,7 +3837,7 @@ static VMesh *make_cube_corner_adj_vmesh(BevelParams *bp) /* Is this a good candidate for using tri_corner_adj_vmesh? */ static int tri_corner_test(BevelParams *bp, BevVert *bv) { - float ang, totang, angdiff; + float ang, absang, totang, angdiff; EdgeHalf *e; int i; int in_plane_e = 0; @@ -3852,10 +3852,11 @@ static int tri_corner_test(BevelParams *bp, BevVert *bv) for (i = 0; i < bv->edgecount; i++) { e = &bv->edges[i]; ang = BM_edge_calc_face_angle_signed_ex(e->e, 0.0f); - if (ang <= M_PI_4) { + absang = fabsf(ang); + if (absang <= M_PI_4) { in_plane_e++; } - else if (ang >= 3.0f * (float)M_PI_4) { + else if (absang >= 3.0f * (float)M_PI_4) { return -1; } totang += ang; @@ -3863,7 +3864,7 @@ static int tri_corner_test(BevelParams *bp, BevVert *bv) if (in_plane_e != bv->edgecount - 3) { return -1; } - angdiff = fabsf(totang - 3.0f * (float)M_PI_2); + angdiff = fabsf(fabsf(totang) - 3.0f * (float)M_PI_2); if ((bp->pro_super_r == PRO_SQUARE_R && angdiff > (float)M_PI / 16.0f) || (angdiff > (float)M_PI_4)) { return -1; |