Fix T53474, bevel glitchy with big objects.

A comparison should have not just have been against an epsilon,
but relative to the edge length involved.
Thanks to mano-wii for patch on which this is based.
This commit is contained in:
Howard Trickey 2017-12-18 12:24:42 -05:00
parent 443789d7c6
commit bb30ce0f0b
Notes: blender-bot 2023-02-14 06:20:52 +01:00
Referenced by issue #53683, 2.79a release
Referenced by issue #53592, Bevel operator do not confirm on release nor with spacebar like others
Referenced by issue #53567, denoising artifacts with normal mapping in diffuse
Referenced by issue #53474, Bug with bevel
5 changed files with 15 additions and 11 deletions

@ -1 +1 @@
Subproject commit b3d9c97f487bff8b2423c903c14204ba5ca21a83
Subproject commit 47700dfc9835ef7154bbd34b8725c8abf2f290df

@ -1 +1 @@
Subproject commit 85a2b50e0e3d505f702a172efc0befa46e87d853
Subproject commit 6cdbffbc229bf263fa4b9b82a6e33b591c32934c

@ -1 +1 @@
Subproject commit c3991195ad6eac741db27dc9e8905efb224f219d
Subproject commit e88b7dfc3bd68888be2d05437cf50e93e41ef47b

View File

@ -718,14 +718,18 @@ static void slide_dist(EdgeHalf *e, BMVert *v, float d, float slideco[3])
/* Is co not on the edge e? if not, return the closer end of e in ret_closer_v */
static bool is_outside_edge(EdgeHalf *e, const float co[3], BMVert **ret_closer_v)
{
float d_squared;
float h[3], u[3], lambda, lenu, *l1 = e->e->v1->co;
d_squared = dist_squared_to_line_segment_v3(co, e->e->v1->co, e->e->v2->co);
if (d_squared > BEVEL_EPSILON_BIG * BEVEL_EPSILON_BIG) {
if (len_squared_v3v3(co, e->e->v1->co) > len_squared_v3v3(co, e->e->v2->co))
*ret_closer_v = e->e->v2;
else
*ret_closer_v = e->e->v1;
sub_v3_v3v3(u, e->e->v2->co, l1);
sub_v3_v3v3(h, co, l1);
lenu = normalize_v3(u);
lambda = dot_v3v3(u, h);
if (lambda <= -BEVEL_EPSILON_BIG * lenu) {
*ret_closer_v = e->e->v1;
return true;
}
else if (lambda >= (1.0f + BEVEL_EPSILON_BIG) * lenu) {
*ret_closer_v = e->e->v2;
return true;
}
else {

@ -1 +1 @@
Subproject commit e10a1b031b243482371c0673ee17aa3c0f53637a
Subproject commit ccf20e08702ee6424edbda01544bb9f8bc386de4