ENH: triSurfaceSearch: findLineAll returns 1 hit if line goes through a surface point

This commit is contained in:
laurence
2013-05-02 14:23:25 +01:00
parent c7dbe491c6
commit 7cd501f5ee
2 changed files with 26 additions and 0 deletions

View File

@ -54,6 +54,29 @@ bool Foam::triSurfaceSearch::checkUniqueHit
if (nearType == 1) if (nearType == 1)
{ {
// near point // 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) else if (nearType == 2)
{ {

View File

@ -74,6 +74,9 @@ class triSurfaceSearch
//- Check whether the current hit on the surface which lies on lineVec //- Check whether the current hit on the surface which lies on lineVec
// is unique. // 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 bool checkUniqueHit
( (
const pointIndexHit& currHit, const pointIndexHit& currHit,