Classes | Public Types | Public Member Functions | List of all members
surfaceFeatures Class Reference

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 triSurfacesurface () const
 
const labelListfeaturePoints () const
 
const labelListfeatureEdges () 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< edgeStatustoStatus () 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< pointIndexHitnearestEdges (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)
 

Detailed Description

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

Source files

Definition at line 69 of file surfaceFeatures.H.

Member Enumeration Documentation

◆ edgeStatus

enum edgeStatus
Enumerator
NONE 

Not a classified feature edge.

REGION 
EXTERNAL 

"Convex" edge

INTERNAL 

"Concave" edge

Definition at line 74 of file surfaceFeatures.H.

Constructor & Destructor Documentation

◆ surfaceFeatures() [1/7]

surfaceFeatures ( const triSurface surf)

Definition at line 647 of file surfaceFeatures.C.

◆ surfaceFeatures() [2/7]

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() [3/7]

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() [4/7]

surfaceFeatures ( const triSurface surf,
const dictionary dict 
)

Definition at line 701 of file surfaceFeatures.C.

◆ surfaceFeatures() [5/7]

surfaceFeatures ( const triSurface surf,
const fileName fName 
)

Definition at line 715 of file surfaceFeatures.C.

References dictionary::readEntry().

Here is the call graph for this function:

◆ surfaceFeatures() [6/7]

surfaceFeatures ( const triSurface surf,
const pointField points,
const edgeList edges,
const scalar  mergeTol = 1e-6,
const bool  geometricTestOnly = false 
)

◆ surfaceFeatures() [7/7]

Definition at line 818 of file surfaceFeatures.C.

Member Function Documentation

◆ ClassName()

ClassName ( "surfaceFeatures"  )

◆ surface()

const triSurface& surface ( ) const
inline

Definition at line 240 of file surfaceFeatures.H.

Referenced by surfaceFeatures::operator=().

Here is the caller graph for this function:

◆ featurePoints()

const labelList& featurePoints ( ) const
inline

Definition at line 246 of file surfaceFeatures.H.

Referenced by surfaceFeatures::operator=().

Here is the caller graph for this function:

◆ featureEdges()

const labelList& featureEdges ( ) const
inline

Definition at line 252 of file surfaceFeatures.H.

Referenced by surfaceFeatures::operator=().

Here is the caller graph for this function:

◆ externalStart()

label externalStart ( ) const
inline

Definition at line 258 of file surfaceFeatures.H.

Referenced by surfaceFeatures::operator=().

Here is the caller graph for this function:

◆ internalStart()

label internalStart ( ) const
inline

Definition at line 264 of file surfaceFeatures.H.

Referenced by surfaceFeatures::operator=().

Here is the caller graph for this function:

◆ nRegionEdges()

label nRegionEdges ( ) const
inline

Definition at line 270 of file surfaceFeatures.H.

◆ nExternalEdges()

label nExternalEdges ( ) const
inline

Definition at line 276 of file surfaceFeatures.H.

◆ nInternalEdges()

label nInternalEdges ( ) const
inline

Definition at line 282 of file surfaceFeatures.H.

◆ selectFeatureEdges()

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().

Here is the call graph for this function:

◆ findFeatures()

void findFeatures ( const scalar  includedAngle,
const bool  geometricTestOnly 
)

Definition at line 874 of file surfaceFeatures.C.

References Foam::cos(), and Foam::degToRad().

Here is the call graph for this function:

◆ trimFeatures()

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().

Here is the call graph for this function:

◆ excludeBox()

void excludeBox ( List< edgeStatus > &  edgeStat,
const treeBoundBox bb 
) const

Definition at line 1033 of file surfaceFeatures.C.

◆ subsetBox()

void subsetBox ( List< edgeStatus > &  edgeStat,
const treeBoundBox bb 
) const

Definition at line 1043 of file surfaceFeatures.C.

◆ deleteBox()

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.

Here is the call graph for this function:

◆ subsetPlane()

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.

Here is the call graph for this function:

◆ excludeOpen()

void excludeOpen ( List< edgeStatus > &  edgeStat) const

Definition at line 1106 of file surfaceFeatures.C.

References forAll, and surfaceFeatures::NONE.

◆ checkFlatRegionEdge()

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.

◆ toStatus()

Definition at line 110 of file surfaceFeatures.C.

◆ setFromStatus()

void setFromStatus ( const List< edgeStatus > &  edgeStat,
const scalar  includedAngle 
)

Definition at line 139 of file surfaceFeatures.C.

References Foam::cos(), Foam::degToRad(), and forAll.

Here is the call graph for this function:

◆ nearestSamples() [1/2]

Foam::Map< Foam::label > nearestSamples ( const labelList selectedPoints,
const pointField samples,
const scalarField maxDistSqr 
) const

◆ nearestSamples() [2/2]

Foam::Map< Foam::label > nearestSamples ( const labelList selectedEdges,
const pointField samples,
const scalarField sampleDist,
const scalarField maxDistSqr,
const scalar  minSampleDist = 0.1 
) const

◆ nearestEdges()

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

◆ nearestSurfEdge() [1/2]

void nearestSurfEdge ( const labelList selectedEdges,
const pointField samples,
scalar  searchSpanSqr,
labelList edgeLabel,
labelList edgeEndPoint,
pointField edgePoint 
) const

◆ nearestSurfEdge() [2/2]

void nearestSurfEdge ( const labelList selectedEdges,
const edgeList sampleEdges,
const labelList selectedSampleEdges,
const pointField samplePoints,
const vector searchSpan,
labelList edgeLabel,
pointField pointOnEdge,
pointField pointOnFeature 
) const

◆ nearestFeatEdge()

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().

Here is the call graph for this function:

◆ writeDict()

void writeDict ( Ostream os) const

Definition at line 1154 of file surfaceFeatures.C.

References dictionary::add(), os(), and dictionary::write().

Here is the call graph for this function:

◆ write()

void write ( const fileName fName) const

Definition at line 1166 of file surfaceFeatures.C.

References os().

Here is the call graph for this function:

◆ writeObj()

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().

Here is the call graph for this function:

◆ writeStats()

void writeStats ( Ostream os) const

Definition at line 1225 of file surfaceFeatures.C.

References Foam::endl(), Foam::nl, and os().

Here is the call graph for this function:

◆ operator=()

void operator= ( const surfaceFeatures rhs)

The documentation for this class was generated from the following files: