OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

triSurfaceTools Class Reference

A collection of tools for triSurfaceMesh. More...

Collaboration diagram for triSurfaceTools:

List of all members.


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.

Static Public Member Functions

static void writeOBJ (const fileName &fName, const pointField &pts)
 Write pointField to OBJ format file.
static void writeOBJ (const triSurface &surf, const fileName &fName, const boolList &markedVerts)
 Write vertex subset to OBJ format file.
static void getVertexTriangles (const triSurface &surf, const label edgeI, labelList &edgeTris)
 Get all triangles using edge endpoint.
static labelList getVertexVertices (const triSurface &surf, const edge &e)
 Get all vertices (local numbering) connected to vertices of edge.
static label otherFace (const triSurface &surf, const label faceI, const label edgeI)
 Get face connected to edge not faceI.
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.
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.
static label oppositeEdge (const triSurface &surf, const label faceI, const label vertI)
 Get edge opposite vertex (local numbering).
static label oppositeVertex (const triSurface &surf, const label faceI, const label edgeI)
 Get vertex (local numbering) opposite edge.
static label getEdge (const triSurface &surf, const label vert1I, const label vert2I)
 Returns edge label connecting v1, v2 (local numbering).
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.
static triSurface collapseEdges (const triSurface &surf, const labelList &collapsableEdges)
 Create new triSurface by collapsing edges to edge mids.
static triSurface collapseEdges (const triSurface &surf, const labelList &collapsableEdges, const pointField &edgeMids, labelList &faceStatus)
 Create new triSurface by collapsing edges to specified.
static triSurface greenRefine (const triSurface &surf, const labelList &refineEdges)
 Refine edges by splitting to opposite vertex.
static triSurface redGreenRefine (const triSurface &surf, const labelList &refineFaces)
 Refine face by splitting all edges. Neighbouring face is.
static label minEdge (const triSurface &surf, const labelList &edgeIndices)
 Returns element in edgeIndices with minimum length.
static label maxEdge (const triSurface &surf, const labelList &edgeIndices)
 Returns element in edgeIndices with minimum length.
static triSurface mergePoints (const triSurface &surf, const scalar mergeTol)
 Merge points within distance.
static vector surfaceNormal (const triSurface &surf, const label nearestFaceI, const point &nearestPt)
 Triangle (unit) normal. If nearest point to triangle on edge use.
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
static sideType surfaceSide (const triSurface &surf, const point &sample, const label nearestFaceI, const point &nearestPt, const scalar tol)
 Given nearest point (to sample) on surface determines which side.
static triSurface triangulate (const polyBoundaryMesh &mBesh, const labelHashSet &includePatches, const bool verbose=false)
 Simple triangulation of (selected patches of) boundaryMesh. Needs.
static void calcInterpolationWeights (const triPointRef &, const point &, FixedList< scalar, 3 > &weights)
 Calculate linear interpolation weights for point (guaranteed to be.
static void calcInterpolationWeights (const triSurface &s, const pointField &samplePts, List< FixedList< label, 3 > > &verts, List< FixedList< scalar, 3 > > &weights)
static triSurface delaunay2D (const List< vector2D > &)
 Do unconstrained Delaunay of points. Returns triSurface with 3D.
static surfaceLocation classify (const triSurface &, const label triI, const point &trianglePoint)
 Test point on plane of triangle to see if on edge or point.
static surfaceLocation trackToEdge (const triSurface &, const surfaceLocation &start, const surfaceLocation &end, const plane &cutPlane)
 Track on surface to get closer to point. Possible situations:.
static void track (const triSurface &, const surfaceLocation &endInfo, const plane &cutPlane, surfaceLocation &hitInfo)
 Track from edge to edge across surface. Uses trackToEdge.

Static Public Attributes

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

Detailed Description

A collection of tools for triSurfaceMesh.

Source files

Definition at line 58 of file triSurfaceTools.H.


Member Enumeration Documentation

enum sideType

on which side of surface

Enumerator:
UNKNOWN 
INSIDE 
OUTSIDE 

Definition at line 452 of file triSurfaceTools.H.


Member Function Documentation

void writeOBJ ( const fileName &  fName,
const pointField &  pts 
) [static]

Write pointField to OBJ format file.

Definition at line 1250 of file triSurfaceTools.C.

References Foam::endl(), and forAll.

Here is the call graph for this function:

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

Write vertex subset to OBJ format file.

Definition at line 1269 of file triSurfaceTools.C.

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

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

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

Definition at line 1342 of file triSurfaceTools.C.

Foam::label otherFace ( const triSurface &  surf,
const label  faceI,
const label  edgeI 
) [static]

Get face connected to edge not faceI.

Definition at line 1427 of file triSurfaceTools.C.

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

Here is the call graph for this function:

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 1455 of file triSurfaceTools.C.

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 1488 of file triSurfaceTools.C.

Foam::label oppositeEdge ( const triSurface &  surf,
const label  faceI,
const label  vertI 
) [static]

Get edge opposite vertex (local numbering).

Definition at line 1527 of file triSurfaceTools.C.

Foam::label oppositeVertex ( const triSurface &  surf,
const label  faceI,
const label  edgeI 
) [static]

Get vertex (local numbering) opposite edge.

Definition at line 1560 of file triSurfaceTools.C.

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

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

Definition at line 1590 of file triSurfaceTools.C.

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 1615 of file triSurfaceTools.C.

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

Create new triSurface by collapsing edges to edge mids.

Definition at line 1666 of file triSurfaceTools.C.

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 1719 of file triSurfaceTools.C.

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

Refine edges by splitting to opposite vertex.

Definition at line 1900 of file triSurfaceTools.C.

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

Refine face by splitting all edges. Neighbouring face is.

greenRefine'd.

Definition at line 1881 of file triSurfaceTools.C.

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

Returns element in edgeIndices with minimum length.

Definition at line 1992 of file triSurfaceTools.C.

References PrimitivePatch< Face, FaceList, PointField, PointType >::edges(), edge::end(), forAll, PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), Foam::mag(), and edge::start().

Here is the call graph for this function:

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

Returns element in edgeIndices with minimum length.

Definition at line 2022 of file triSurfaceTools.C.

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

Merge points within distance.

Definition at line 2052 of file triSurfaceTools.C.

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 2110 of file triSurfaceTools.C.

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 2159 of file triSurfaceTools.C.

Foam::triSurfaceTools::sideType surfaceSide ( const triSurface &  surf,
const point &  sample,
const label  nearestFaceI,
const point &  nearestPt,
const scalar  tol 
) [static]

Given nearest point (to sample) on surface determines which side.

sample is. Uses either face normal, edge normal or point normal (non-trivial). Uses triangle::classify.

Definition at line 2196 of file triSurfaceTools.C.

Foam::triSurface triangulate ( const polyBoundaryMesh &  mBesh,
const labelHashSet &  includePatches,
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.

Definition at line 2325 of file triSurfaceTools.C.

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 2426 of file triSurfaceTools.C.

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 2677 of file triSurfaceTools.C.

References Foam::mag(), and Foam::max().

Here is the call graph for this function:

void calcInterpolationWeights ( const triSurface &  s,
const pointField &  samplePts,
List< FixedList< label, 3 > > &  verts,
List< FixedList< scalar, 3 > > &  weights 
) [static]

Definition at line 2709 of file triSurfaceTools.C.

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 2540 of file triSurfaceTools.C.

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

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 2881 of file triSurfaceTools.C.

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 2959 of file triSurfaceTools.C.


Member Data Documentation

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

const Foam::label NOEDGE = -2 [static]

Definition at line 377 of file triSurfaceTools.H.

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:
Copyright © 2000-2009 OpenCFD Ltd