[Bf-blender-cvs] [84767a2] master: Fix Bevel multisegment profile bugs T39184, T37502 and last part of T40365.
Howard Trickey
noreply at git.blender.org
Tue Jun 10 17:23:47 CEST 2014
Commit: 84767a29f18de674692968c822b5847db7fac4e9
Author: Howard Trickey
Date: Tue Jun 10 11:07:06 2014 -0400
https://developer.blender.org/rB84767a29f18de674692968c822b5847db7fac4e9
Fix Bevel multisegment profile bugs T39184, T37502 and last part of T40365.
When doing a 'weld' type join where there are two non-beveled edges
in the same plane one beveled one but not the other, then there
should be a curved profile; bug was creating a straight one.
===================================================================
M source/blender/bmesh/tools/bmesh_bevel.c
===================================================================
diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c
index 78bbdd1..9f9b3de 100644
--- a/source/blender/bmesh/tools/bmesh_bevel.c
+++ b/source/blender/bmesh/tools/bmesh_bevel.c
@@ -972,7 +972,7 @@ static void move_profile_plane(BoundVert *bndv, EdgeHalf *e1, EdgeHalf *e2)
* The original vertex should form a third point of the desired plane. */
static void move_weld_profile_planes(BevVert *bv, BoundVert *bndv1, BoundVert *bndv2)
{
- float d1[3], d2[3], no[3], no2[3], no3[3], dot1, dot2;
+ float d1[3], d2[3], no[3], no2[3], no3[3], dot1, dot2, l1, l2, l3;
/* only do this if projecting, and d1, d2, and proj_dir are not coplanar */
if (is_zero_v3(bndv1->profile.proj_dir) || is_zero_v3(bndv2->profile.proj_dir))
@@ -980,22 +980,20 @@ static void move_weld_profile_planes(BevVert *bv, BoundVert *bndv1, BoundVert *b
sub_v3_v3v3(d1, bv->v->co, bndv1->nv.co);
sub_v3_v3v3(d2, bv->v->co, bndv2->nv.co);
cross_v3_v3v3(no, d1, d2);
+ l1 = normalize_v3(no);
/* "no" is new normal projection plane, but don't move if
- * it is coplanar with one or the other of the projection dirs */
+ * it is coplanar with both of the projection dirs */
cross_v3_v3v3(no2, d1, bndv1->profile.proj_dir);
+ l2 = normalize_v3(no2);
cross_v3_v3v3(no3, d2, bndv2->profile.proj_dir);
- if (normalize_v3(no) > BEVEL_EPSILON &&
- normalize_v3(no2) > BEVEL_EPSILON &&
- normalize_v3(no3) > BEVEL_EPSILON)
- {
+ l3 = normalize_v3(no3);
+ if (l1 > BEVEL_EPSILON && (l2 > BEVEL_EPSILON || l3 > BEVEL_EPSILON)) {
dot1 = fabsf(dot_v3v3(no, no2));
dot2 = fabsf(dot_v3v3(no, no3));
- if (fabsf(dot1 - 1.0f) > BEVEL_EPSILON &&
- fabsf(dot2 - 1.0f) > BEVEL_EPSILON)
- {
+ if (fabsf(dot1 - 1.0f) > BEVEL_EPSILON)
copy_v3_v3(bndv1->profile.plane_no, no);
+ if (fabsf(dot2 - 1.0f) > BEVEL_EPSILON)
copy_v3_v3(bndv2->profile.plane_no, no);
- }
}
}
More information about the Bf-blender-cvs
mailing list