OpenFOAM logo
Open Source CFD Toolkit

Foam::triSurfaceTools Namespace Reference


Enumerations

enum  refineType { NONE, RED, GREEN }

Functions

void writeOBJ (const fileName &fName, const pointField &pts)
 Write pointField to OBJ format file.
void writeOBJ (const triSurface &surf, const fileName &fName, const boolList &markedVerts)
 Write vertex subset to OBJ format file.
void getVertexTriangles (const triSurface &surf, const label edgeI, labelList &edgeTris)
 Get all triangles using edge endpoint.
labelList getVertexVertices (const triSurface &surf, const edge &e)
 Get all vertices (local numbering) connected to vertices of edge.
FixedList< label, 3 > sortedFaceEdges (const triSurface &surf, const label faceI)
 Get all edges of triangle in face ordering (elem 0 is edge between.
void orderVertices (const labelledTri &f, const label v1, const label v2, label &vA, label &vB)
 Order vertices consistent with face.
label otherFace (const triSurface &surf, const label faceI, const label edgeI)
 Get face connected to edge not faceI.
void otherEdges (const triSurface &surf, const label faceI, const label edgeI, label &e1, label &e2)
 Get the two edges on faceI counterclockwise after edgeI.
void otherVertices (const triSurface &surf, const label faceI, const label vertI, label &vert1I, label &vert2I)
 Get the two vertices (local numbering) on faceI counterclockwise vertI.
label oppositeEdge (const triSurface &surf, const label faceI, const label vertI)
 Get edge opposite vertex (local numbering).
label oppositeVertex (const triSurface &surf, const label faceI, const label edgeI)
 Get vertex (local numbering) opposite edge.
label getEdge (const triSurface &surf, const label vert1I, const label vert2I)
 Returns edge label connecting v1, v2 (local numbering).
label getTriangle (const triSurface &surf, const label e0I, const label e1I, const label e2I)
 Return index of triangle (or -1) using all three edges.
label minEdge (const triSurface &surf, const labelList &edgeIndices)
 Returns element in edgeIndices with minimum length.
label maxEdge (const triSurface &surf, const labelList &edgeIndices)
 Returns element in edgeIndices with minimum length.
scalar faceCosAngle (const point &pStart, const point &pEnd, const point &pLeft, const point &pRight)
scalar pseudoAngle (const vector &e0, const vector &e1, const vector &vec)
 Estimate angle of vec in coordinate system (e0, e1, e0^e1).
labelHashSet getCollapsedFaces (const triSurface &surf, label edgeI)
 faces to collapse because of edge collapse
label vertexUsesFace (const triSurface &surf, const labelHashSet &faceUsed, const label vertI)
void getMergedEdges (const triSurface &surf, const label edgeI, const labelHashSet &collapsedFaces, HashTable< label, label, Hash< label > > &edgeToEdge, HashTable< label, label, Hash< label > > &edgeToFace)
scalar edgeCosAngle (const triSurface &surf, const label v1, const point &pt, const labelHashSet &collapsedFaces, const HashTable< label, label, Hash< label > > &edgeToEdge, const HashTable< label, label, Hash< label > > &edgeToFace, const label faceI, const label edgeI)
 Calculates (cos of) angle across edgeI of faceI,.
scalar collapseMinCosAngle (const triSurface &surf, const label v1, const point &pt, const labelHashSet &collapsedFaces, const HashTable< label, label, Hash< label > > &edgeToEdge, const HashTable< label, label, Hash< label > > &edgeToFace)
 Calculate minimum (cos of) edge angle using addressing from collapsing.
bool collapseCreatesFold (const triSurface &surf, const label v1, const point &pt, const labelHashSet &collapsedFaces, const HashTable< label, label, Hash< label > > &edgeToEdge, const HashTable< label, label, Hash< label > > &edgeToFace, const scalar minCos)
 Like collapseMinCosAngle but return true for value < minCos.
void protectNeighbours (const triSurface &surf, const label vertI, labelList &faceStatus)
triSurface collapseEdges (const triSurface &surf, const labelList &collapsableEdges)
 Create new triSurface by collapsing edges to edge mids.
triSurface collapseEdges (const triSurface &surf, const labelList &collapsableEdges, const pointField &edgeMids, labelList &faceStatus)
 Create new triSurface by collapsing edges to specified.
void calcRefineStatus (const triSurface &surf, const label faceI, labelList &refine)
void greenRefine (const triSurface &surf, const label faceI, const label edgeI, const label newPointI, DynamicList< labelledTri > &newFaces)
triSurface greenRefine (const triSurface &surf, const labelList &refineEdges)
 Refine edges by splitting to opposite vertex.
triSurface doRefine (const triSurface &surf, const labelList &refineStatus)
triSurface redGreenRefine (const triSurface &surf, const labelList &refineFaces)
 Refine face by splitting all edges. Neighbouring face is greenRefine'd.
triSurface mergePoints (const triSurface &surf, const scalar mergeTol)
 Merge points within distance.
vector surfaceNormal (const triSurface &surf, const label nearestFaceI, const point &nearestPt)
 Triangle (unit) normal. If nearest point to triangle on edge use edge.
triSurface triangulate (const polyBoundaryMesh &mBesh, const labelHashSet &includePatches, const bool verbose=false)
 Simple triangulation of (selected patches of) boundaryMesh. Needs.
triSurface triangulateFaceCentre (const polyBoundaryMesh &mBesh, const labelHashSet &includePatches, const bool verbose=false)
 Face-centre triangulation of (selected patches of) boundaryMesh. Needs.

Variables

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


Enumeration Type Documentation

enum refineType
 

Enumeration values:
NONE 
RED 
GREEN 

Definition at line 343 of file triSurfaceTools.H.


Function Documentation

void calcRefineStatus const triSurface &  surf,
const label  faceI,
labelList refine
 

bool collapseCreatesFold const triSurface &  surf,
const label  v1,
const point pt,
const labelHashSet collapsedFaces,
const HashTable< label, label, Hash< label > > &  edgeToEdge,
const HashTable< label, label, Hash< label > > &  edgeToFace,
const scalar  minCos
 

Like collapseMinCosAngle but return true for value < minCos.

triSurface collapseEdges const triSurface &  surf,
const labelList collapsableEdges,
const pointField edgeMids,
labelList faceStatus
 

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.

triSurface collapseEdges const triSurface &  surf,
const labelList collapsableEdges
 

Create new triSurface by collapsing edges to edge mids.

scalar collapseMinCosAngle const triSurface &  surf,
const label  v1,
const point pt,
const labelHashSet collapsedFaces,
const HashTable< label, label, Hash< label > > &  edgeToEdge,
const HashTable< label, label, Hash< label > > &  edgeToFace
 

Calculate minimum (cos of) edge angle using addressing from collapsing.

edge to v1 at pt. Returns 1 if v1 is on edge without neighbours (and hence no edge angle can be defined)

triSurface doRefine const triSurface &  surf,
const labelList refineStatus
 

scalar edgeCosAngle const triSurface &  surf,
const label  v1,
const point pt,
const labelHashSet collapsedFaces,
const HashTable< label, label, Hash< label > > &  edgeToEdge,
const HashTable< label, label, Hash< label > > &  edgeToFace,
const label  faceI,
const label  edgeI
 

Calculates (cos of) angle across edgeI of faceI,.

taking into account updated addressing (resulting from edge collapse)

scalar faceCosAngle const point pStart,
const point pEnd,
const point pLeft,
const point pRight
 

labelHashSet getCollapsedFaces const triSurface &  surf,
label  edgeI
 

faces to collapse because of edge collapse

label getEdge const triSurface &  surf,
const label  vert1I,
const label  vert2I
 

Returns edge label connecting v1, v2 (local numbering).

void getMergedEdges const triSurface &  surf,
const label  edgeI,
const labelHashSet collapsedFaces,
HashTable< label, label, Hash< label > > &  edgeToEdge,
HashTable< label, label, Hash< label > > &  edgeToFace
 

label getTriangle const triSurface &  surf,
const label  e0I,
const label  e1I,
const label  e2I
 

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

void getVertexTriangles const triSurface &  surf,
const label  edgeI,
labelList edgeTris
 

Get all triangles using edge endpoint.

labelList getVertexVertices const triSurface &  surf,
const edge &  e
 

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

triSurface greenRefine const triSurface &  surf,
const labelList refineEdges
 

Refine edges by splitting to opposite vertex.

void greenRefine const triSurface &  surf,
const label  faceI,
const label  edgeI,
const label  newPointI,
DynamicList< labelledTri > &  newFaces
 

label maxEdge const triSurface &  surf,
const labelList edgeIndices
 

Returns element in edgeIndices with minimum length.

triSurface mergePoints const triSurface &  surf,
const scalar  mergeTol
 

Merge points within distance.

label minEdge const triSurface &  surf,
const labelList edgeIndices
 

Returns element in edgeIndices with minimum length.

label oppositeEdge const triSurface &  surf,
const label  faceI,
const label  vertI
 

Get edge opposite vertex (local numbering).

label oppositeVertex const triSurface &  surf,
const label  faceI,
const label  edgeI
 

Get vertex (local numbering) opposite edge.

void orderVertices const labelledTri &  f,
const label  v1,
const label  v2,
label vA,
label vB
 

Order vertices consistent with face.

void otherEdges const triSurface &  surf,
const label  faceI,
const label  edgeI,
label e1,
label e2
 

Get the two edges on faceI counterclockwise after edgeI.

label otherFace const triSurface &  surf,
const label  faceI,
const label  edgeI
 

Get face connected to edge not faceI.

void otherVertices const triSurface &  surf,
const label  faceI,
const label  vertI,
label vert1I,
label vert2I
 

Get the two vertices (local numbering) on faceI counterclockwise vertI.

void protectNeighbours const triSurface &  surf,
const label  vertI,
labelList faceStatus
 

scalar pseudoAngle const vector e0,
const vector e1,
const vector vec
 

Estimate angle of vec in coordinate system (e0, e1, e0^e1).

Is guaranteed to return increasing number but is not correct angle. Used for sorting angles. All input vectors need to be normalized.

triSurface redGreenRefine const triSurface &  surf,
const labelList refineFaces
 

Refine face by splitting all edges. Neighbouring face is greenRefine'd.

FixedList<label, 3> sortedFaceEdges const triSurface &  surf,
const label  faceI
 

Get all edges of triangle in face ordering (elem 0 is edge between.

f[0] .. f[1], elem1 between f[1]..f[2] etc)

vector surfaceNormal const triSurface &  surf,
const label  nearestFaceI,
const point nearestPt
 

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.

triSurface triangulate const polyBoundaryMesh &  mBesh,
const labelHashSet includePatches,
const bool  verbose = false
 

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

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

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.

label vertexUsesFace const triSurface &  surf,
const labelHashSet faceUsed,
const label  vertI
 

void writeOBJ const triSurface &  surf,
const fileName &  fName,
const boolList markedVerts
 

Write vertex subset to OBJ format file.

void writeOBJ const fileName &  fName,
const pointField pts
 

Write pointField to OBJ format file.


Variable Documentation

const 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 311 of file triSurfaceTools.H.

const label COLLAPSED = -3 [static]
 

Definition at line 313 of file triSurfaceTools.H.

const label NOEDGE = -2 [static]
 

Definition at line 312 of file triSurfaceTools.H.

For further information go to www.openfoam.org