ENH: surfaceFeatureExtract: optionally filter out non-manifold edges

This commit is contained in:
mattijs
2011-06-24 16:24:58 +01:00
parent 4653f8efeb
commit 77d1e2231d

View File

@ -414,13 +414,25 @@ int main(int argc, char *argv[])
);
argList::addBoolOption
(
"writeVTK",
"write surface property VTK files"
"manifoldEdgesOnly",
"remove any non-manifold (open or more than two connected faces) edges"
);
# include "setRootCase.H"
# include "createTime.H"
if (env("FOAM_SIGFPE"))
{
WarningIn(args.executable())
<< "Detected floating point exception trapping (FOAM_SIGFPE)."
<< " This might give" << nl
<< " problems when calculating curvature on straight angles"
<< " (infinite curvature)" << nl
<< " Switch it off in case of problems." << endl;
}
Info<< "Feature line extraction is only valid on closed manifold surfaces."
<< endl;
@ -566,6 +578,20 @@ int main(int argc, char *argv[])
);
}
if (args.optionFound("manifoldEdgesOnly"))
{
Info<< "Removing all non-manifold edges" << endl;
forAll(edgeStat, edgeI)
{
if (surf.edgeFaces()[edgeI].size() != 2)
{
edgeStat[edgeI] = surfaceFeatures::NONE;
}
}
}
surfaceFeatures newSet(surf);
newSet.setFromStatus(edgeStat);