From 7cd501f5eea43978b9db218b44d864f13b50916a Mon Sep 17 00:00:00 2001 From: laurence Date: Thu, 2 May 2013 14:23:25 +0100 Subject: [PATCH] ENH: triSurfaceSearch: findLineAll returns 1 hit if line goes through a surface point --- .../triSurfaceSearch/triSurfaceSearch.C | 23 +++++++++++++++++++ .../triSurfaceSearch/triSurfaceSearch.H | 3 +++ 2 files changed, 26 insertions(+) diff --git a/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C b/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C index aad1a824eb..fbff791040 100644 --- a/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C +++ b/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C @@ -54,6 +54,29 @@ bool Foam::triSurfaceSearch::checkUniqueHit if (nearType == 1) { // near point + + const label nearPointI = f[nearLabel]; + + const labelList& pointFaces = + surface().pointFaces()[surface().meshPointMap()[nearPointI]]; + + forAll(pointFaces, pI) + { + const label pointFaceI = pointFaces[pI]; + + if (pointFaceI != currHit.index()) + { + forAll(hits, hI) + { + const pointIndexHit& hit = hits[hI]; + + if (hit.index() == pointFaceI) + { + return false; + } + } + } + } } else if (nearType == 2) { diff --git a/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.H b/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.H index bdca1bca83..f4176f3cfa 100644 --- a/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.H +++ b/src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.H @@ -74,6 +74,9 @@ class triSurfaceSearch //- Check whether the current hit on the surface which lies on lineVec // is unique. + // point : return 1 unique hit + // edge : return 1 hit if in the cone of the edge faces + // : return 2 hits if outside or on the cone. bool checkUniqueHit ( const pointIndexHit& currHit,