Skip to content

Commit

Permalink
Merge pull request #266 from jcortial-safran/set-triangles-fix
Browse files Browse the repository at this point in the history
Avoid switching 2nd and 3rd triangle vertices
  • Loading branch information
Algiane committed May 13, 2024
2 parents 92fd5bf + 1992d94 commit 9e391f3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/mmg2d/API_functions_2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -1031,8 +1031,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];

Expand Down
4 changes: 2 additions & 2 deletions src/mmg3d/API_functions_3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -945,8 +945,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];
}
Expand Down
4 changes: 2 additions & 2 deletions src/mmgs/API_functions_s.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,8 +543,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;
Expand Down

0 comments on commit 9e391f3

Please sign in to comment.