From 1992d948306b0474a5dc4c641051a54b380dff8c Mon Sep 17 00:00:00 2001 From: Julien Cortial Date: Fri, 3 May 2024 10:20:18 +0200 Subject: [PATCH] Avoid switching 2nd and 3rd triangle vertices --- src/mmg2d/API_functions_2d.c | 4 ++-- src/mmg3d/API_functions_3d.c | 4 ++-- src/mmgs/API_functions_s.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mmg2d/API_functions_2d.c b/src/mmg2d/API_functions_2d.c index 0f35f518f..42e41e395 100644 --- a/src/mmg2d/API_functions_2d.c +++ b/src/mmg2d/API_functions_2d.c @@ -1025,8 +1025,8 @@ int MMG2D_Set_triangles(MMG5_pMesh mesh, MMG5_int *tria, MMG5_int *refs) { j = (i-1)*3; ptt = &mesh->tria[i]; ptt->v[0] = tria[j] ; - ptt->v[1] = tria[j+2]; - ptt->v[2] = tria[j+1]; + ptt->v[1] = tria[j+1]; + ptt->v[2] = tria[j+2]; if ( refs != NULL ) ptt->ref = refs[i-1]; diff --git a/src/mmg3d/API_functions_3d.c b/src/mmg3d/API_functions_3d.c index fc8f15165..4b4f9f289 100644 --- a/src/mmg3d/API_functions_3d.c +++ b/src/mmg3d/API_functions_3d.c @@ -941,8 +941,8 @@ int MMG3D_Set_triangles(MMG5_pMesh mesh, MMG5_int *tria, MMG5_int *refs) { j = (i-1)*3; ptt = &mesh->tria[i]; ptt->v[0] = tria[j] ; - ptt->v[1] = tria[j+2]; - ptt->v[2] = tria[j+1]; + ptt->v[1] = tria[j+1]; + ptt->v[2] = tria[j+2]; if ( refs != NULL ) ptt->ref = refs[i-1]; } diff --git a/src/mmgs/API_functions_s.c b/src/mmgs/API_functions_s.c index eef8bb36d..4d858fd91 100644 --- a/src/mmgs/API_functions_s.c +++ b/src/mmgs/API_functions_s.c @@ -539,8 +539,8 @@ int MMGS_Set_triangles(MMG5_pMesh mesh, MMG5_int *tria, MMG5_int *refs) { j = (i-1)*3; ptt = &mesh->tria[i]; ptt->v[0] = tria[j] ; - ptt->v[1] = tria[j+2]; - ptt->v[2] = tria[j+1]; + ptt->v[1] = tria[j+1]; + ptt->v[2] = tria[j+2]; mesh->point[ptt->v[0]].tag &= ~MG_NUL; mesh->point[ptt->v[1]].tag &= ~MG_NUL;