ENH: Modification of the start point for ray shooting to avoid self-hit in distorted meshes
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -264,15 +264,13 @@ void Foam::faceShading::calculate()
|
||||
{
|
||||
includeAllFacesPerPatch[patchI].insert
|
||||
(
|
||||
faceI //pp.start()
|
||||
faceI
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
labelList triSurfaceToAgglom(5*nFaces);
|
||||
|
||||
triSurface localSurface = triangulate
|
||||
(
|
||||
includePatches,
|
||||
@ -294,9 +292,10 @@ void Foam::faceShading::calculate()
|
||||
dict
|
||||
);
|
||||
|
||||
surfacesMesh.searchableSurface::write();
|
||||
|
||||
triSurfaceToAgglom.resize(surfacesMesh.size());
|
||||
if (debug)
|
||||
{
|
||||
surfacesMesh.searchableSurface::write();
|
||||
}
|
||||
|
||||
scalar maxBounding = 5.0*mag(mesh_.bounds().max() - mesh_.bounds().min());
|
||||
|
||||
@ -324,7 +323,7 @@ void Foam::faceShading::calculate()
|
||||
|
||||
const vector d(direction_*maxBounding);
|
||||
|
||||
start.append(fc - SMALL*d);
|
||||
start.append(fc - 0.001*d);
|
||||
|
||||
startIndex.append(myFaceId);
|
||||
|
||||
@ -355,7 +354,7 @@ void Foam::faceShading::calculate()
|
||||
(
|
||||
mesh_.time().path()/"allVisibleFaces.obj",
|
||||
end,
|
||||
Cfs
|
||||
start
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user