Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHoward Trickey <howard.trickey@gmail.com>2014-02-17 20:39:03 +0400
committerHoward Trickey <howard.trickey@gmail.com>2014-02-17 20:43:31 +0400
commit6de3a8a4fe8f4eab2d2c285f11714312cfd9437e (patch)
tree4453544ae49831be26d239eb56a4eed31567bf95 /source/blender/bmesh/tools/bmesh_bevel.c
parent266e1b3b4f67ba320af16f4a1f806e49c3f9de25 (diff)
Bevel fix for T38675, bad bevel on slanted L.
The test for a reflex angle used the vertex normal, which was not a good test for a saddle point vertex. Switched to using the face normal, if available, for that test. Also added test for this in svn bevel_regression.blend.
Diffstat (limited to 'source/blender/bmesh/tools/bmesh_bevel.c')
-rw-r--r--source/blender/bmesh/tools/bmesh_bevel.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c
index 13de07a2b7b..d6a758bb059 100644
--- a/source/blender/bmesh/tools/bmesh_bevel.c
+++ b/source/blender/bmesh/tools/bmesh_bevel.c
@@ -601,10 +601,12 @@ static void offset_meet(EdgeHalf *e1, EdgeHalf *e2, BMVert *v, BMFace *f, float
else {
/* Get normal to plane where meet point should be,
* using cross product instead of f->no in case f is non-planar.
- * If e1-v-e2 is a reflex angle (viewed from vertex normal side), need to flip*/
+ * If e1-v-e2 is a reflex angle (viewed from vertex normal side), need to flip.
+ * Use f->no to figure out which side to look at angle from, as even if
+ * f is non-planar, will be more accurate than vertex normal */
cross_v3_v3v3(norm_v, dir2, dir1);
normalize_v3(norm_v);
- if (dot_v3v3(norm_v, v->no) < 0.0f)
+ if (dot_v3v3(norm_v, f ? f->no : v->no) < 0.0f)
negate_v3(norm_v);
/* get vectors perp to each edge, perp to norm_v, and pointing into face */