BUG: triSurfaceTools::surfaceSide. When the sample is essentially on
the surface and not on an edge or point, do not check that the line between the sample and the nearest point is parallel to the normal.
This commit is contained in:
parent
c0ba0228e3
commit
bf877c0e56
@ -2220,14 +2220,19 @@ Foam::triSurfaceTools::sideType Foam::triSurfaceTools::surfaceSide
|
||||
|
||||
if (nearType == triPointRef::NONE)
|
||||
{
|
||||
// Nearest to face interior. Use faceNormal to determine side
|
||||
scalar c = (sample - nearestPoint) & surf.faceNormals()[nearestFaceI];
|
||||
vector sampleNearestVec = (sample - nearestPoint);
|
||||
|
||||
c /= max
|
||||
(
|
||||
VSMALL,
|
||||
mag(sample - nearestPoint)*mag(surf.faceNormals()[nearestFaceI])
|
||||
);
|
||||
scalar magSampleNearestVec = mag(sampleNearestVec);
|
||||
|
||||
// Nearest to face interior. Use faceNormal to determine side
|
||||
scalar c = sampleNearestVec & surf.faceNormals()[nearestFaceI];
|
||||
|
||||
// If the sample is essentially on the face, do not check for
|
||||
// it being perpendicular.
|
||||
|
||||
if (magSampleNearestVec > SMALL)
|
||||
{
|
||||
c /= magSampleNearestVec*mag(surf.faceNormals()[nearestFaceI]);
|
||||
|
||||
if (mag(c) < 0.9)
|
||||
{
|
||||
@ -2248,6 +2253,7 @@ Foam::triSurfaceTools::sideType Foam::triSurfaceTools::surfaceSide
|
||||
<< " " << points[f[2]] << nl
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
if (c > 0)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user