From d58afb615c6e94486224b6f0060faa4856c271f5 Mon Sep 17 00:00:00 2001 From: Howard Trickey Date: Sun, 12 Oct 2025 02:03:46 +0200 Subject: [PATCH] Fix #147718: Bevel accuracy at small scale. There was a bug in the move_weld_profile_planes function where it would only move the profile plane involved in a "weld" if certain vectors were not too small (less than BEVEL_EPSILON in length). The intent of the code was just to avoid problems with zero length normals (post normalization), and the normalize_v3 function indicates that with an exact 0.0f return, so there was no need for an epsilon test. The example file in the issue had a small-scale model (100 times smaller than typical), which ended up causing the old code to prevent moving the profile plane to where it belongs. Pull Request: https://projects.blender.org/blender/blender/pulls/147898 --- source/blender/bmesh/tools/bmesh_bevel.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/bmesh/tools/bmesh_bevel.cc b/source/blender/bmesh/tools/bmesh_bevel.cc index b95f953d409..0434ae85604 100644 --- a/source/blender/bmesh/tools/bmesh_bevel.cc +++ b/source/blender/bmesh/tools/bmesh_bevel.cc @@ -2083,7 +2083,7 @@ static void move_weld_profile_planes(BevVert *bv, BoundVert *bndv1, BoundVert *b float l2 = normalize_v3(no2); cross_v3_v3v3(no3, d2, bndv2->profile.proj_dir); float l3 = normalize_v3(no3); - if (l1 > BEVEL_EPSILON && (l2 > BEVEL_EPSILON || l3 > BEVEL_EPSILON)) { + if (l1 != 0.0f && (l2 != 0.0f || l3 != 0.0f)) { float dot1 = fabsf(dot_v3v3(no, no2)); float dot2 = fabsf(dot_v3v3(no, no3)); if (fabsf(dot1 - 1.0f) > BEVEL_EPSILON) {