Functions
surfaceFeatureExtract.C File Reference

Extracts and writes surface features to file. All but the basic feature extraction is WIP. More...

Include dependency graph for surfaceFeatureExtract.C:

Go to the source code of this file.

Functions

scalar calcVertexNormalWeight (const triFace &f, const label pI, const vector &fN, const pointField &points)
 
point randomPointInPlane (const plane &p)
 
triadField calcVertexCoordSys (const triSurface &surf, const vectorField &pointNormals)
 
vectorField calcVertexNormals (const triSurface &surf)
 
triSurfacePointScalarField calcCurvature (const word &name, const Time &runTime, const triSurface &surf, const vectorField &pointNormals, const triadField &pointCoordSys)
 
bool edgesConnected (const edge &e1, const edge &e2)
 
scalar calcProximityOfFeaturePoints (const List< pointIndexHit > &hitList, const scalar defaultCellSize)
 
scalar calcProximityOfFeatureEdges (const extendedFeatureEdgeMesh &efem, const List< pointIndexHit > &hitList, const scalar defaultCellSize)
 
void dumpBox (const treeBoundBox &bb, const fileName &fName)
 
void deleteBox (const triSurface &surf, const treeBoundBox &bb, const bool removeInside, List< surfaceFeatures::edgeStatus > &edgeStat)
 
bool onLine (const point &p, const linePointRef &line)
 
void deleteEdges (const triSurface &surf, const plane &cutPlane, List< surfaceFeatures::edgeStatus > &edgeStat)
 
void drawHitProblem (label fI, const triSurface &surf, const pointField &start, const pointField &faceCentres, const pointField &end, const List< pointIndexHit > &hitInfo)
 
void unmarkBaffles (const triSurface &surf, const scalar includedAngle, List< surfaceFeatures::edgeStatus > &edgeStat)
 
surfaceFeatures::edgeStatus checkFlatRegionEdge (const triSurface &surf, const scalar tol, const scalar includedAngle, const label edgeI)
 Divide into multiple normal bins. More...
 
void writeStats (const extendedFeatureEdgeMesh &fem, Ostream &os)
 
int main (int argc, char *argv[])
 

Detailed Description

Extracts and writes surface features to file. All but the basic feature extraction is WIP.

Original source file surfaceFeatureExtract.C

Curvature calculation is an implementation of the algorithm from:

"Estimating Curvatures and their Derivatives on Triangle Meshes" by S. Rusinkiewicz

Definition in file surfaceFeatureExtract.C.

Function Documentation

◆ calcVertexNormalWeight()

scalar calcVertexNormalWeight ( const triFace f,
const label  pI,
const vector fN,
const pointField points 
)

Definition at line 62 of file surfaceFeatureExtract.C.

References Foam::abort(), f(), Foam::FatalError, FatalErrorInFunction, Foam::findIndex(), Foam::mag(), Foam::magSqr(), and points.

Referenced by calcCurvature(), and calcVertexNormals().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ randomPointInPlane()

point randomPointInPlane ( const plane p)

Definition at line 84 of file surfaceFeatureExtract.C.

References Foam::e, Foam::mag(), p, x, Vector< Cmpt >::x(), y, Vector< Cmpt >::y(), and Vector< Cmpt >::z().

Referenced by calcVertexCoordSys().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ calcVertexCoordSys()

triadField calcVertexCoordSys ( const triSurface surf,
const vectorField pointNormals 
)

Definition at line 152 of file surfaceFeatureExtract.C.

References forAll, Foam::mag(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPointMap(), p, points, PrimitivePatch< Face, FaceList, PointField, PointType >::points(), randomPointInPlane(), and triad::unset.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ calcVertexNormals()

vectorField calcVertexNormals ( const triSurface surf)

◆ calcCurvature()

triSurfacePointScalarField calcCurvature ( const word name,
const Time runTime,
const triSurface surf,
const vectorField pointNormals,
const triadField pointCoordSys 
)

◆ edgesConnected()

bool edgesConnected ( const edge e1,
const edge e2 
)

Definition at line 430 of file surfaceFeatureExtract.C.

References edge::end(), and edge::start().

Referenced by calcProximityOfFeatureEdges().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ calcProximityOfFeaturePoints()

scalar calcProximityOfFeaturePoints ( const List< pointIndexHit > &  hitList,
const scalar  defaultCellSize 
)

Definition at line 448 of file surfaceFeatureExtract.C.

References PointIndexHit< Point >::hit(), PointIndexHit< Point >::hitPoint(), Foam::mag(), Foam::min(), and List::size().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ calcProximityOfFeatureEdges()

scalar calcProximityOfFeatureEdges ( const extendedFeatureEdgeMesh efem,
const List< pointIndexHit > &  hitList,
const scalar  defaultCellSize 
)

Definition at line 490 of file surfaceFeatureExtract.C.

References edgeMesh::edges(), edgesConnected(), PointIndexHit< Point >::hit(), PointIndexHit< Point >::hitPoint(), PointIndexHit< Point >::index(), Foam::mag(), Foam::min(), and List::size().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dumpBox()

void dumpBox ( const treeBoundBox bb,
const fileName fName 
)

Definition at line 541 of file surfaceFeatureExtract.C.

References Foam::e, treeBoundBox::edges, Foam::endl(), forAll, Foam::Info, OFstream::name(), Foam::nl, treeBoundBox::points(), and Foam::meshTools::writeOBJ().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deleteBox()

void deleteBox ( const triSurface surf,
const treeBoundBox bb,
const bool  removeInside,
List< surfaceFeatures::edgeStatus > &  edgeStat 
)

Definition at line 567 of file surfaceFeatureExtract.C.

References treeBoundBox::contains(), PrimitivePatch< Face, FaceList, PointField, PointType >::edges(), forAll, PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), and surfaceFeatures::NONE.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onLine()

bool onLine ( const point p,
const linePointRef line 
)

Definition at line 586 of file surfaceFeatureExtract.C.

References Foam::constant::physicoChemical::b, line::end(), Foam::max(), Foam::min(), p, line::start(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

Referenced by deleteEdges().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deleteEdges()

void deleteEdges ( const triSurface surf,
const plane cutPlane,
List< surfaceFeatures::edgeStatus > &  edgeStat 
)

◆ drawHitProblem()

void drawHitProblem ( label  fI,
const triSurface surf,
const pointField start,
const pointField faceCentres,
const pointField end,
const List< pointIndexHit > &  hitInfo 
)

Definition at line 637 of file surfaceFeatureExtract.C.

References Foam::endl(), forAll, Foam::Info, Foam::nl, PrimitivePatch< Face, FaceList, PointField, PointType >::points(), and Foam::meshTools::writeOBJ().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unmarkBaffles()

void unmarkBaffles ( const triSurface surf,
const scalar  includedAngle,
List< surfaceFeatures::edgeStatus > &  edgeStat 
)

◆ checkFlatRegionEdge()

surfaceFeatures::edgeStatus checkFlatRegionEdge ( const triSurface surf,
const scalar  tol,
const scalar  includedAngle,
const label  edgeI 
)

◆ writeStats()

void writeStats ( const extendedFeatureEdgeMesh fem,
Ostream os 
)

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 930 of file surfaceFeatureExtract.C.

References extendedEdgeMesh::add(), argList::addNote(), extendedEdgeMesh::allNearestFeatureEdges(), extendedEdgeMesh::allNearestFeaturePoints(), Switch::asText(), IOobject::AUTO_WRITE, searchableSurface::bounds(), calcCurvature(), calcProximityOfFeatureEdges(), calcProximityOfFeaturePoints(), calcVertexCoordSys(), calcVertexNormals(), checkFlatRegionEdge(), triangle::circumCentre(), triangle::circumRadius(), TimePaths::constant(), TimePaths::constantPath(), Foam::cos(), Foam::degToRad(), deleteBox(), deleteEdges(), dict, dictIO(), dictName(), Foam::dimLength, drawHitProblem(), dumpBox(), Foam::e, PrimitivePatch< Face, FaceList, PointField, PointType >::edgeFaces(), edgeMesh::edges(), clock::elapsedClockTime(), cpuTime::elapsedCpuTime(), Foam::endl(), Foam::exit(), PrimitivePatch< Face, FaceList, PointField, PointType >::faceCentres(), PrimitivePatch< Face, FaceList, PointField, PointType >::faceNormals(), Foam::FatalError, FatalErrorInFunction, surfaceFeatures::featureEdges(), surfaceFeatures::featurePoints(), Foam::findIndex(), triSurfaceMesh::findLineAll(), forAll, forAllConstIter(), dictionary::found(), Foam::Info, dictionary::isDict(), k, fileName::lessExt(), dictionary::lookup(), dictionary::lookupOrAddDefault(), dictionary::lookupOrDefault(), boundBox::mag(), Foam::mag(), Foam::min(), Foam::mkDir(), IOobject::MUST_READ, fileName::name(), Foam::name(), IOobject::name(), surfaceFeatures::nExternalEdges(), surfaceFeatures::nInternalEdges(), Foam::nl, IOobject::NO_READ, IOobject::NO_WRITE, surfaceFeatures::NONE, argList::noParallel(), plane::normal(), surfaceFeatures::nRegionEdges(), IOobject::objectPath(), triSurface::patches(), IOobject::path(), edgeMesh::points(), PrimitivePatch< Face, FaceList, PointField, PointType >::points(), dictionary::readIfPresent(), Foam::readScalar(), plane::refPoint(), surfaceFeatures::REGION, autoPtr::set(), surfaceFeatures::setFromStatus(), List::size(), Foam::sqr(), dictionary::subDict(), objectRegistry::time(), vtkSurfaceWriter::write(), extendedFeatureEdgeMesh::write(), writeObj(), extendedEdgeMesh::writeObj(), triSurface::writeStats(), writeStats(), and Foam::writeVTK().