[Bf-blender-cvs] [896f08b] master: Fix T41177. Bevel shouldn't try to slide along edge when can't see it.
Howard Trickey
noreply at git.blender.org
Wed Jun 3 21:22:08 CEST 2015
Commit: 896f08bde8cdb336814cb359be09d7c215ef37bd
Author: Howard Trickey
Date: Wed Jun 3 15:18:41 2015 -0400
Branches: master
https://developer.blender.org/rB896f08bde8cdb336814cb359be09d7c215ef37bd
Fix T41177. Bevel shouldn't try to slide along edge when can't see it.
===================================================================
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 1bbde6d..5e4b251 100644
--- a/source/blender/bmesh/tools/bmesh_bevel.c
+++ b/source/blender/bmesh/tools/bmesh_bevel.c
@@ -821,6 +821,17 @@ static bool offset_meet_edge(EdgeHalf *e1, EdgeHalf *e2, BMVert *v, float meetc
return true;
}
+/* Return true if it will look good to put the meeting point where offset_on_edge_between
+ * would put it. This means that neither side sees a reflex angle */
+static bool good_offset_on_edge_between(EdgeHalf *e1, EdgeHalf *e2, EdgeHalf *emid, BMVert *v)
+{
+ float ang;
+ float meet[3];
+
+ return offset_meet_edge(e1, emid, v, meet, &ang) &&
+ offset_meet_edge(emid, e2, v, meet, &ang);
+}
+
/* Calculate the best place for a meeting point for the offsets from edges e1 and e2
* on the in-between edge emid. Viewed from the vertex normal side, the CCW
* order of these edges is e1, emid, e2.
@@ -1770,7 +1781,7 @@ static void build_boundary(BevelParams *bp, BevVert *bv, bool construct)
offset_meet(e, e2, bv->v, e->fnext, false, co);
}
else if (nnip > 0) {
- if (nnip == 1) {
+ if (nnip == 1 && good_offset_on_edge_between(e, e2, enip, bv->v)) {
offset_on_edge_between(bp, e, e2, enip, bv->v, co);
}
else {
@@ -1779,7 +1790,7 @@ static void build_boundary(BevelParams *bp, BevVert *bv, bool construct)
}
else {
/* nip > 0 and nnip == 0 */
- if (nip == 1) {
+ if (nip == 1 && good_offset_on_edge_between(e, e2, eip, bv->v)) {
offset_on_edge_between(bp, e, e2, eip, bv->v, co);
}
else {
More information about the Bf-blender-cvs
mailing list