ENH: multiple surfaces, self-intersection in surfaceFeatureExtract (issue #450)

- If the dictionary is named 'surfaces', a 'surfaces' entry is mandatory.
  This is a list of wordRe, which is used to load multiple surfaces from
  constant/triSurface directory.

- Other dictionaries may contain a 'surfaces' entry.
  In which case the behaviour is as above (loading multiple surfaces).
  The dictionary name will *NOT* be taken as a surface name itself.

- Regardless of how the surfaces are loaded or features extracted,
  an additional selfIntersection test may be used.

  Eg,

    surfaces
    {
        extractionMethod    extractFromSurface;

        surfaces            (surface1.stl surface2.nas);

        // Generate features from self-intersect
        selfIntersection    true;

        // Base output name (optiona)
        output              surfaces;

        // Tolerance for self-intersect
        planarTolerance     1e-3;

        extractFromSurfaceCoeffs
        {
            includedAngle   120;

            // Do not mark region edges
            geometricTestOnly       yes;
        }
    }
This commit is contained in:
Mark Olesen
2017-04-11 11:46:00 +02:00
committed by Mark Olesen
parent 837cbafcf3
commit cd5ca147a7
13 changed files with 918 additions and 135 deletions

View File

@ -829,7 +829,7 @@ Foam::labelList Foam::surfaceFeatures::trimFeatures
}
void Foam::surfaceFeatures::writeDict(Ostream& writeFile) const
void Foam::surfaceFeatures::writeDict(Ostream& os) const
{
dictionary featInfoDict;
@ -838,15 +838,14 @@ void Foam::surfaceFeatures::writeDict(Ostream& writeFile) const
featInfoDict.add("featureEdges", featureEdges_);
featInfoDict.add("featurePoints", featurePoints_);
featInfoDict.write(writeFile);
featInfoDict.write(os);
}
void Foam::surfaceFeatures::write(const fileName& fName) const
{
OFstream str(fName);
writeDict(str);
OFstream os(fName);
writeDict(os);
}

View File

@ -177,12 +177,12 @@ public:
// Constructors
//- Construct from surface
surfaceFeatures(const triSurface&);
surfaceFeatures(const triSurface& surf);
//- Construct from components
surfaceFeatures
(
const triSurface&,
const triSurface& surf,
const labelList& featurePoints,
const labelList& featureEdges,
const label externalStart,
@ -195,7 +195,7 @@ public:
// geometric criteria
surfaceFeatures
(
const triSurface&,
const triSurface& surf,
const scalar includedAngle,
const scalar minLen = 0,
const label minElems = 0,
@ -203,15 +203,15 @@ public:
);
//- Construct from dictionary
surfaceFeatures(const triSurface&, const dictionary& dict);
surfaceFeatures(const triSurface& surf, const dictionary& dict);
//- Construct from file
surfaceFeatures(const triSurface&, const fileName& fName);
surfaceFeatures(const triSurface& surf, const fileName& fName);
//- Construct from pointField and edgeList (edgeMesh)
surfaceFeatures
(
const triSurface&,
const triSurface& surf,
const pointField& points,
const edgeList& edges,
const scalar mergeTol = 1e-6,
@ -219,7 +219,7 @@ public:
);
//- Construct as copy
surfaceFeatures(const surfaceFeatures&);
surfaceFeatures(const surfaceFeatures& sf);
// Member Functions
@ -405,7 +405,7 @@ public:
// Write
//- Write as dictionary
void writeDict(Ostream&) const;
void writeDict(Ostream& os) const;
//- Write as dictionary to file
void write(const fileName& fName) const;
@ -418,7 +418,7 @@ public:
// Member Operators
void operator=(const surfaceFeatures&);
void operator=(const surfaceFeatures& rhs);
};