triSurfaceTools Class Reference

A collection of tools for triSurface. More...

Public Types

enum  sideType { UNKNOWN, INSIDE, OUTSIDE }
 On which side of surface. More...
 

Public Member Functions

triSurface triangulateFaceCentre (const polyBoundaryMesh &mBesh, const labelHashSet &includePatches, const bool verbose=false)
 Face-centre triangulation of (selected patches of) boundaryMesh. More...
 
scalarField featureProximity (const triSurface &surf, const scalar searchDistance)
 Calculate feature proximity. More...
 

Static Public Member Functions

static void writeOBJ (const fileName &fName, const pointField &pts)
 Write pointField to OBJ format file. More...
 
static void writeOBJ (const triSurface &surf, const fileName &fName, const boolList &markedVerts)
 Write vertex subset to OBJ format file. More...
 
static void getVertexTriangles (const triSurface &surf, const label edgeI, labelList &edgeTris)
 Get all triangles using edge endpoint. More...
 
static labelList getVertexVertices (const triSurface &surf, const edge &e)
 Get all vertices (local numbering) connected to vertices of edge. More...
 
static label otherFace (const triSurface &surf, const label facei, const label edgeI)
 Get face connected to edge not facei. More...
 
static void otherEdges (const triSurface &surf, const label facei, const label edgeI, label &e1, label &e2)
 Get the two edges on facei counterclockwise after edgeI. More...
 
static void otherVertices (const triSurface &surf, const label facei, const label vertI, label &vert1I, label &vert2I)
 Get the two vertices (local numbering) on facei counterclockwise. More...
 
static label oppositeEdge (const triSurface &surf, const label facei, const label vertI)
 Get edge opposite vertex (local numbering) More...
 
static label oppositeVertex (const triSurface &surf, const label facei, const label edgeI)
 Get vertex (local numbering) opposite edge. More...
 
static label getEdge (const triSurface &surf, const label vert1I, const label vert2I)
 Returns edge label connecting v1, v2 (local numbering) More...
 
static label getTriangle (const triSurface &surf, const label e0I, const label e1I, const label e2I)
 Return index of triangle (or -1) using all three edges. More...
 
static triSurface collapseEdges (const triSurface &surf, const labelList &collapsableEdges)
 Create new triSurface by collapsing edges to edge mids. More...
 
static triSurface collapseEdges (const triSurface &surf, const labelList &collapsableEdges, const pointField &edgeMids, labelList &faceStatus)
 Create new triSurface by collapsing edges to specified. More...
 
static triSurface greenRefine (const triSurface &surf, const labelList &refineEdges)
 Refine edges by splitting to opposite vertex. More...
 
static triSurface redGreenRefine (const triSurface &surf, const labelList &refineFaces)
 Refine face by splitting all edges. Neighbouring face is. More...
 
static label minEdge (const triSurface &surf, const labelList &edgeIndices)
 Returns element in edgeIndices with minimum length. More...
 
static label maxEdge (const triSurface &surf, const labelList &edgeIndices)
 Returns element in edgeIndices with minimum length. More...
 
static triSurface mergePoints (const triSurface &surf, const scalar mergeTol)
 Merge points within distance. More...
 
static vector surfaceNormal (const triSurface &surf, const label nearestFacei, const point &nearestPt)
 Triangle (unit) normal. If nearest point to triangle on edge use. More...
 
static sideType edgeSide (const triSurface &surf, const point &sample, const point &nearestPoint, const label edgeI)
 If nearest point is on edgeI, determine on which side of surface. More...
 
static sideType surfaceSide (const triSurface &surf, const point &sample, const label nearestFacei)
 Given nearest point (to sample) on surface determines which side. More...
 
static triSurface triangulate (const polyBoundaryMesh &mBesh, const labelHashSet &includePatches, labelList &faceMap, const bool verbose=false)
 Simple triangulation of (selected patches of) boundaryMesh. Needs. More...
 
static triSurface triangulate (const polyBoundaryMesh &bMesh, const labelHashSet &includePatches, const boundBox &bBox, const bool verbose=false)
 
static triSurface delaunay2D (const List< vector2D > &)
 Do unconstrained Delaunay of points. Returns triSurface with 3D. More...
 
static void calcInterpolationWeights (const triPointRef &tri, const point &p, FixedList< scalar, 3 > &weights)
 Calculate linear interpolation weights for point (guaranteed to be. More...
 
static void calcInterpolationWeights (const triSurface &s, const pointField &samplePts, List< FixedList< label, 3 >> &allVerts, List< FixedList< scalar, 3 >> &allWeights)
 
static scalar vertexNormalWeight (const triFace &f, const label pI, const vector &fN, const UList< point > &points)
 Weighting for normals of faces attached to vertex. More...
 
static tmp< vectorFieldvertexNormals (const triSurface &surf)
 Weighted average of normals of attached faces. More...
 
static tmp< triadFieldvertexTriads (const triSurface &surf, const vectorField &pointNormals)
 Local coordinate-system for each point normal. More...
 
static tmp< scalarFieldcurvatures (const triSurface &surf, const vectorField &pointNormals, const triadField &pointTriads)
 Surface curvatures at the vertex points. More...
 
static tmp< scalarFieldcurvatures (const triSurface &surf)
 Surface curvatures at the vertex points. More...
 
static tmp< scalarFieldwriteCurvature (const Time &runTime, const word &basename, const triSurface &surf)
 Write surface curvature at the vertex points and return the field. More...
 
static Pair< tmp< scalarField > > writeCloseness (const Time &runTime, const word &basename, const triSurface &surf, const scalar internalAngleTolerance=45, const scalar externalAngleTolerance=10)
 Check and write internal/external closeness fields. More...
 
static void writeFeatureProximity (const Time &runTime, const word &basename, const triSurface &surf, const bool writeVTK, const scalar searchDistance)
 Check and write internal/external closeness fields. More...
 
static bool validTri (const triSurface &, const label facei, const bool verbose=true)
 Check single triangle for (topological) validity. More...
 
static bool validTri (const MeshedSurface< face > &, const label facei, const bool verbose=true)
 Check single triangle for (topological) validity. More...
 
static surfaceLocation classify (const triSurface &, const label triI, const point &trianglePoint)
 Test point on plane of triangle to see if on edge or point or inside. More...
 
static surfaceLocation trackToEdge (const triSurface &, const surfaceLocation &start, const surfaceLocation &end, const plane &cutPlane)
 Track on surface to get closer to point. More...
 
static void track (const triSurface &, const surfaceLocation &endInfo, const plane &cutPlane, surfaceLocation &hitInfo)
 Track from edge to edge across surface. Uses trackToEdge. More...
 

Static Public Attributes

static const label ANYEDGE = -1
 Face collapse status. More...
 
static const label NOEDGE = -2
 
static const label COLLAPSED = -3
 

Detailed Description

A collection of tools for triSurface.

Note
The curvature calculation is an implementation of the algorithm from:
    "Estimating Curvatures and their Derivatives on Triangle Meshes"
    by S. Rusinkiewicz
    3DPVT'04 Proceedings of the 3D Data Processing,
    Visualization, and Transmission, 2nd International Symposium
    Pages 486-493
    http://gfx.cs.princeton.edu/pubs/_2004_ECA/curvpaper.pdf
Source files

Definition at line 86 of file triSurfaceTools.H.

Member Enumeration Documentation

◆ sideType

enum sideType

On which side of surface.

Enumerator
UNKNOWN 
INSIDE 
OUTSIDE 

Definition at line 450 of file triSurfaceTools.H.

Member Function Documentation

◆ writeOBJ() [1/2]

void writeOBJ ( const fileName fName,
const pointField pts 
)
static

Write pointField to OBJ format file.

Definition at line 1202 of file triSurfaceTools.C.

References Foam::endl(), and Foam::Pout.

Here is the call graph for this function:

◆ writeOBJ() [2/2]

void writeOBJ ( const triSurface surf,
const fileName fName,
const boolList markedVerts 
)
static

Write vertex subset to OBJ format file.

Definition at line 1219 of file triSurfaceTools.C.

References Foam::endl(), forAll, PrimitivePatch< FaceList, PointField >::localPoints(), Foam::Pout, Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

Here is the call graph for this function:

◆ getVertexTriangles()

void getVertexTriangles ( const triSurface surf,
const label  edgeI,
labelList edgeTris 
)
static

Get all triangles using edge endpoint.

Definition at line 1249 of file triSurfaceTools.C.

References Foam::constant::electromagnetic::e, PrimitivePatch< FaceList, PointField >::edgeFaces(), PrimitivePatch< FaceList, PointField >::edges(), PrimitivePatch< FaceList, PointField >::pointFaces(), and List< T >::setSize().

Here is the call graph for this function:

◆ getVertexVertices()

Foam::labelList getVertexVertices ( const triSurface surf,
const edge e 
)
static

Get all vertices (local numbering) connected to vertices of edge.

Definition at line 1290 of file triSurfaceTools.C.

References Foam::constant::electromagnetic::e, PrimitivePatch< FaceList, PointField >::edges(), HashSet< Key, Hash >::insert(), and PrimitivePatch< FaceList, PointField >::pointEdges().

Here is the call graph for this function:

◆ otherFace()

Foam::label otherFace ( const triSurface surf,
const label  facei,
const label  edgeI 
)
static

Get face connected to edge not facei.

Definition at line 1321 of file triSurfaceTools.C.

References PrimitivePatch< FaceList, PointField >::edgeFaces().

Here is the call graph for this function:

◆ otherEdges()

void otherEdges ( const triSurface surf,
const label  facei,
const label  edgeI,
label &  e1,
label &  e2 
)
static

Get the two edges on facei counterclockwise after edgeI.

Definition at line 1346 of file triSurfaceTools.C.

References Foam::abort(), PrimitivePatch< FaceList, PointField >::edges(), PrimitivePatch< FaceList, PointField >::faceEdges(), Foam::FatalError, FatalErrorInFunction, and PrimitivePatch< FaceList, PointField >::localFaces().

Here is the call graph for this function:

◆ otherVertices()

void otherVertices ( const triSurface surf,
const label  facei,
const label  vertI,
label &  vert1I,
label &  vert2I 
)
static

Get the two vertices (local numbering) on facei counterclockwise.

vertI

Definition at line 1375 of file triSurfaceTools.C.

References Foam::abort(), f(), Foam::FatalError, FatalErrorInFunction, PrimitivePatch< FaceList, PointField >::localFaces(), and Foam::nl.

Here is the call graph for this function:

◆ oppositeEdge()

Foam::label oppositeEdge ( const triSurface surf,
const label  facei,
const label  vertI 
)
static

Get edge opposite vertex (local numbering)

Definition at line 1411 of file triSurfaceTools.C.

References Foam::abort(), Foam::constant::electromagnetic::e, PrimitivePatch< FaceList, PointField >::edges(), PrimitivePatch< FaceList, PointField >::faceEdges(), Foam::FatalError, FatalErrorInFunction, and Foam::nl.

Here is the call graph for this function:

◆ oppositeVertex()

Foam::label oppositeVertex ( const triSurface surf,
const label  facei,
const label  edgeI 
)
static

Get vertex (local numbering) opposite edge.

Definition at line 1440 of file triSurfaceTools.C.

References Foam::abort(), Foam::constant::electromagnetic::e, PrimitivePatch< FaceList, PointField >::edges(), f(), Foam::FatalError, FatalErrorInFunction, and PrimitivePatch< FaceList, PointField >::localFaces().

Here is the call graph for this function:

◆ getEdge()

Foam::label getEdge ( const triSurface surf,
const label  vert1I,
const label  vert2I 
)
static

Returns edge label connecting v1, v2 (local numbering)

Definition at line 1467 of file triSurfaceTools.C.

References Foam::constant::electromagnetic::e, PrimitivePatch< FaceList, PointField >::edges(), and PrimitivePatch< FaceList, PointField >::pointEdges().

Here is the call graph for this function:

◆ getTriangle()

Foam::label getTriangle ( const triSurface surf,
const label  e0I,
const label  e1I,
const label  e2I 
)
static

Return index of triangle (or -1) using all three edges.

Definition at line 1490 of file triSurfaceTools.C.

References Foam::abort(), PrimitivePatch< FaceList, PointField >::edgeFaces(), PrimitivePatch< FaceList, PointField >::faceEdges(), Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

◆ collapseEdges() [1/2]

Foam::triSurface collapseEdges ( const triSurface surf,
const labelList collapsableEdges 
)
static

Create new triSurface by collapsing edges to edge mids.

Definition at line 1535 of file triSurfaceTools.C.

References Foam::constant::electromagnetic::e, PrimitivePatch< FaceList, PointField >::edges(), forAll, PrimitivePatch< FaceList, PointField >::localPoints(), and PrimitivePatch< FaceList, PointField >::nEdges().

Here is the call graph for this function:

◆ collapseEdges() [2/2]

Foam::triSurface collapseEdges ( const triSurface surf,
const labelList collapsableEdges,
const pointField edgeMids,
labelList faceStatus 
)
static

Create new triSurface by collapsing edges to specified.

positions. faceStatus allows explicit control over which faces need to be protected (see above). faceStatus gets updated to protect collapsing already collapsed faces.

Definition at line 1582 of file triSurfaceTools.C.

References Foam::abort(), Foam::constant::physicoChemical::b, Foam::constant::universal::c, Foam::constant::electromagnetic::e, PrimitivePatch< FaceList, PointField >::edgeFaces(), PrimitivePatch< FaceList, PointField >::edges(), Foam::endl(), f(), Foam::FatalError, FatalErrorInFunction, forAll, PrimitivePatch< FaceList, PointField >::localFaces(), PrimitivePatch< FaceList, PointField >::localPoints(), Foam::min(), PrimitivePatch< FaceList, PointField >::nEdges(), triSurface::patches(), and FixedList< T, N >::setSize().

Here is the call graph for this function:

◆ greenRefine()

Foam::triSurface greenRefine ( const triSurface surf,
const labelList refineEdges 
)
static

◆ redGreenRefine()

Foam::triSurface redGreenRefine ( const triSurface surf,
const labelList refineFaces 
)
static

Refine face by splitting all edges. Neighbouring face is.

greenRefine'd.

Definition at line 1742 of file triSurfaceTools.C.

References forAll.

◆ minEdge()

Foam::label minEdge ( const triSurface surf,
const labelList edgeIndices 
)
static

Returns element in edgeIndices with minimum length.

Definition at line 1844 of file triSurfaceTools.C.

References Foam::constant::electromagnetic::e, PrimitivePatch< FaceList, PointField >::edges(), and PrimitivePatch< FaceList, PointField >::localPoints().

Here is the call graph for this function:

◆ maxEdge()

Foam::label maxEdge ( const triSurface surf,
const labelList edgeIndices 
)
static

Returns element in edgeIndices with minimum length.

Definition at line 1871 of file triSurfaceTools.C.

References Foam::constant::electromagnetic::e, PrimitivePatch< FaceList, PointField >::edges(), and PrimitivePatch< FaceList, PointField >::localPoints().

Here is the call graph for this function:

◆ mergePoints()

Foam::triSurface mergePoints ( const triSurface surf,
const scalar  mergeTol 
)
static

Merge points within distance.

Definition at line 1898 of file triSurfaceTools.C.

References f(), forAll, PrimitivePatch< FaceList, PointField >::localFaces(), PrimitivePatch< FaceList, PointField >::localPoints(), Foam::mergePoints(), PrimitivePatch< FaceList, PointField >::nPoints(), triSurface::patches(), and FixedList< T, N >::setSize().

Here is the call graph for this function:

◆ surfaceNormal()

Foam::vector surfaceNormal ( const triSurface surf,
const label  nearestFacei,
const point nearestPt 
)
static

Triangle (unit) normal. If nearest point to triangle on edge use.

edge normal (calculated on the fly); if on vertex use vertex normal. Uses planarTol.

Definition at line 1955 of file triSurfaceTools.C.

References triangle< Point, PointRef >::EDGE, PrimitivePatch< FaceList, PointField >::edgeFaces(), f(), PrimitivePatch< FaceList, PointField >::faceEdges(), PrimitivePatch< FaceList, PointField >::faceNormals(), PrimitivePatch< FaceList, PointField >::localFaces(), triangle< Point, PointRef >::NONE, Foam::normalised(), PrimitivePatch< FaceList, PointField >::pointNormals(), points, PrimitivePatch< FaceList, PointField >::points(), and Foam::Zero.

Here is the call graph for this function:

◆ edgeSide()

Foam::triSurfaceTools::sideType edgeSide ( const triSurface surf,
const point sample,
const point nearestPoint,
const label  edgeI 
)
static

If nearest point is on edgeI, determine on which side of surface.

sample is.

Definition at line 1999 of file triSurfaceTools.C.

References PrimitivePatch< FaceList, PointField >::edgeFaces(), faceNormals(), PrimitivePatch< FaceList, PointField >::faceNormals(), and n.

Here is the call graph for this function:

◆ surfaceSide()

Foam::triSurfaceTools::sideType surfaceSide ( const triSurface surf,
const point sample,
const label  nearestFacei 
)
static

◆ triangulate() [1/2]

Foam::triSurface triangulate ( const polyBoundaryMesh mBesh,
const labelHashSet includePatches,
labelList faceMap,
const bool  verbose = false 
)
static

Simple triangulation of (selected patches of) boundaryMesh. Needs.

polyMesh (or polyBoundaryMesh) since only at this level are the triangles on neighbouring patches connected. Return faceMap from triI to faceI

Definition at line 2192 of file triSurfaceTools.C.

References Foam::endl(), f(), Foam::faceMap(), mesh, Foam::foamVersion::patch, triSurface::patches(), points, polyMesh::points(), Foam::Pout, and List< T >::setSize().

Here is the call graph for this function:

◆ triangulate() [2/2]

Foam::triSurface triangulate ( const polyBoundaryMesh bMesh,
const labelHashSet includePatches,
const boundBox bBox,
const bool  verbose = false 
)
static

Definition at line 2290 of file triSurfaceTools.C.

References List< T >::append(), boundBox::containsAny(), Foam::endl(), f(), forAll, mesh, primitiveMesh::nBoundaryFaces(), Foam::foamVersion::patch, triSurface::patches(), points, polyMesh::points(), Foam::Pout, List< T >::setSize(), and DynamicList< T, SizeMin >::shrink().

Here is the call graph for this function:

◆ triangulateFaceCentre()

Foam::triSurface triangulateFaceCentre ( const polyBoundaryMesh mBesh,
const labelHashSet includePatches,
const bool  verbose = false 
)

Face-centre triangulation of (selected patches of) boundaryMesh.

Needs polyMesh (or polyBoundaryMesh) since only at this level are the triangles on neighbouring patches connected.

Definition at line 2376 of file triSurfaceTools.C.

References List< T >::append(), Foam::endl(), f(), primitiveMesh::faceCentres(), forAll, PrimitivePatch< FaceList, PointField >::localFaces(), PrimitivePatch< FaceList, PointField >::localPoints(), mesh, primitiveMesh::nBoundaryFaces(), newPointi, Foam::foamVersion::patch, triSurface::patches(), points, polyMesh::points(), Foam::Pout, List< T >::setSize(), and DynamicList< T, SizeMin >::shrink().

Here is the call graph for this function:

◆ delaunay2D()

Foam::triSurface delaunay2D ( const List< vector2D > &  pts)
static

Do unconstrained Delaunay of points. Returns triSurface with 3D.

points with z=0. All triangles in region 0.

Definition at line 2472 of file triSurfaceTools.C.

References Foam::abort(), dtris2(), Foam::FatalError, FatalErrorInFunction, forAll, and points.

Here is the call graph for this function:

◆ calcInterpolationWeights() [1/2]

void calcInterpolationWeights ( const triPointRef tri,
const point p,
FixedList< scalar, 3 > &  weights 
)
static

Calculate linear interpolation weights for point (guaranteed to be.

inside triangle)

Definition at line 2538 of file triSurfaceTools.C.

References triangle< Point, PointRef >::a(), triangle< Point, PointRef >::b(), triangle< Point, PointRef >::c(), Foam::max(), Foam::normalised(), and p.

Here is the call graph for this function:

◆ calcInterpolationWeights() [2/2]

void calcInterpolationWeights ( const triSurface s,
const pointField samplePts,
List< FixedList< label, 3 >> &  allVerts,
List< FixedList< scalar, 3 >> &  allWeights 
)
static

Definition at line 2569 of file triSurfaceTools.C.

References PointHit< PointType >::distance(), triangle< Point, PointRef >::EDGE, f(), forAll, PointHit< PointType >::hit(), Foam::mag(), Foam::max(), Foam::min(), triangle< Point, PointRef >::nearestPointClassify(), p0, triangle< Point, PointRef >::POINT, points, PointHit< PointType >::rawPoint(), and s.

Here is the call graph for this function:

◆ vertexNormalWeight()

Foam::scalar vertexNormalWeight ( const triFace f,
const label  pI,
const vector fN,
const UList< point > &  points 
)
static

Weighting for normals of faces attached to vertex.

Definition at line 43 of file triSurfaceCurvature.C.

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

Referenced by triSurfaceTools::curvatures(), and triSurfaceTools::vertexNormals().

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

◆ vertexNormals()

Foam::tmp< Foam::vectorField > vertexNormals ( const triSurface surf)
static

Weighted average of normals of attached faces.

Definition at line 66 of file triSurfaceCurvature.C.

References Foam::endl(), f(), forAll, Foam::Info, PrimitivePatch< FaceList, PointField >::meshPoints(), tmp< T >::New(), PrimitivePatch< FaceList, PointField >::nPoints(), pFaces, PrimitivePatch< FaceList, PointField >::pointFaces(), points, PrimitivePatch< FaceList, PointField >::points(), triSurfaceTools::vertexNormalWeight(), and Foam::Zero.

Referenced by triSurfaceTools::curvatures().

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

◆ vertexTriads()

Foam::tmp< Foam::triadField > vertexTriads ( const triSurface surf,
const vectorField pointNormals 
)
static

Local coordinate-system for each point normal.

Definition at line 110 of file triSurfaceCurvature.C.

References Foam::constant::electromagnetic::e, forAll, Foam::mag(), PrimitivePatch< FaceList, PointField >::meshPointMap(), tmp< T >::New(), Foam::normalised(), p, points, PrimitivePatch< FaceList, PointField >::points(), and triad::unset.

Referenced by triSurfaceTools::curvatures().

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

◆ curvatures() [1/2]

Foam::tmp< Foam::scalarField > curvatures ( const triSurface surf,
const vectorField pointNormals,
const triadField pointTriads 
)
static

Surface curvatures at the vertex points.

Definition at line 147 of file triSurfaceCurvature.C.

References Foam::constant::electromagnetic::e, Foam::eigenValues(), Foam::endl(), f(), forAll, Foam::Info, Foam::LUsolve(), Foam::mag(), Foam::magSqr(), Foam::max(), PrimitivePatch< FaceList, PointField >::meshPointMap(), PrimitivePatch< FaceList, PointField >::meshPoints(), tmp< T >::New(), triad::normalize(), points, PrimitivePatch< FaceList, PointField >::points(), Foam::rotationTensor(), triad::set(), Foam::sqr(), Foam::T(), triSurfaceTools::vertexNormalWeight(), x, Tensor2D< Cmpt >::x(), y, Tensor2D< Cmpt >::y(), VectorSpace< SymmTensor2D< Cmpt >, Cmpt, 3 >::zero, and Foam::Zero.

Referenced by triSurfaceTools::writeCurvature().

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

◆ curvatures() [2/2]

Foam::tmp< Foam::scalarField > curvatures ( const triSurface surf)
static

Surface curvatures at the vertex points.

Definition at line 332 of file triSurfaceCurvature.C.

References tmp< T >::clear(), triSurfaceTools::vertexNormals(), and triSurfaceTools::vertexTriads().

Here is the call graph for this function:

◆ writeCurvature()

Foam::tmp< Foam::scalarField > writeCurvature ( const Time runTime,
const word basename,
const triSurface surf 
)
static

Write surface curvature at the vertex points and return the field.

Definition at line 349 of file triSurfaceCurvature.C.

References TimePaths::constant(), triSurfaceTools::curvatures(), Foam::dimLength, Foam::endl(), Foam::Info, IOobject::NO_READ, IOobject::NO_WRITE, tmp< T >::ref(), and runTime.

Here is the call graph for this function:

◆ writeCloseness()

Foam::Pair< Foam::tmp< Foam::scalarField > > writeCloseness ( const Time runTime,
const word basename,
const triSurface surf,
const scalar  internalAngleTolerance = 45,
const scalar  externalAngleTolerance = 10 
)
static

Check and write internal/external closeness fields.

Definition at line 96 of file triSurfaceCloseness.C.

References searchableSurface::bounds(), Foam::cos(), Foam::degToRad(), Foam::dimLength, Foam::drawHitProblem(), stdFoam::end(), Foam::endl(), PrimitivePatch< FaceList, PointField >::faceCentres(), PrimitivePatch< FaceList, PointField >::faceNormals(), triSurfaceMesh::findLineAll(), forAll, Foam::Info, boundBox::mag(), Foam::mag(), Foam::nl, and runTime.

Here is the call graph for this function:

◆ featureProximity()

scalarField featureProximity ( const triSurface surf,
const scalar  searchDistance 
)

Calculate feature proximity.

◆ writeFeatureProximity()

static void writeFeatureProximity ( const Time runTime,
const word basename,
const triSurface surf,
const bool  writeVTK,
const scalar  searchDistance 
)
static

Check and write internal/external closeness fields.

◆ validTri() [1/2]

bool validTri ( const triSurface surf,
const label  facei,
const bool  verbose = true 
)
static

Check single triangle for (topological) validity.

Definition at line 2696 of file triSurfaceTools.C.

References Foam::endl(), f(), PrimitivePatch< FaceList, PointField >::faceFaces(), PrimitivePatch< FaceList, PointField >::points(), and WarningInFunction.

Referenced by isoSurfaceCell::isoSurfaceCell(), and isoSurfacePoint::isoSurfacePoint().

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

◆ validTri() [2/2]

bool validTri ( const MeshedSurface< face > &  surf,
const label  facei,
const bool  verbose = true 
)
static

Check single triangle for (topological) validity.

Definition at line 2775 of file triSurfaceTools.C.

References Foam::endl(), f(), MeshedSurface< Face >::size(), and WarningInFunction.

Here is the call graph for this function:

◆ classify()

Foam::surfaceLocation classify ( const triSurface s,
const label  triI,
const point trianglePoint 
)
static

Test point on plane of triangle to see if on edge or point or inside.

Definition at line 2869 of file triSurfaceTools.C.

References triangle< Point, PointRef >::EDGE, surfaceLocation::elementType(), triangle< Point, PointRef >::NONE, triangle< Point, PointRef >::POINT, s, PointIndexHit< PointType >::setHit(), PointIndexHit< PointType >::setIndex(), PointIndexHit< PointType >::setMiss(), and PointIndexHit< PointType >::setPoint().

Here is the call graph for this function:

◆ trackToEdge()

Foam::surfaceLocation trackToEdge ( const triSurface s,
const surfaceLocation start,
const surfaceLocation end,
const plane cutPlane 
)
static

Track on surface to get closer to point.

Possible situations:

  • 1. reached endpoint
  • 2. reached edge (normal situation)
  • 3. reached end of surface (edge on single face) Input:
  • starting position+triangle/edge/point (so has to be on surface!)
  • (optional) previous position+triangle/edge/point to prevent going back. Set index (of triangle/edge/point) to -1 if not used.
  • end position+triangle/edge/point (so has to be on surface!)
  • plane to follow. Has to go through end point! Returns:
  • true if end point reached (situation 1)
  • new position+triangle/edge/point Caller has to check for situation 3 by checking that triangle() is not set.

Definition at line 2913 of file triSurfaceTools.C.

References triangle< Point, PointRef >::EDGE, surfaceLocation::elementType(), stdFoam::end(), PointIndexHit< PointType >::hit(), PointIndexHit< PointType >::index(), triangle< Point, PointRef >::NONE, pFaces, PointIndexHit< PointType >::rawPoint(), s, PointIndexHit< PointType >::setMiss(), and surfaceLocation::triangle().

Here is the call graph for this function:

◆ track()

void track ( const triSurface s,
const surfaceLocation endInfo,
const plane cutPlane,
surfaceLocation hitInfo 
)
static

Track from edge to edge across surface. Uses trackToEdge.

Not really useful by itself, more example of how to use trackToEdge. endInfo should be location on surface. hitInfo should be initialised to starting location (on surface as well). Upon return is set to end location.

Definition at line 2991 of file triSurfaceTools.C.

References PointIndexHit< PointType >::hit(), s, and surfaceLocation::triangle().

Here is the call graph for this function:

Member Data Documentation

◆ ANYEDGE

const Foam::label ANYEDGE = -1
static

Face collapse status.

anyEdge: any edge can be collapsed noEdge: no edge can be collapsed collapsed: already collapsed >0: edge label that can be collapsed

Definition at line 380 of file triSurfaceTools.H.

◆ NOEDGE

const Foam::label NOEDGE = -2
static

Definition at line 381 of file triSurfaceTools.H.

◆ COLLAPSED

const Foam::label COLLAPSED = -3
static

Definition at line 382 of file triSurfaceTools.H.


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