diff options
author | Howard Trickey <howard.trickey@gmail.com> | 2019-08-15 14:55:29 +0300 |
---|---|---|
committer | Howard Trickey <howard.trickey@gmail.com> | 2019-08-15 14:55:29 +0300 |
commit | e4084f8b24197ede2546da90459cb1b5ad0fd9a8 (patch) | |
tree | 5dd5eac32ca4caa94bf032e53977d88ec76579c7 /source | |
parent | 48a6997e2a0657d8b238101b84b688b37bc88875 (diff) |
Fix CDT bug causing crash with some output modes.
Forgot to properly maintain the edge for faces while
dissolving edges.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenlib/intern/delaunay_2d.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/source/blender/blenlib/intern/delaunay_2d.c b/source/blender/blenlib/intern/delaunay_2d.c index 8e2687a6b2f..632847046a7 100644 --- a/source/blender/blenlib/intern/delaunay_2d.c +++ b/source/blender/blenlib/intern/delaunay_2d.c @@ -1961,13 +1961,17 @@ static void add_face_ids( } } -/* Delete_edge but try not to mess up outer face. */ +/* Delete_edge but try not to mess up outer face. + * Also faces have symedges now, so make sure not + * to mess those up either. */ static void dissolve_symedge(CDT_state *cdt, SymEdge *se) { - if (sym(se)->face == cdt->outer_face) { + SymEdge *symse = sym(se); + if (symse->face == cdt->outer_face) { se = sym(se); + symse = sym(se); } - if (cdt->outer_face->symedge == se || cdt->outer_face->symedge == sym(se)) { + if (cdt->outer_face->symedge == se || cdt->outer_face->symedge == symse) { /* Advancing by 2 to get past possible 'sym(se)'. */ if (se->next->next == se) { cdt->outer_face->symedge = NULL; @@ -1976,6 +1980,14 @@ static void dissolve_symedge(CDT_state *cdt, SymEdge *se) cdt->outer_face->symedge = se->next->next; } } + else { + if (se->face->symedge == se) { + se->face->symedge = se->next; + } + if (symse->face->symedge == se) { + symse->face->symedge = symse->next; + } + } delete_edge(cdt, se); } |