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>2020-03-01 20:25:44 +0300
committerHoward Trickey <howard.trickey@gmail.com>2020-03-01 20:25:44 +0300
commitf2557d137ae8a0f36764bac3ab61f7cc047eca72 (patch)
treea452dd67ba1cd96fa5f6327cd12a2f84a33d06fb /source/blender/blenlib
parent38058833f1e145b178a7c4fe7e5b5eb75d3da472 (diff)
Fix problem with Delaunay triangulalation re output mapping.
The array giving original vertex indices should not contain entries for newly created vertices. Added a test to check this.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/intern/delaunay_2d.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/blenlib/intern/delaunay_2d.c b/source/blender/blenlib/intern/delaunay_2d.c
index 235ea6a4da4..ca9c0389c07 100644
--- a/source/blender/blenlib/intern/delaunay_2d.c
+++ b/source/blender/blenlib/intern/delaunay_2d.c
@@ -1200,10 +1200,6 @@ static void fill_crossdata_for_through_vert(CDTVert *v,
SymEdge *se;
#ifdef DEBUG_CDT
int dbg_level = 0;
-
- if (global_dbg) {
- dbg_level = 1;
- }
#endif
cd_next->lambda = 0.0;
@@ -3030,7 +3026,9 @@ static CDT_result *cdt_get_output(CDT_state *cdt,
result->vert_coords[i][0] = (float)v->co[0];
result->vert_coords[i][1] = (float)v->co[1];
result->verts_orig_start_table[i] = orig_map_index;
- result->verts_orig[orig_map_index++] = j;
+ if (j < input->verts_len) {
+ result->verts_orig[orig_map_index++] = j;
+ }
for (ln = v->input_ids; ln; ln = ln->next) {
result->verts_orig[orig_map_index++] = POINTER_AS_INT(ln->link);
}