[Bf-blender-cvs] [2e211d099f8] master: Fix T65141 Bevel did not curve.

Howard Trickey noreply at git.blender.org
Tue May 28 14:00:20 CEST 2019


Commit: 2e211d099f8d13b79cdf9057f77532c587311c3d
Author: Howard Trickey
Date:   Tue May 28 07:56:56 2019 -0400
Branches: master
https://developer.blender.org/rB2e211d099f8d13b79cdf9057f77532c587311c3d

Fix T65141 Bevel did not curve.

The previous fix to the spike bug T64582 was not really right.
This fixes that one properly and restores the desired curving
profile in the bug's example.

===================================================================

M	release/datafiles/locale
M	release/scripts/addons
M	release/scripts/addons_contrib
M	source/blender/bmesh/tools/bmesh_bevel.c

===================================================================

diff --git a/release/datafiles/locale b/release/datafiles/locale
index 2eab3be9bbd..ad82c4ce43e 160000
--- a/release/datafiles/locale
+++ b/release/datafiles/locale
@@ -1 +1 @@
-Subproject commit 2eab3be9bbdb2d27e36cfde38fdcba5fc264f223
+Subproject commit ad82c4ce43ef2801ef51e75af1f9702992478b02
diff --git a/release/scripts/addons b/release/scripts/addons
index 53e11f6552d..8e6f485cf5b 160000
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit 53e11f6552dfd2defbf2b5c4fd1621d3dfdb6129
+Subproject commit 8e6f485cf5b160c425d7da7c743879b20f3d6a96
diff --git a/release/scripts/addons_contrib b/release/scripts/addons_contrib
index 0409b81f454..7077ff07384 160000
--- a/release/scripts/addons_contrib
+++ b/release/scripts/addons_contrib
@@ -1 +1 @@
-Subproject commit 0409b81f45445c2934ad223e430ca7d8970ae5f0
+Subproject commit 7077ff07384491d1f7630484995557f1c7302dae
diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c
index f0ffea0fbc8..2ef3f60e0a6 100644
--- a/source/blender/bmesh/tools/bmesh_bevel.c
+++ b/source/blender/bmesh/tools/bmesh_bevel.c
@@ -1377,31 +1377,31 @@ static void set_profile_params(BevelParams *bp, BevVert *bv, BoundVert *bndv)
   }
 }
 
-/* Move the profile plane for bndv to the plane containing e1 and e2, which share a vert */
-static void move_profile_plane(BoundVert *bndv, EdgeHalf *e1, EdgeHalf *e2)
+/* Maybe move the profile plane for bndv->ebev to the plane its profile's coa, cob and the
+ * original beveled vert, bmv. This will usually be the plane containing its adjacent
+ * non-beveled edges, but sometimes coa and cob are not on those edges.
+ */
+static void move_profile_plane(BoundVert *bndv, BMVert *bmv)
 {
   float d1[3], d2[3], no[3], no2[3], no3[3], dot2, dot3;
+  Profile *pro = &bndv->profile;
 
-  /* only do this if projecting, and e1, e2, and proj_dir are not coplanar */
-  if (is_zero_v3(bndv->profile.proj_dir)) {
+  /* only do this if projecting, and coa, cob, and proj_dir are not coplanar */
+  if (is_zero_v3(pro->proj_dir)) {
     return;
   }
-  sub_v3_v3v3(d1, e1->e->v1->co, e1->e->v2->co);
-  if (e1->is_rev)
-    negate_v3(d1);
+  sub_v3_v3v3(d1, bmv->co, pro->coa);
   normalize_v3(d1);
-  sub_v3_v3v3(d2, e2->e->v1->co, e2->e->v2->co);
-  if (e2->is_rev)
-    negate_v3(d2);
+  sub_v3_v3v3(d2, bmv->co, pro->cob);
   normalize_v3(d2);
   cross_v3_v3v3(no, d1, d2);
-  cross_v3_v3v3(no2, d1, bndv->profile.proj_dir);
-  cross_v3_v3v3(no3, d2, bndv->profile.proj_dir);
+  cross_v3_v3v3(no2, d1, pro->proj_dir);
+  cross_v3_v3v3(no3, d2, pro->proj_dir);
   if (normalize_v3(no) > BEVEL_EPSILON_BIG && normalize_v3(no2) > BEVEL_EPSILON_BIG &&
       normalize_v3(no3) > BEVEL_EPSILON_BIG) {
     dot2 = dot_v3v3(no, no2);
     dot3 = dot_v3v3(no, no3);
-    if (fabsf(dot2) < 0.95f && fabsf(dot3) < 0.95f) {
+     if (fabsf(dot2) < (1 - BEVEL_EPSILON_BIG) && fabsf(dot3) < (1 - BEVEL_EPSILON_BIG)) {
       copy_v3_v3(bndv->profile.plane_no, no);
     }
   }
@@ -2354,7 +2354,7 @@ static void build_boundary_terminal_edge(BevelParams *bp,
     /* special case: snap profile to plane of adjacent two edges */
     v = vm->boundstart;
     BLI_assert(v->ebev != NULL);
-    move_profile_plane(v, v->next->elast, v->efirst);
+    move_profile_plane(v, bv->v);
     calculate_profile(bp, v);
   }



More information about the Bf-blender-cvs mailing list