Skip to content

Commit 6884c82

Browse files
committed
Force the split of regular boundary edges connecting ridge or non-manifold vertices.
1 parent 06dc8a6 commit 6884c82

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

src/mmg3d/mmg3d1.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,9 +487,16 @@ int8_t MMG5_chkedg(MMG5_pMesh mesh,MMG5_Tria *pt,int8_t ori, double hmax,
487487
/* } */
488488
/* } */
489489

490-
hma2 = MMG3D_LLONG*MMG3D_LLONG*hmax*hmax;
490+
491+
/* Split regular boundary edges connecting ridge or non-manifold points */
492+
if ( (MG_GEO_OR_NOM(p[i1]->tag) && MG_GEO_OR_NOM(p[i2]->tag)) && !MG_GEO_OR_NOM(pt->tag[i]) ) {
493+
MG_SET(pt->flag,i);
494+
continue;
495+
}
491496

492497
/* check length */
498+
hma2 = MMG3D_LLONG*MMG3D_LLONG*hmax*hmax;
499+
493500
ux = p[i2]->c[0] - p[i1]->c[0];
494501
uy = p[i2]->c[1] - p[i1]->c[1];
495502
uz = p[i2]->c[2] - p[i1]->c[2];

src/mmg3d/swap_3d.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,18 @@ int MMG5_chkswpbdy(MMG5_pMesh mesh, MMG5_pSol met, int64_t *list,int ilist,
134134
(tt2.v[MMG5_inxt2[ia2]] == nq && tt2.v[MMG5_iprv2[ia2]] == np) );
135135
na2 = tt2.v[ia2];
136136

137+
#ifdef NDEBUG
138+
/* Check that we don't have a regular bdy edge connecting ridge or nm points */
139+
if ( MG_GEO_OR_NOM(mesh->point[np].tag) && MG_GEO_OR_NOM(mesh->point[nq].tag) ) {
140+
assert ( ! MG_GEO_OR_NOM(tt1.tag[ia1]) );
141+
assert ( ! MG_GEO_OR_NOM(tt2.tag[ia2]) );
142+
}
143+
#endif
144+
/* No swap if it creates a regular boundary edge connecting ridge or non-manifold points */
145+
if ( MG_GEO_OR_NOM(mesh->point[na1].tag) && MG_GEO_OR_NOM(mesh->point[na2].tag) ) {
146+
return 0;
147+
}
148+
137149
/* Check non convexity (temporarily use b0,b1)*/
138150
MMG5_norpts(mesh,tt1.v[ia1],tt1.v[MMG5_inxt2[ia1]],tt2.v[ia2],b0);
139151
MMG5_norpts(mesh,tt2.v[ia2],tt2.v[MMG5_inxt2[ia2]],tt1.v[ia1],b1);

0 commit comments

Comments
 (0)