ENH: improved handling of 'unresolved' surface intersections (issue #450)

- the heuristic for matching unresolved intersections is a relatively
  simple matching scheme that seems to be more robust than attempting to walk
  the geometry or the cuts.

- avoid false positives for self intersection
This commit is contained in:
Mark Olesen
2017-05-08 14:57:47 +02:00
parent da8ea0f21a
commit 0e7630feca
12 changed files with 384 additions and 297 deletions

View File

@ -73,7 +73,7 @@ Foam::surfaceFeaturesExtraction::method::New
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(methodName);
if (cstrIter == dictionaryConstructorTablePtr_->end())
if (!cstrIter.found())
{
FatalIOErrorInFunction
(

View File

@ -84,6 +84,8 @@ int main(int argc, char *argv[])
forAllConstIter(dictionary, dict, iter)
{
const word& dictName = iter().keyword();
if (!iter().isDict())
{
continue;
@ -106,7 +108,7 @@ int main(int argc, char *argv[])
const word outputName =
fileName
(
surfaceDict.lookupOrDefault<word>("output", iter().keyword())
surfaceDict.lookupOrDefault<word>("output", dictName)
).lessExt();
// The "surfaces" entry is normally optional, but if the sub-dictionary
@ -115,7 +117,7 @@ int main(int argc, char *argv[])
// additional switch.
if
(
iter().keyword() == "surfaces" // mandatory
dictName == "surfaces" // mandatory
|| surfaceDict.found("surfaces") // or optional
)
{
@ -123,14 +125,14 @@ int main(int argc, char *argv[])
}
else
{
loader.select(iter().keyword());
loader.select(dictName);
}
if (loader.selected().empty())
{
FatalErrorInFunction
<< "No surfaces specified/found for entry: "
<< iter().keyword() << exit(FatalError);
<< dictName << exit(FatalError);
}
// DebugVar(loader.available());
// DebugVar(outputName);
@ -153,7 +155,7 @@ int main(int argc, char *argv[])
{
FatalErrorInFunction
<< "Problem loading surface(s) for entry: "
<< iter().keyword() << exit(FatalError);
<< dictName << exit(FatalError);
}
triSurface surf = surfPtr();

View File

@ -134,7 +134,7 @@ surface2.nas
// - If other dictionaries contain a 'surfaces' entry,
// it will be taken for the input.
//
surfaces
dummyName
{
extractionMethod extractFromSurface;
@ -169,4 +169,39 @@ surfaces
writeObj yes;
}
// Handle single or multiple surfaces
//
// - If the dictionary is named 'surfaces', it must also contain a 'surfaces'
// entry (wordRe list).
//
// - If other dictionaries contain a 'surfaces' entry,
// it will be taken for the input.
//
surfaces
{
extractionMethod extractFromNone;
surfaces (surface1.stl surface2.nas);
// Base output name (optional)
// output surfaces;
// Generate additional features from self-intersect
selfIntersection true;
// Tolerance for surface intersections
tolerance 1e-3;
extractFromNoneCoeffs
{
includedAngle 0;
}
// Write options
// Write features to obj format for postprocessing
writeObj yes;
}
// ************************************************************************* //