mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: reduce some isoSurfaceCell regularise failures (closes #870)
- when the iso-surface (eg, a cut plane, or distanceSurface) passes exactly through the cell centre, zero-sized triangles can occur. These should be merged away.
This commit is contained in:
@ -284,16 +284,18 @@ Foam::pointIndexHit Foam::isoSurfaceCell::collapseSurface
|
|||||||
|
|
||||||
if (shared[0] != -1)
|
if (shared[0] != -1)
|
||||||
{
|
{
|
||||||
vector n0 = tri0.normal(localPoints);
|
const vector n0 = tri0.normal(localPoints);
|
||||||
n0 /= mag(n0);
|
const vector n1 = tri1.normal(localPoints);
|
||||||
vector n1 = tri1.normal(localPoints);
|
|
||||||
n1 /= mag(n1);
|
|
||||||
|
|
||||||
if ((n0 & n1) < 0)
|
// Merge any zero-sized triangles,
|
||||||
{
|
// or if they point in the same direction.
|
||||||
// Too big an angle. Do not simplify.
|
|
||||||
}
|
if
|
||||||
else
|
(
|
||||||
|
mag(n0) <= ROOTVSMALL
|
||||||
|
|| mag(n1) <= ROOTVSMALL
|
||||||
|
|| (n0 & n1) >= 0
|
||||||
|
)
|
||||||
{
|
{
|
||||||
info.setPoint
|
info.setPoint
|
||||||
(
|
(
|
||||||
|
|||||||
Reference in New Issue
Block a user