mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: surfaceCheck: additional printing. Additional self-intersect test with reverse ray
This commit is contained in:
@ -795,6 +795,12 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "Splitting surface into parts ..." << endl << endl;
|
Info<< "Splitting surface into parts ..." << endl << endl;
|
||||||
|
|
||||||
writeZoning(surf, faceZone, "zone", surfFilePath, surfFileNameBase);
|
writeZoning(surf, faceZone, "zone", surfFilePath, surfFileNameBase);
|
||||||
|
|
||||||
|
if (numZones > outputThreshold)
|
||||||
|
{
|
||||||
|
Info<< "Limiting number of files to " << outputThreshold
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
writeParts
|
writeParts
|
||||||
(
|
(
|
||||||
surf,
|
surf,
|
||||||
@ -849,6 +855,12 @@ int main(int argc, char *argv[])
|
|||||||
surfFilePath,
|
surfFilePath,
|
||||||
surfFileNameBase
|
surfFileNameBase
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (numNormalZones > outputThreshold)
|
||||||
|
{
|
||||||
|
Info<< "Limiting number of files to " << outputThreshold
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
writeParts
|
writeParts
|
||||||
(
|
(
|
||||||
surf,
|
surf,
|
||||||
@ -885,28 +897,79 @@ int main(int argc, char *argv[])
|
|||||||
forAll(surf.edges(), edgeI)
|
forAll(surf.edges(), edgeI)
|
||||||
{
|
{
|
||||||
const edge& e = surf.edges()[edgeI];
|
const edge& e = surf.edges()[edgeI];
|
||||||
|
const point& start = surf.points()[surf.meshPoints()[e[0]]];
|
||||||
|
const point& end = surf.points()[surf.meshPoints()[e[1]]];
|
||||||
|
|
||||||
pointIndexHit hitInfo
|
// Exclude hits of connected triangles
|
||||||
(
|
treeDataTriSurface::findSelfIntersectOp exclOp(tree, edgeI);
|
||||||
tree.findLine
|
|
||||||
(
|
|
||||||
surf.points()[surf.meshPoints()[e[0]]],
|
|
||||||
surf.points()[surf.meshPoints()[e[1]]],
|
|
||||||
treeDataTriSurface::findSelfIntersectOp
|
|
||||||
(
|
|
||||||
tree,
|
|
||||||
edgeI
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (hitInfo.hit() && intStreamPtr.valid())
|
pointIndexHit hitInfo(tree.findLineAny(start, end, exclOp));
|
||||||
|
|
||||||
|
if (hitInfo.hit())
|
||||||
{
|
{
|
||||||
intStreamPtr().write(hitInfo.hitPoint());
|
|
||||||
nInt++;
|
nInt++;
|
||||||
|
|
||||||
|
if (intStreamPtr.valid())
|
||||||
|
{
|
||||||
|
intStreamPtr().write(hitInfo.hitPoint());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Try and find from other side.
|
||||||
|
pointIndexHit hitInfo2(tree.findLineAny(end, start, exclOp));
|
||||||
|
|
||||||
|
if (hitInfo2.hit() && hitInfo.index() != hitInfo2.index())
|
||||||
|
{
|
||||||
|
nInt++;
|
||||||
|
|
||||||
|
if (intStreamPtr.valid())
|
||||||
|
{
|
||||||
|
intStreamPtr().write(hitInfo2.hitPoint());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//// Check very near triangles
|
||||||
|
//{
|
||||||
|
// const pointField& localPoints = surf.localPoints();
|
||||||
|
//
|
||||||
|
// const boundBox bb(localPoints);
|
||||||
|
// scalar smallDim = 1e-6 * bb.mag();
|
||||||
|
// scalar smallDimSqr = Foam::sqr(smallDim);
|
||||||
|
//
|
||||||
|
// const pointField& faceCentres = surf.faceCentres();
|
||||||
|
// forAll(faceCentres, faceI)
|
||||||
|
// {
|
||||||
|
// const point& fc = faceCentres[faceI];
|
||||||
|
// pointIndexHit hitInfo
|
||||||
|
// (
|
||||||
|
// tree.findNearest
|
||||||
|
// (
|
||||||
|
// fc,
|
||||||
|
// smallDimSqr,
|
||||||
|
// findSelfNearOp(tree, faceI)
|
||||||
|
// )
|
||||||
|
// );
|
||||||
|
//
|
||||||
|
// if (hitInfo.hit() && intStreamPtr.valid())
|
||||||
|
// {
|
||||||
|
// intStreamPtr().write(hitInfo.hitPoint());
|
||||||
|
//
|
||||||
|
// label nearFaceI = hitInfo.index();
|
||||||
|
// triPointRef nearTri(surf[nearFaceI].tri(surf.points()));
|
||||||
|
// triStreamPtr().write
|
||||||
|
// (
|
||||||
|
// surf[faceI].tri(surf.points()),
|
||||||
|
// false
|
||||||
|
// );
|
||||||
|
// triStreamPtr().write(nearTri, false);
|
||||||
|
// nInt++;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
if (nInt == 0)
|
if (nInt == 0)
|
||||||
{
|
{
|
||||||
Info<< "Surface is not self-intersecting" << endl;
|
Info<< "Surface is not self-intersecting" << endl;
|
||||||
|
|||||||
Reference in New Issue
Block a user