diff options
author | Howard Trickey <howard.trickey@gmail.com> | 2012-12-01 18:23:44 +0400 |
---|---|---|
committer | Howard Trickey <howard.trickey@gmail.com> | 2012-12-01 18:23:44 +0400 |
commit | c324895136f5d935b6c76b0fb9b9871b01973a62 (patch) | |
tree | 5b4671cad7cde0f73e6f2c41650b768927111d13 /source/blender/bmesh | |
parent | 71c0b69e71b18d8d3da6d9de8b58ede0ab48f0d5 (diff) |
Bevel: fix crash bug 33362, when beveling one edge at valence 2 vertex.
That special case should have been tested before - the code was wrong
in about three different ways.
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r-- | source/blender/bmesh/tools/bmesh_bevel.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c index f2ea5a5f341..86509acb1fb 100644 --- a/source/blender/bmesh/tools/bmesh_bevel.c +++ b/source/blender/bmesh/tools/bmesh_bevel.c @@ -431,10 +431,10 @@ static void offset_in_two_planes(EdgeHalf *e1, EdgeHalf *e2, EdgeHalf *emid, * from eh's direction. */ static void offset_in_plane(EdgeHalf *e, const float plane_no[3], int left, float r[3]) { - float dir[3], no[3]; + float dir[3], no[3], fdir[3]; BMVert *v; - v = e->is_rev ? e->e->v1 : e->e->v2; + v = e->is_rev ? e->e->v2 : e->e->v1; sub_v3_v3v3(dir, BM_edge_other_vert(e->e, v)->co, v->co); normalize_v3(dir); @@ -449,11 +449,12 @@ static void offset_in_plane(EdgeHalf *e, const float plane_no[3], int left, floa no[1] = 1.0f; } if (left) - cross_v3_v3v3(r, no, dir); + cross_v3_v3v3(fdir, dir, no); else - cross_v3_v3v3(r, dir, no); - normalize_v3(r); - mul_v3_fl(r, e->offset); + cross_v3_v3v3(fdir, no, dir); + normalize_v3(fdir); + copy_v3_v3(r, v->co); + madd_v3_v3fl(r, fdir, e->offset); } /* Calculate coordinates of a point a distance d from v on e->e and return it in slideco */ @@ -753,6 +754,7 @@ static void build_boundary(MemArena *mem_arena, BevVert *bv) slide_dist(e->next, bv->v, e->offset, co); v = add_new_bound_vert(mem_arena, vm, co); v->efirst = v->elast = e->next; + e->next->leftv = e->next->rightv = v; vm->mesh_kind = M_POLY; return; } @@ -844,7 +846,6 @@ static void build_boundary(MemArena *mem_arena, BevVert *bv) else { vm->mesh_kind = M_ADJ; } - /* TODO: if vm->count == 4 and bv->selcount == 4, use M_CROSS pattern */ } /* |