Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
triSurfaceTools Class Reference

A collection of tools for triSurface. More...

Public Types

enum  sideType { UNKNOWN, INSIDE, OUTSIDE }
 

Public Member Functions

triSurface triangulateFaceCentre (const polyBoundaryMesh &mBesh, const labelHashSet &includePatches, const bool verbose=false)
 
scalarField featureProximity (const triSurface &surf, const scalar searchDistance)
 

Static Public Member Functions

static void writeOBJ (const fileName &fName, const pointField &pts)
 
static void writeOBJ (const triSurface &surf, const fileName &fName, const boolList &markedVerts)
 
static void getVertexTriangles (const triSurface &surf, const label edgeI, labelList &edgeTris)
 
static labelList getVertexVertices (const triSurface &surf, const edge &e)
 
static label otherFace (const triSurface &surf, const label facei, const label edgeI)
 
static void otherEdges (const triSurface &surf, const label facei, const label edgeI, label &e1, label &e2)
 
static void otherVertices (const triSurface &surf, const label facei, const label vertI, label &vert1I, label &vert2I)
 
static label oppositeEdge (const triSurface &surf, const label facei, const label vertI)
 
static label oppositeVertex (const triSurface &surf, const label facei, const label edgeI)
 
static label getEdge (const triSurface &surf, const label vert1I, const label vert2I)
 
static label getTriangle (const triSurface &surf, const label e0I, const label e1I, const label e2I)
 
static triSurface collapseEdges (const triSurface &surf, const labelList &collapsableEdges)
 
static triSurface collapseEdges (const triSurface &surf, const labelList &collapsableEdges, const pointField &edgeMids, labelList &faceStatus)
 
static triSurface greenRefine (const triSurface &surf, const labelList &refineEdges)
 
static triSurface redGreenRefine (const triSurface &surf, const labelList &refineFaces)
 
static label minEdge (const triSurface &surf, const labelList &edgeIndices)
 
static label maxEdge (const triSurface &surf, const labelList &edgeIndices)
 
static triSurface mergePoints (const triSurface &surf, const scalar mergeTol)
 
static vector surfaceNormal (const triSurface &surf, const label nearestFacei, const point &nearestPt)
 
static sideType edgeSide (const triSurface &surf, const point &sample, const point &nearestPoint, const label edgeI)
 
static sideType surfaceSide (const triSurface &surf, const point &sample, const label nearestFacei)
 
static triSurface triangulate (const polyBoundaryMesh &mBesh, const labelHashSet &includePatches, labelList &faceMap, const bool verbose=false)
 
static triSurface triangulate (const polyBoundaryMesh &bMesh, const labelHashSet &includePatches, const boundBox &bBox, const bool verbose=false)
 
static triSurface delaunay2D (const List< vector2D > &)
 
static void calcInterpolationWeights (const triPointRef &tri, const point &p, FixedList< scalar, 3 > &weights)
 
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)
 
static tmp< vectorFieldvertexNormals (const triSurface &surf)
 
static tmp< triadFieldvertexTriads (const triSurface &surf, const vectorField &pointNormals)
 
static tmp< scalarFieldcurvatures (const triSurface &surf, const vectorField &pointNormals, const triadField &pointTriads)
 
static tmp< scalarFieldcurvatures (const triSurface &surf)
 
static tmp< scalarFieldwriteCurvature (const Time &runTime, const word &basename, const triSurface &surf)
 
static Pair< tmp< scalarField > > writeCloseness (const Time &runTime, const word &basename, const triSurface &surf, const scalar internalAngleTolerance=45, const scalar externalAngleTolerance=10)
 
static void writeFeatureProximity (const Time &runTime, const word &basename, const triSurface &surf, const bool writeVTK, const scalar searchDistance)
 
static bool validTri (const triSurface &, const label facei, const bool verbose=true)
 
static bool validTri (const MeshedSurface< face > &, const label facei, const bool verbose=true)
 
static surfaceLocation classify (const triSurface &, const label triI, const point &trianglePoint)
 
static surfaceLocation trackToEdge (const triSurface &, const surfaceLocation &start, const surfaceLocation &end, const plane &cutPlane)
 
static void track (const triSurface &, const surfaceLocation &endInfo, const plane &cutPlane, surfaceLocation &hitInfo)
 

Static Public Attributes

static const label ANYEDGE = -1
 
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 82 of file triSurfaceTools.H.

Member Enumeration Documentation

◆ sideType

enum sideType
Enumerator
UNKNOWN 
INSIDE 
OUTSIDE 

Definition at line 446 of file triSurfaceTools.H.

Member Function Documentation

◆ writeOBJ() [1/2]

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

Definition at line 1195 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

◆ getVertexTriangles()

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

◆ getVertexVertices()

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

◆ otherFace()

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

Definition at line 1314 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

◆ otherVertices()

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

Definition at line 1368 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

◆ oppositeVertex()

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

◆ getEdge()

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

◆ getTriangle()

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

◆ collapseEdges() [1/2]

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

◆ collapseEdges() [2/2]

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

◆ greenRefine()

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

◆ redGreenRefine()

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

Definition at line 1735 of file triSurfaceTools.C.

References forAll.

◆ minEdge()

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

◆ maxEdge()

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

◆ mergePoints()

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

◆ surfaceNormal()

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

◆ edgeSide()

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

Definition at line 1992 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

◆ triangulate() [2/2]

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

◆ triangulateFaceCentre()

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

◆ delaunay2D()

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

Definition at line 2465 of file triSurfaceTools.C.

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

Here is the call graph for this function:

◆ calcInterpolationWeights() [1/2]

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

Definition at line 2531 of file triSurfaceTools.C.

References triangle::a(), triangle::b(), triangle::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

◆ vertexNormalWeight()

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

Definition at line 36 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

◆ vertexTriads()

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

◆ curvatures() [1/2]

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

◆ curvatures() [2/2]

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

Definition at line 325 of file triSurfaceCurvature.C.

References tmp::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

◆ 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

◆ featureProximity()

scalarField featureProximity ( const triSurface surf,
const scalar  searchDistance 
)

◆ writeFeatureProximity()

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

◆ validTri() [1/2]

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

Definition at line 2689 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

Definition at line 2768 of file triSurfaceTools.C.

References Foam::endl(), f(), MeshedSurface::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

◆ trackToEdge()

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

◆ track()

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

Definition at line 2984 of file triSurfaceTools.C.

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

Here is the call graph for this function:

Member Data Documentation

◆ ANYEDGE

const Foam::label ANYEDGE = -1
static

Definition at line 376 of file triSurfaceTools.H.

◆ NOEDGE

const Foam::label NOEDGE = -2
static

Definition at line 377 of file triSurfaceTools.H.

◆ COLLAPSED

const Foam::label COLLAPSED = -3
static

Definition at line 378 of file triSurfaceTools.H.


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