FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

surfaceFeatures Class Reference

Holds feature edges/points of surface. More...

#include <meshTools/surfaceFeatures.H>


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.

Collaboration diagram for surfaceFeatures:

List of all members.

Classes

class  labelScalar
 label and scalar; used in path walking

Public Types

enum  edgeStatus { NONE, REGION, EXTERNAL, INTERNAL }

Public Member Functions

 ClassName ("surfaceFeatures")
 surfaceFeatures (const triSurface &)
 Construct from surface.
 surfaceFeatures (const triSurface &, const labelList &featurePoints, const labelList &featureEdges, const label externalStart, const label internalStart)
 Construct from components.
 surfaceFeatures (const triSurface &, const scalar includedAngle, const scalar minLen=0, const label minElems=0)
 Construct from surface, angle and min cumulative length and/or.
 surfaceFeatures (const triSurface &, const dictionary &dict)
 Construct from dictionary.
 surfaceFeatures (const triSurface &, const fileName &fName)
 Construct from file.
 surfaceFeatures (const surfaceFeatures &)
 Construct as copy.
const triSurface &  surface () const
const labelList &  featurePoints () const
 Return feature point list.
const labelList &  featureEdges () const
 Return feature edge list.
label  externalStart () const
 start of external edges
label  internalStart () const
 start of internal edges
label  nRegionEdges () const
 Return number of region edges.
label  nExternalEdges () const
 Return number of external edges.
label  nInternalEdges () const
 Return number of internal edges.
labelList  selectFeatureEdges (const bool regionEdges, const bool externalEdges, const bool internalEdges) const
 Helper function: select a subset of featureEdges_.
void  findFeatures (const scalar includedAngle)
 Find feature edges using provided included angle.
void  trimFeatures (const scalar minLen, const label minElems)
 Delete small sets of edges. Edges are stringed up and any.
List< edgeStatus >  toStatus () const
 From member feature edges to status per edge.
void  setFromStatus (const List< edgeStatus > &)
 Set from status per edge.
Map< label >  nearestSamples (const labelList &selectedPoints, const pointField &samples, const scalarField &maxDist) const
 Find nearest sample for selected surface points (usually the.
Map< label >  nearestSamples (const labelList &selectedEdges, const pointField &samples, const scalarField &sampleDist, const scalarField &maxDist, const scalar minSampleDist=0.1) const
 Find nearest sample for regularly sampled points along the.
Map< pointIndexHit >  nearestEdges (const labelList &selectedEdges, const edgeList &sampleEdges, const labelList &selectedSampleEdges, const pointField &samplePoints, const scalarField &sampleDist, const scalarField &maxDist, const scalar minSampleDist=0.1) const
 Like nearestSamples but now gets nearest point on.
void  nearestSurfEdge (const labelList &selectedEdges, const pointField &samples, const vector &searchSpan, labelList &edgeLabel, labelList &edgeEndPoint, pointField &edgePoint) const
 Find nearest surface edge (out of selectedEdges) for.
void  nearestSurfEdge (const labelList &selectedEdges, const edgeList &sampleEdges, const labelList &selectedSampleEdges, const pointField &samplePoints, const vector &searchSpan, labelList &edgeLabel, pointField &pointOnEdge, pointField &pointOnFeature) const
 Find nearest surface edge (out of selectedEdges) for each.
void  writeDict (Ostream &) const
 Write as dictionary.
void  write (const fileName &fName) const
 Write as dictionary to file.
void  writeObj (const fileName &prefix) const
 Write to separate OBJ files (region, external, internal edges,.
void  operator= (const surfaceFeatures &)

Member Enumeration Documentation

enum edgeStatus
Enumerator:
NONE 
REGION 
EXTERNAL 
INTERNAL 

Definition at line 73 of file surfaceFeatures.H.


Constructor & Destructor Documentation

surfaceFeatures ( const triSurface &   surf  )

Construct from surface.

Definition at line 344 of file surfaceFeatures.C.

surfaceFeatures ( const triSurface &   surf,
const labelList &   featurePoints,
const labelList &   featureEdges,
const label   externalStart,
const label   internalStart  
)

Construct from components.

Definition at line 356 of file surfaceFeatures.C.

surfaceFeatures ( const triSurface &   surf,
const scalar   includedAngle,
const scalar   minLen = 0,
const label   minElems = 0  
)

Construct from surface, angle and min cumulative length and/or.

number of elements

Definition at line 374 of file surfaceFeatures.C.

surfaceFeatures ( const triSurface &   surf,
const dictionary &   dict  
)

Construct from dictionary.

Definition at line 398 of file surfaceFeatures.C.

surfaceFeatures ( const triSurface &   surf,
const fileName &   fName  
)

Construct from file.

Definition at line 413 of file surfaceFeatures.C.

References dictionary::lookup().

surfaceFeatures ( const surfaceFeatures &   sf  )

Construct as copy.

Definition at line 436 of file surfaceFeatures.C.


Member Function Documentation

ClassName ( "surfaceFeatures"    )
const triSurface& surface (  ) const [inline]

Definition at line 197 of file surfaceFeatures.H.

Referenced by surfaceFeatures::operator=().

const labelList& featurePoints (  ) const [inline]

Return feature point list.

Definition at line 203 of file surfaceFeatures.H.

Referenced by surfaceFeatures::operator=().

const labelList& featureEdges (  ) const [inline]

Return feature edge list.

Definition at line 209 of file surfaceFeatures.H.

Referenced by surfaceFeatures::operator=().

label externalStart (  ) const [inline]

start of external edges

Definition at line 215 of file surfaceFeatures.H.

Referenced by surfaceFeatures::operator=().

label internalStart (  ) const [inline]

start of internal edges

Definition at line 221 of file surfaceFeatures.H.

Referenced by surfaceFeatures::operator=().

label nRegionEdges (  ) const [inline]

Return number of region edges.

Definition at line 227 of file surfaceFeatures.H.

label nExternalEdges (  ) const [inline]

Return number of external edges.

Definition at line 233 of file surfaceFeatures.H.

label nInternalEdges (  ) const [inline]

Return number of internal edges.

Definition at line 239 of file surfaceFeatures.H.

References List< T >::size().

Foam::labelList selectFeatureEdges ( const bool   regionEdges,
const bool   externalEdges,
const bool   internalEdges  
) const
void findFeatures ( const scalar   includedAngle  )

Find feature edges using provided included angle.

Definition at line 491 of file surfaceFeatures.C.

References Vector< Cmpt >::centre(), Foam::cos(), forAll, Foam::mathematicalConstant::pi(), points, and List< T >::size().

void trimFeatures ( const scalar   minLen,
const label   minElems  
)

Delete small sets of edges. Edges are stringed up and any.

string of length < minLen (or nElems < minElems) is deleted.

Definition at line 556 of file surfaceFeatures.C.

References forAll, and List< T >::size().

From member feature edges to status per edge.

Definition at line 88 of file surfaceFeatures.C.

void setFromStatus ( const List< edgeStatus > &   edgeStat  )

Set from status per edge.

Definition at line 116 of file surfaceFeatures.C.

References forAll.

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

Find nearest sample for selected surface points (usually the.

set of featurePoints). Return map from index in samples to surface point. Do not include points that are further than maxDist away (separate maxDist for every sample)

Definition at line 758 of file surfaceFeatures.C.

References Foam::abort(), HashTable< T, Key, Hash >::begin(), Foam::endl(), Foam::FatalError, FatalErrorIn, octree< Type >::findNearest(), forAll, Foam::magSqr(), octree< Type >::octreeBb(), Foam::Pout, List< T >::size(), Foam::sqr(), and Foam::meshTools::writeOBJ().

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

Find nearest sample for regularly sampled points along the.

selected (surface) edges. Return map from sample to edge. maxDist is distance below which gets snapped. Edge gets sampled at points sampleDist[sampleI] apart. (with a maximum of 10 samples per edge)

Definition at line 855 of file surfaceFeatures.C.

References HashTable< T, Key, Hash >::begin(), Foam::endl(), Foam::exit(), octree< Type >::findNearest(), forAll, edge::line(), Foam::mag(), Foam::max(), line< Point, PointRef >::nearestDist(), Foam::Pout, List< T >::size(), edge::start(), edge::vec(), 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 &   maxDist,
const scalar   minSampleDist = 0.1  
) const

Like nearestSamples but now gets nearest point on.

sample-edge instead of nearest sample-point itself. Return map from sample edge to feature edge.

Definition at line 998 of file surfaceFeatures.C.

References edge::centre(), octreeDataEdges::edgeLabels(), Foam::endl(), Foam::exit(), octree< Type >::findNearest(), forAll, Foam::mag(), Foam::max(), Foam::Pout, octree< Type >::shapes(), List< T >::size(), edge::start(), edge::vec(), and Foam::meshTools::writeOBJ().

void nearestSurfEdge ( const labelList &   selectedEdges,
const pointField &   samples,
const vector &   searchSpan,
labelList &   edgeLabel,
labelList &   edgeEndPoint,
pointField &   edgePoint  
) const

Find nearest surface edge (out of selectedEdges) for.

each sample point. Sets:

  • edgeLabel : label of surface edge.
  • edgePoint : exact position of nearest point on edge.
  • edgeEndPoint : -1, 0, 1 depending on whether edgePoint is on inside/start/end of edge

Definition at line 1157 of file surfaceFeatures.C.

References edge::end(), octree< Type >::findNearest(), forAll, PointIndexHit< Point >::index(), Foam::magSqr(), PointIndexHit< Point >::rawPoint(), List< T >::setSize(), List< T >::size(), and edge::start().

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

Find nearest surface edge (out of selectedEdges) for each.

sample edge. Sets:

  • edgeLabel : label of surface edge.
  • pointOnEdge : exact position of nearest point on edge.
  • pointOnFeature : exact position on sample edge.

Definition at line 1233 of file surfaceFeatures.C.

References line< Point, PointRef >::centre(), octree< Type >::findNearest(), forAll, edge::line(), List< T >::setSize(), and List< T >::size().

void writeDict ( Ostream &   writeFile  ) const

Write as dictionary.

Definition at line 681 of file surfaceFeatures.C.

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

void write ( const fileName &   fName  ) const

Write as dictionary to file.

Definition at line 694 of file surfaceFeatures.C.

void writeObj ( const fileName &   prefix  ) const

Write to separate OBJ files (region, external, internal edges,.

feature points) for visualization

Definition at line 702 of file surfaceFeatures.C.

References Foam::endl(), forAll, OFstream::name(), Foam::Pout, and Foam::meshTools::writeOBJ().


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