ENH: surfaceFeatures: Add an option to only extract features geometrically

If geometricTestOnly is set to true then edges will not be marked as region
edges, only as internal or external edges. If there are any edges still
marked as regions then this is because they are non-manifold.
This commit is contained in:
laurence
2013-02-27 12:34:44 +00:00
parent 15ba9ec7c5
commit 448bd7be3e
4 changed files with 102 additions and 30 deletions

View File

@ -767,10 +767,17 @@ int main(int argc, char *argv[])
if (extractionMethod == "extractFromFile")
{
const dictionary& extractFromFileDict =
surfaceDict.subDict("extractFromFileCoeffs");
const fileName featureEdgeFile =
surfaceDict.subDict("extractFromFileCoeffs").lookup
extractFromFileDict.lookup("featureEdgeFile");
const Switch geometricTestOnly =
extractFromFileDict.lookupOrDefault<Switch>
(
"featureEdgeFile"
"geometricTestOnly",
"no"
);
edgeMesh eMesh(featureEdgeFile);
@ -779,24 +786,54 @@ int main(int argc, char *argv[])
eMesh.mergeEdges();
Info<< nl << "Reading existing feature edges from file "
<< featureEdgeFile << endl;
<< featureEdgeFile << nl
<< "Selecting edges purely based on geometric tests: "
<< geometricTestOnly.asText() << endl;
set.set(new surfaceFeatures(surf, eMesh.points(), eMesh.edges()));
set.set
(
new surfaceFeatures
(
surf,
eMesh.points(),
eMesh.edges(),
1e-6,
geometricTestOnly
)
);
}
else if (extractionMethod == "extractFromSurface")
{
includedAngle = readScalar
(
surfaceDict.subDict("extractFromSurfaceCoeffs").lookup
const dictionary& extractFromSurfaceDict =
surfaceDict.subDict("extractFromSurfaceCoeffs");
includedAngle =
readScalar(extractFromSurfaceDict.lookup("includedAngle"));
const Switch geometricTestOnly =
extractFromSurfaceDict.lookupOrDefault<Switch>
(
"includedAngle"
"geometricTestOnly",
"no"
);
Info<< nl
<< "Constructing feature set from included angle "
<< includedAngle << nl
<< "Selecting edges purely based on geometric tests: "
<< geometricTestOnly.asText() << endl;
set.set
(
new surfaceFeatures
(
surf,
includedAngle,
0,
0,
geometricTestOnly
)
);
Info<< nl << "Constructing feature set from included angle "
<< includedAngle << endl;
set.set(new surfaceFeatures(surf, includedAngle));
}
else
{

View File

@ -26,6 +26,9 @@ surface1.stl
// - 0 : selects no edges
// - 180: selects all edges
includedAngle 120;
// Do not mark region edges
geometricTestOnly yes;
}
// Write options
@ -71,10 +74,10 @@ surface2.nas
// Keep nonManifold edges (edges with >2 connected faces where
// the faces form more than two different normal planes)
nonManifoldEdges yes;
nonManifoldEdges yes;
// Keep open edges (edges with 1 connected face)
openEdges yes;
openEdges yes;
}
addFeatures