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:
authorCampbell Barton <ideasman42@gmail.com>2013-03-25 08:48:30 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-03-25 08:48:30 +0400
commit1b4c9e1ad40142fbf6a2d97303661a78527c134b (patch)
treea748063cc65d9f47f4ef2834e72e2518694073bc /source/blender/bmesh/operators/bmo_triangulate.c
parente1a54214bbed9b32e1aee0e849ae654c495afa80 (diff)
beautify fill: skip testing invalid cases (2 triangles that _don't_ have 4 unique verts between them).
Diffstat (limited to 'source/blender/bmesh/operators/bmo_triangulate.c')
-rw-r--r--source/blender/bmesh/operators/bmo_triangulate.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/source/blender/bmesh/operators/bmo_triangulate.c b/source/blender/bmesh/operators/bmo_triangulate.c
index 1f04c7ce845..bd162b56e8b 100644
--- a/source/blender/bmesh/operators/bmo_triangulate.c
+++ b/source/blender/bmesh/operators/bmo_triangulate.c
@@ -87,10 +87,21 @@ void bmo_beautify_fill_exec(BMesh *bm, BMOperator *op)
continue;
}
- v1 = e->l->prev->v;
- v2 = e->l->v;
- v3 = e->l->radial_next->prev->v;
- v4 = e->l->next->v;
+ v1 = e->l->prev->v; /* first face vert not attached to 'e' */
+ v2 = e->l->v; /* e->v1 or e->v2*/
+ v3 = e->l->radial_next->prev->v; /* second face vert not attached to 'e' */
+ v4 = e->l->next->v; /* e->v1 or e->v2*/
+
+ if (UNLIKELY(v1 == v3)) {
+ // printf("This should never happen, but does sometimes!\n");
+ continue;
+ }
+
+ // printf("%p %p %p %p - %p %p\n", v1, v2, v3, v4, e->l->f, e->l->radial_next->f);
+ BLI_assert((ELEM3(v1, v2, v3, v4) == false) &&
+ (ELEM3(v2, v1, v3, v4) == false) &&
+ (ELEM3(v3, v1, v2, v4) == false) &&
+ (ELEM3(v4, v1, v2, v3) == false));
if (is_quad_convex_v3(v1->co, v2->co, v3->co, v4->co)) {
float len1, len2, len3, len4, len5, len6, opp1, opp2, fac1, fac2;