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>2019-02-15 01:21:50 +0300
committerHoward Trickey <howard.trickey@gmail.com>2019-02-15 01:21:50 +0300
commit5c432cd11bc457996d9752edf2bb0408c420176e (patch)
treecd8d371c1be8c9bfda4ddc01cceb7f27e6bfc7ca /source/blender/bmesh
parent0f135f80f271a46f8a4e373e33cd7ae075545e19 (diff)
Fix T61427: Bevel crash with patch miter.
The adjustment phase had broken assumptions after adding miters, and sent a null problem to eigen. Fixed code to check assumptions.
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r--source/blender/bmesh/tools/bmesh_bevel.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c
index 5d9963fd4c0..a530efd51d2 100644
--- a/source/blender/bmesh/tools/bmesh_bevel.c
+++ b/source/blender/bmesh/tools/bmesh_bevel.c
@@ -2816,10 +2816,11 @@ static void adjust_the_cycle_or_chain(BoundVert *vstart, bool iscycle)
static void adjust_offsets(BevelParams *bp)
{
BevVert *bv, *bvcur;
- BoundVert *v, *vanchor, *vchainstart, *vnext;
+ BoundVert *v, *vanchor, *vchainstart, *vchainend, *vnext;
EdgeHalf *enext;
GHashIterator giter;
bool iscycle;
+ int chainlen;
/* find and process chains and cycles of unvisited BoundVerts that have eon set */
GHASH_ITER(giter, bp->vert_hash) {
@@ -2840,8 +2841,9 @@ static void adjust_offsets(BevelParams *bp)
* pairs with the right side of the next edge in the cycle or chain. */
/* first follow paired edges in left->right direction */
- v = vchainstart = vanchor;
+ v = vchainstart = vchainend = vanchor;
iscycle = false;
+ chainlen = 1;
while (v->eon && !v->visited && !iscycle) {
v->visited = true;
if (!v->efirst)
@@ -2852,6 +2854,8 @@ static void adjust_offsets(BevelParams *bp)
BLI_assert(enext != NULL);
vnext = enext->leftv;
v->adjchain = vnext;
+ vchainend = vnext;
+ chainlen++;
if (vnext->visited) {
if (vnext != vchainstart) {
break;
@@ -2874,10 +2878,12 @@ static void adjust_offsets(BevelParams *bp)
break;
vnext = enext->rightv;
vnext->adjchain = v;
+ chainlen++;
vchainstart = vnext;
v = vnext;
} while (!v->visited && v->eon);
- adjust_the_cycle_or_chain(vchainstart, false);
+ if (chainlen >= 3 && !vchainstart->eon && !vchainend->eon)
+ adjust_the_cycle_or_chain(vchainstart, false);
}
} while ((vanchor = vanchor->next) != bv->vmesh->boundstart);
}