Skip to content

Commit

Permalink
Avoid switching 2nd and 3rd triangle vertices
Browse files Browse the repository at this point in the history
  • Loading branch information
jcortial-safran committed May 3, 2024
1 parent fe5ce20 commit 8fc6576
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 @@ -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];

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 @@ -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];
}
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 @@ -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;
Expand Down

0 comments on commit 8fc6576

Please sign in to comment.