From f3d9fb59b01faa82bf508b37ca5d001f9d31dd8a Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 15 Sep 2008 12:18:04 +0100 Subject: [PATCH] tolerances --- src/meshTools/triSurface/triangleFuncs/triangleFuncs.C | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/meshTools/triSurface/triangleFuncs/triangleFuncs.C b/src/meshTools/triSurface/triangleFuncs/triangleFuncs.C index e8c9a29552..9fe49a1b1f 100644 --- a/src/meshTools/triSurface/triangleFuncs/triangleFuncs.C +++ b/src/meshTools/triSurface/triangleFuncs/triangleFuncs.C @@ -101,8 +101,6 @@ bool Foam::triangleFuncs::intersectAxesBundle // Since direction is coordinate axis there is no need to do projection, // we can directly check u,v components for inclusion in triangle. - scalar localScale = max(max(magSqr(V10), magSqr(V20)), 1.0); - // Get other components label i1 = (i0 + 1) % 3; label i2 = (i1 + 1) % 3; @@ -113,6 +111,8 @@ bool Foam::triangleFuncs::intersectAxesBundle scalar u2 = V20[i1]; scalar v2 = V20[i2]; + scalar localScale = mag(u1)+mag(v1)+mag(u2)+mag(v2); + scalar det = v2*u1 - u2*v1; // Fix for V0:(-31.71428 0 -15.10714) @@ -136,7 +136,7 @@ bool Foam::triangleFuncs::intersectAxesBundle scalar beta = 0; bool inter = false; - if (Foam::mag(u1)/localScale < SMALL) + if (Foam::mag(u1) < SMALL) { beta = u0/u2; if ((beta >= 0) && (beta <= 1))