From 6400a2a484d99968f4364aa0d81ae89a345a1b34 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 8 Nov 2011 15:54:06 +0000 Subject: [PATCH] ENH: Improved code comments for triangle intersection area calc --- .../faceAreaIntersect/faceAreaIntersect.C | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/src/meshTools/AMIInterpolation/faceAreaIntersect/faceAreaIntersect.C b/src/meshTools/AMIInterpolation/faceAreaIntersect/faceAreaIntersect.C index 953e1d4afa..218c41afbf 100644 --- a/src/meshTools/AMIInterpolation/faceAreaIntersect/faceAreaIntersect.C +++ b/src/meshTools/AMIInterpolation/faceAreaIntersect/faceAreaIntersect.C @@ -53,9 +53,9 @@ void Foam::faceAreaIntersect::triSliceWithPlane if (mag(d[i]) < matchTol*len) { - d[i] = 0.0; nCoPlanar++; copI = i; + d[i] = 0.0; } else { @@ -71,6 +71,9 @@ void Foam::faceAreaIntersect::triSliceWithPlane } } + + // Determine triangle area contribution + if ( (nPos == 3) @@ -78,6 +81,12 @@ void Foam::faceAreaIntersect::triSliceWithPlane || ((nPos == 1) && (nCoPlanar == 2))) { // all points above cutting plane - add triangle to list + + // /\ _____ + // / \ \ / /\ + // /____\ \ / / \ + // __________ ____v____ __/____\__ + tris[nTris++] = tri; } else if ((nPos == 2) && (nCoPlanar == 0)) @@ -85,6 +94,12 @@ void Foam::faceAreaIntersect::triSliceWithPlane // 2 points above plane, 1 below // resulting quad above plane split into 2 triangles + // ________ + // \ / + // --\----/-- + // \ / + // \/ + // point under the plane label i0 = negI; @@ -110,6 +125,11 @@ void Foam::faceAreaIntersect::triSliceWithPlane { // 1 point above plane, 2 below + // /\ + // / \ + // --/----\-- + // /______\ + // indices of remaining points label i1 = d.fcIndex(i0); label i2 = d.fcIndex(i1); @@ -126,6 +146,13 @@ void Foam::faceAreaIntersect::triSliceWithPlane { // 1 point above plane, 1 on plane, 1 below + // |\ + // | \ + // __|__\__ + // | / + // | / + // |/ + // point indices label i1 = negI; label i2 = copI; @@ -147,6 +174,13 @@ void Foam::faceAreaIntersect::triSliceWithPlane else { // all points below cutting plane - forget + + // _________ __________ ___________ + // /\ \ / + // /\ / \ \ / + // / \ /____\ \/ + // /____\ + } }