Holds feature edges/points of surface. More...
Public Types | |
enum | edgeStatus { NONE, REGION, EXTERNAL, INTERNAL } |
Public Member Functions | |
ClassName ("surfaceFeatures") | |
surfaceFeatures (const triSurface &surf) | |
surfaceFeatures (const triSurface &surf, const labelList &featurePoints, const labelList &featureEdges, const label externalStart, const label internalStart) | |
surfaceFeatures (const triSurface &surf, const scalar includedAngle, const scalar minLen=0, const label minElems=0, const bool geometricTestOnly=false) | |
surfaceFeatures (const triSurface &surf, const dictionary &dict) | |
surfaceFeatures (const triSurface &surf, const fileName &fName) | |
surfaceFeatures (const triSurface &surf, const pointField &points, const edgeList &edges, const scalar mergeTol=1e-6, const bool geometricTestOnly=false) | |
surfaceFeatures (const surfaceFeatures &sf) | |
const triSurface & | surface () const |
const labelList & | featurePoints () const |
const labelList & | featureEdges () const |
label | externalStart () const |
label | internalStart () const |
label | nRegionEdges () const |
label | nExternalEdges () const |
label | nInternalEdges () const |
labelList | selectFeatureEdges (const bool regionEdges, const bool externalEdges, const bool internalEdges) const |
void | findFeatures (const scalar includedAngle, const bool geometricTestOnly) |
labelList | trimFeatures (const scalar minLen, const label minElems, const scalar includedAngle) |
void | excludeBox (List< edgeStatus > &edgeStat, const treeBoundBox &bb) const |
void | subsetBox (List< edgeStatus > &edgeStat, const treeBoundBox &bb) const |
void | deleteBox (List< edgeStatus > &edgeStat, const treeBoundBox &bb, const bool removeInside) const |
void | subsetPlane (List< edgeStatus > &edgeStat, const plane &cutPlane) const |
void | excludeOpen (List< edgeStatus > &edgeStat) const |
void | checkFlatRegionEdge (List< edgeStatus > &edgeStat, const scalar tol, const scalar includedAngle) const |
List< edgeStatus > | toStatus () const |
void | setFromStatus (const List< edgeStatus > &edgeStat, const scalar includedAngle) |
Map< label > | nearestSamples (const labelList &selectedPoints, const pointField &samples, const scalarField &maxDistSqr) const |
Map< label > | nearestSamples (const labelList &selectedEdges, const pointField &samples, const scalarField &sampleDist, const scalarField &maxDistSqr, const scalar minSampleDist=0.1) const |
Map< pointIndexHit > | nearestEdges (const labelList &selectedEdges, const edgeList &sampleEdges, const labelList &selectedSampleEdges, const pointField &samplePoints, const scalarField &sampleDist, const scalarField &maxDistSqr, const scalar minSampleDist=0.1) const |
void | nearestSurfEdge (const labelList &selectedEdges, const pointField &samples, scalar searchSpanSqr, labelList &edgeLabel, labelList &edgeEndPoint, pointField &edgePoint) const |
void | nearestSurfEdge (const labelList &selectedEdges, const edgeList &sampleEdges, const labelList &selectedSampleEdges, const pointField &samplePoints, const vector &searchSpan, labelList &edgeLabel, pointField &pointOnEdge, pointField &pointOnFeature) const |
void | nearestFeatEdge (const edgeList &edges, const pointField &points, scalar searchSpanSqr, labelList &edgeLabel) const |
void | writeDict (Ostream &os) const |
void | write (const fileName &fName) const |
void | writeObj (const fileName &prefix) const |
void | writeStats (Ostream &os) const |
void | operator= (const surfaceFeatures &rhs) |
Holds feature edges/points of surface.
Feature edges are stored in one list and sorted: 0 .. externalStart_-1 : region edges externalStart_ .. internalStart_-1 : external edges internalStart_ .. size-1 : internal edges
NOTE: angle is included angle, not feature angle and is in degrees. The included angle is the smallest angle between two planes. For coplanar faces it is 180, for straight angles it is 90. To pick up straight edges only use included angle of 91 degrees
Definition at line 69 of file surfaceFeatures.H.
enum edgeStatus |
Enumerator | |
---|---|
NONE | Not a classified feature edge. |
REGION | |
EXTERNAL | "Convex" edge |
INTERNAL | "Concave" edge |
Definition at line 74 of file surfaceFeatures.H.
surfaceFeatures | ( | const triSurface & | surf | ) |
Definition at line 647 of file surfaceFeatures.C.
surfaceFeatures | ( | const triSurface & | surf, |
const labelList & | featurePoints, | ||
const labelList & | featureEdges, | ||
const label | externalStart, | ||
const label | internalStart | ||
) |
Definition at line 659 of file surfaceFeatures.C.
surfaceFeatures | ( | const triSurface & | surf, |
const scalar | includedAngle, | ||
const scalar | minLen = 0 , |
||
const label | minElems = 0 , |
||
const bool | geometricTestOnly = false |
||
) |
Definition at line 677 of file surfaceFeatures.C.
surfaceFeatures | ( | const triSurface & | surf, |
const dictionary & | dict | ||
) |
Definition at line 701 of file surfaceFeatures.C.
surfaceFeatures | ( | const triSurface & | surf, |
const fileName & | fName | ||
) |
Definition at line 715 of file surfaceFeatures.C.
References dictionary::readEntry().
surfaceFeatures | ( | const triSurface & | surf, |
const pointField & | points, | ||
const edgeList & | edges, | ||
const scalar | mergeTol = 1e-6 , |
||
const bool | geometricTestOnly = false |
||
) |
Definition at line 738 of file surfaceFeatures.C.
References DynamicList::append(), HashTable::cfind(), List::clear(), HashTable::clear(), Foam::BitOps::count(), forAll, HashTable::insert(), points, HashTable::size(), and Foam::sqr().
surfaceFeatures | ( | const surfaceFeatures & | sf | ) |
Definition at line 818 of file surfaceFeatures.C.
ClassName | ( | "surfaceFeatures" | ) |
|
inline |
Definition at line 240 of file surfaceFeatures.H.
Referenced by surfaceFeatures::operator=().
|
inline |
Definition at line 246 of file surfaceFeatures.H.
Referenced by surfaceFeatures::operator=().
|
inline |
Definition at line 252 of file surfaceFeatures.H.
Referenced by surfaceFeatures::operator=().
|
inline |
Definition at line 258 of file surfaceFeatures.H.
Referenced by surfaceFeatures::operator=().
|
inline |
Definition at line 264 of file surfaceFeatures.H.
Referenced by surfaceFeatures::operator=().
|
inline |
Definition at line 270 of file surfaceFeatures.H.
|
inline |
Definition at line 276 of file surfaceFeatures.H.
|
inline |
Definition at line 282 of file surfaceFeatures.H.
Foam::labelList selectFeatureEdges | ( | const bool | regionEdges, |
const bool | externalEdges, | ||
const bool | internalEdges | ||
) | const |
Definition at line 831 of file surfaceFeatures.C.
References DynamicList::append(), DynamicList::setCapacity(), and DynamicList::shrink().
void findFeatures | ( | const scalar | includedAngle, |
const bool | geometricTestOnly | ||
) |
Definition at line 874 of file surfaceFeatures.C.
References Foam::cos(), and Foam::degToRad().
Foam::labelList trimFeatures | ( | const scalar | minLen, |
const label | minElems, | ||
const scalar | includedAngle | ||
) |
Definition at line 899 of file surfaceFeatures.C.
References forAll, and edge::mag().
void excludeBox | ( | List< edgeStatus > & | edgeStat, |
const treeBoundBox & | bb | ||
) | const |
Definition at line 1033 of file surfaceFeatures.C.
void subsetBox | ( | List< edgeStatus > & | edgeStat, |
const treeBoundBox & | bb | ||
) | const |
Definition at line 1043 of file surfaceFeatures.C.
void deleteBox | ( | List< edgeStatus > & | edgeStat, |
const treeBoundBox & | bb, | ||
const bool | removeInside | ||
) | const |
Definition at line 1053 of file surfaceFeatures.C.
References treeBoundBox::contains(), forAll, and surfaceFeatures::NONE.
void subsetPlane | ( | List< edgeStatus > & | edgeStat, |
const plane & | cutPlane | ||
) | const |
Definition at line 1075 of file surfaceFeatures.C.
References Foam::constant::electromagnetic::e, forAll, plane::lineIntersect(), surfaceFeatures::NONE, and p0.
void excludeOpen | ( | List< edgeStatus > & | edgeStat | ) | const |
Definition at line 1106 of file surfaceFeatures.C.
References forAll, and surfaceFeatures::NONE.
void checkFlatRegionEdge | ( | List< edgeStatus > & | edgeStat, |
const scalar | tol, | ||
const scalar | includedAngle | ||
) | const |
Definition at line 1128 of file surfaceFeatures.C.
References forAll, and surfaceFeatures::REGION.
Foam::List< Foam::surfaceFeatures::edgeStatus > toStatus | ( | ) | const |
Definition at line 110 of file surfaceFeatures.C.
void setFromStatus | ( | const List< edgeStatus > & | edgeStat, |
const scalar | includedAngle | ||
) |
Definition at line 139 of file surfaceFeatures.C.
References Foam::cos(), Foam::degToRad(), and forAll.
Foam::Map< Foam::label > nearestSamples | ( | const labelList & | selectedPoints, |
const pointField & | samples, | ||
const scalarField & | maxDistSqr | ||
) | const |
Definition at line 1239 of file surfaceFeatures.C.
References Foam::abort(), indexedOctree::bb(), Foam::expressions::patchExpr::debug, Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, forAllConstIters(), PointIndexHit::hit(), PointIndexHit::index(), Foam::magSqr(), pointLabels(), Foam::Pout, samples(), and Foam::meshTools::writeOBJ().
Foam::Map< Foam::label > nearestSamples | ( | const labelList & | selectedEdges, |
const pointField & | samples, | ||
const scalarField & | sampleDist, | ||
const scalarField & | maxDistSqr, | ||
const scalar | minSampleDist = 0.1 |
||
) | const |
Definition at line 1320 of file surfaceFeatures.C.
References Foam::expressions::patchExpr::debug, Foam::constant::electromagnetic::e, Foam::endl(), Foam::exit(), forAll, forAllConstIters(), PointIndexHit::hit(), PointIndexHit::hitPoint(), PointIndexHit::index(), Foam::mag(), Foam::magSqr(), Foam::max(), Foam::Pout, s, samples(), and Foam::meshTools::writeOBJ().
Foam::Map< Foam::pointIndexHit > nearestEdges | ( | const labelList & | selectedEdges, |
const edgeList & | sampleEdges, | ||
const labelList & | selectedSampleEdges, | ||
const pointField & | samplePoints, | ||
const scalarField & | sampleDist, | ||
const scalarField & | maxDistSqr, | ||
const scalar | minSampleDist = 0.1 |
||
) | const |
Definition at line 1456 of file surfaceFeatures.C.
References edge::centre(), Foam::expressions::patchExpr::debug, Foam::constant::electromagnetic::e, Foam::endl(), Foam::exit(), forAll, forAllConstIters(), PointIndexHit::hit(), PointIndexHit::hitPoint(), PointIndexHit::index(), Foam::mag(), Foam::magSqr(), Foam::max(), Foam::Pout, s, indexedOctree::shapes(), and Foam::meshTools::writeOBJ().
void nearestSurfEdge | ( | const labelList & | selectedEdges, |
const pointField & | samples, | ||
scalar | searchSpanSqr, | ||
labelList & | edgeLabel, | ||
labelList & | edgeEndPoint, | ||
pointField & | edgePoint | ||
) | const |
Definition at line 1607 of file surfaceFeatures.C.
References Foam::constant::electromagnetic::e, forAll, PointIndexHit::hit(), PointIndexHit::index(), boundBox::inflate(), PointIndexHit::rawPoint(), samples(), and List::setSize().
void nearestSurfEdge | ( | const labelList & | selectedEdges, |
const edgeList & | sampleEdges, | ||
const labelList & | selectedSampleEdges, | ||
const pointField & | samplePoints, | ||
const vector & | searchSpan, | ||
labelList & | edgeLabel, | ||
pointField & | pointOnEdge, | ||
pointField & | pointOnFeature | ||
) | const |
Definition at line 1677 of file surfaceFeatures.C.
References line::centre(), Foam::constant::electromagnetic::e, forAll, PointIndexHit::hit(), PointIndexHit::hitPoint(), PointIndexHit::index(), and List::setSize().
void nearestFeatEdge | ( | const edgeList & | edges, |
const pointField & | points, | ||
scalar | searchSpanSqr, | ||
labelList & | edgeLabel | ||
) | const |
Definition at line 1743 of file surfaceFeatures.C.
References forAll, PointIndexHit::hit(), Foam::identity(), PointIndexHit::index(), boundBox::inflate(), Foam::mag(), points, and edge::vec().
void writeDict | ( | Ostream & | os | ) | const |
Definition at line 1154 of file surfaceFeatures.C.
References dictionary::add(), os(), and dictionary::write().
void write | ( | const fileName & | fName | ) | const |
Definition at line 1166 of file surfaceFeatures.C.
References os().
void writeObj | ( | const fileName & | prefix | ) | const |
Definition at line 1173 of file surfaceFeatures.C.
References Foam::constant::electromagnetic::e, Foam::endl(), OFstream::name(), Foam::Pout, and Foam::meshTools::writeOBJ().
void writeStats | ( | Ostream & | os | ) | const |
Definition at line 1225 of file surfaceFeatures.C.
References Foam::endl(), Foam::nl, and os().
void operator= | ( | const surfaceFeatures & | rhs | ) |
Definition at line 1805 of file surfaceFeatures.C.
References Foam::abort(), surfaceFeatures::externalStart(), Foam::FatalError, FatalErrorInFunction, surfaceFeatures::featureEdges(), surfaceFeatures::featurePoints(), surfaceFeatures::internalStart(), and surfaceFeatures::surface().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.