Extracts and writes surface features to file. All but the basic feature extraction is WIP. More...
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[]) |
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.
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().
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().
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().
vectorField calcVertexNormals | ( | const triSurface & | surf | ) |
Definition at line 189 of file surfaceFeatureExtract.C.
References calcVertexNormalWeight(), Foam::endl(), f(), forAll, Foam::Info, Foam::mag(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), PrimitivePatch< Face, FaceList, PointField, PointType >::nPoints(), pFaces, PrimitivePatch< Face, FaceList, PointField, PointType >::pointFaces(), points, PrimitivePatch< Face, FaceList, PointField, PointType >::points(), and Vector< scalar >::zero.
Referenced by main().
triSurfacePointScalarField calcCurvature | ( | const word & | name, |
const Time & | runTime, | ||
const triSurface & | surf, | ||
const vectorField & | pointNormals, | ||
const triadField & | pointCoordSys | ||
) |
Definition at line 232 of file surfaceFeatureExtract.C.
References calcVertexNormalWeight(), TimePaths::constant(), Foam::dimLength, Foam::e, Foam::eigenValues(), Foam::endl(), f(), forAll, Foam::Info, Foam::LUsolve(), Foam::mag(), Foam::magSqr(), Foam::max(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPointMap(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), Foam::name(), IOobject::NO_READ, IOobject::NO_WRITE, triad::normalize(), points, PrimitivePatch< Face, FaceList, PointField, PointType >::points(), Foam::rotationTensor(), triad::set(), List::size(), Foam::sqr(), Foam::T(), x, Tensor2D< Cmpt >::x(), y, Tensor2D< Cmpt >::y(), SymmTensor2D< Cmpt >::zero, and Vector< scalar >::zero.
Referenced by main().
Definition at line 430 of file surfaceFeatureExtract.C.
References edge::end(), and edge::start().
Referenced by calcProximityOfFeatureEdges().
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().
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().
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().
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().
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().
void deleteEdges | ( | const triSurface & | surf, |
const plane & | cutPlane, | ||
List< surfaceFeatures::edgeStatus > & | edgeStat | ||
) |
Definition at line 607 of file surfaceFeatureExtract.C.
References Foam::e, PrimitivePatch< Face, FaceList, PointField, PointType >::edges(), forAll, intersect(), plane::lineIntersect(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), surfaceFeatures::NONE, onLine(), points, and PrimitivePatch< Face, FaceList, PointField, PointType >::points().
Referenced by main().
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().
void unmarkBaffles | ( | const triSurface & | surf, |
const scalar | includedAngle, | ||
List< surfaceFeatures::edgeStatus > & | edgeStat | ||
) |
Definition at line 685 of file surfaceFeatureExtract.C.
References Foam::cos(), Foam::degToRad(), PrimitivePatch< Face, FaceList, PointField, PointType >::edgeFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::faceNormals(), forAll, Foam::mag(), n, surfaceFeatures::NONE, and List::size().
surfaceFeatures::edgeStatus checkFlatRegionEdge | ( | const triSurface & | surf, |
const scalar | tol, | ||
const scalar | includedAngle, | ||
const label | edgeI | ||
) |
Divide into multiple normal bins.
return REGION if 2 normals that make feature angle
Definition at line 737 of file surfaceFeatureExtract.C.
References DynamicList::append(), Foam::cos(), Foam::degToRad(), Foam::e, triFace::edgeDirection(), PrimitivePatch< Face, FaceList, PointField, PointType >::edgeFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::edges(), Foam::exit(), PrimitivePatch< Face, FaceList, PointField, PointType >::faceNormals(), Foam::FatalError, FatalErrorInFunction, Foam::findIndex(), forAll, PrimitivePatch< Face, FaceList, PointField, PointType >::localFaces(), Foam::mag(), n, surfaceFeatures::NONE, surfaceFeatures::REGION, labelledTri::region(), and List::size().
Referenced by main().
void writeStats | ( | const extendedFeatureEdgeMesh & | fem, |
Ostream & | os | ||
) |
Definition at line 902 of file surfaceFeatureExtract.C.
References extendedEdgeMesh::concaveStart(), edgeMesh::edges(), Foam::endl(), extendedEdgeMesh::flatStart(), extendedEdgeMesh::internalStart(), extendedEdgeMesh::mixedStart(), extendedEdgeMesh::multipleStart(), Foam::nl, extendedEdgeMesh::nonFeatureStart(), extendedEdgeMesh::openStart(), edgeMesh::points(), and List::size().
Referenced by autoSnapDriver::calcNearestSurfaceFeature(), distributedTriSurfaceMesh::distributedTriSurfaceMesh(), autoSnapDriver::featureAttractionUsingFeatureEdges(), and 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().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.