diff options
author | Howard Trickey <howard.trickey@gmail.com> | 2017-05-28 21:02:56 +0300 |
---|---|---|
committer | Howard Trickey <howard.trickey@gmail.com> | 2017-05-28 21:02:56 +0300 |
commit | 9ba7805a3bc4cae1ec9fcdcfbc8b30fb84a3685c (patch) | |
tree | d4811f61d92111d7103bb066d64b9d796d31e70c /source/blender/bmesh | |
parent | b947810291b16d3f304e2cd59f94c96c5f6e6f51 (diff) |
Fix T48996, bevel bad for certain in-plane edges.
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r-- | source/blender/bmesh/tools/bmesh_bevel.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c index 5f4ed3db261..03df074c067 100644 --- a/source/blender/bmesh/tools/bmesh_bevel.c +++ b/source/blender/bmesh/tools/bmesh_bevel.c @@ -1130,17 +1130,25 @@ static void set_profile_params(BevelParams *bp, BevVert *bv, BoundVert *bndv) sub_v3_v3v3(d4, e->next->e->v1->co, e->next->e->v2->co); normalize_v3(d3); normalize_v3(d4); - add_v3_v3v3(co3, co1, d3); - add_v3_v3v3(co4, co2, d4); - isect_kind = isect_line_line_v3(co1, co3, co2, co4, meetco, isect2); - if (isect_kind != 0) { - copy_v3_v3(pro->midco, meetco); - } - else { + l = dot_v3v3(d3, d4); + if (fabsf(1.0f - l) <= BEVEL_EPSILON_BIG || fabsf(-1.0f - l) <= BEVEL_EPSILON_BIG) { /* offset lines are collinear - want linear interpolation */ mid_v3_v3v3(pro->midco, co1, co2); do_linear_interp = true; } + else { + add_v3_v3v3(co3, co1, d3); + add_v3_v3v3(co4, co2, d4); + isect_kind = isect_line_line_v3(co1, co3, co2, co4, meetco, isect2); + if (isect_kind != 0) { + copy_v3_v3(pro->midco, meetco); + } + else { + /* offset lines don't intersect - want linear interpolation */ + mid_v3_v3v3(pro->midco, co1, co2); + do_linear_interp = true; + } + } } } copy_v3_v3(pro->cob, co2); |