Skip SplitImproveEdge if it would insert tets with negative volume

This commit is contained in:
Matthias Hochsteger 2024-09-11 16:10:06 +02:00
parent 75fbd86a7a
commit 4d04dcd97d

View File

@ -546,6 +546,9 @@ double MeshOptimize3d :: SplitImproveEdge (Table<ElementIndex,PointIndex> & elem
if (!mesh.LegalTet (oldel)) bad1 += GetLegalPenalty();
if (!mesh.LegalTet (newel1)) bad2 += GetLegalPenalty();
if (!mesh.LegalTet (newel2)) bad2 += GetLegalPenalty();
if( newel1.Volume(mesh.Points()) < 0.0 || newel2.Volume(mesh.Points()) < 0.0)
return 0.0;
}
d_badness = bad2-bad1;