Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
surfaceIntersection Class Reference

Basic surface-surface intersection description. Constructed from two surfaces it creates a description of the intersection. More...

Collaboration diagram for surfaceIntersection:
Collaboration graph
[legend]

Public Member Functions

 ClassName ("surfaceIntersection")
 
 surfaceIntersection ()
 Construct null. More...
 
 surfaceIntersection (const triSurface &surf1, const edgeIntersections &intersections1, const triSurface &surf2, const edgeIntersections &intersections2)
 Construct from precalculated intersection information. More...
 
 surfaceIntersection (const triSurfaceSearch &querySurf1, const triSurfaceSearch &querySurf2)
 Construct from two surfaces. Does all its own cutting. More...
 
 surfaceIntersection (const triSurfaceSearch &querySurf1)
 Special: intersect surface with itself. Used to check for. More...
 
const pointFieldcutPoints () const
 
const edgeListcutEdges () const
 
const labelPairLookupfacePairToVertex () const
 
const labelPairLookupfacePairToEdge () const
 
const labelListListedgeCuts (const bool) const
 Access either surf1EdgeCuts (isFirstSurface = true) or. More...
 
const labelListListsurf1EdgeCuts () const
 
const labelListListsurf2EdgeCuts () const
 

Private Member Functions

void writeIntersectedEdges (const triSurface &surf, const labelListList &edgeCutVerts, Ostream &os) const
 Debugging: Dump intersected edges to stream. More...
 
void storeIntersection (const bool isFirstSurf, const labelList &facesA, const label faceB, DynamicList< edge > &, DynamicList< point > &)
 Update reference between faceA and faceB. Updates facePairToVertex_. More...
 
void classifyHit (const triSurface &surf1, const scalarField &surf1PointTol, const triSurface &surf2, const bool isFirstSurf, const label edgeI, const scalar tolDim, const pointIndexHit &pHit, DynamicList< edge > &allCutEdges, DynamicList< point > &allCutPoints, List< DynamicList< label > > &surfEdgeCuts)
 Investigate pHit to whether is case of point hits point,. More...
 
void doCutEdges (const triSurface &surf1, const triSurfaceSearch &querySurf2, const bool isFirstSurf, const bool isSelfIntersection, DynamicList< edge > &allCutEdges, DynamicList< point > &allCutPoints, List< DynamicList< label > > &surfEdgeCuts)
 Cut edges of surf1 with surface 2. More...
 

Static Private Member Functions

static void writeOBJ (const point &pt, Ostream &os)
 Write point in obj format. More...
 
static void writeOBJ (const List< point > &, const List< edge > &, Ostream &)
 Write points and edges in obj format. More...
 
template<class T >
static void transfer (List< DynamicList< T > > &, List< List< T > > &)
 Transfer contents of List<DynamicList<..> > to List<List<..>> More...
 
static scalar minEdgeLen (const triSurface &surf, const label pointI)
 Get minimum length of all edges connected to point. More...
 
static label getEdge (const triSurface &surf, const label faceI, const label fp)
 Get edge label of edge between face vertices fp and fp+1. More...
 
static void removeDuplicates (const labelList &map, labelList &labels)
 Remove duplicates from ordered dynamic list. Returns map from old. More...
 
static void inlineRemap (const labelList &map, labelList &elems)
 Apply map to elements of a labelList. More...
 
static edgeList filterEdges (const edgeList &, labelList &map)
 
static labelList filterLabels (const labelList &elems, labelList &map)
 Remove all duplicate elements. More...
 
static bool excludeEdgeHit (const triSurface &surf, const label edgeI, const label faceI, const scalar tol)
 Do some checks if edge and face (resulting from hit) More...
 
static label classify (const scalar startTol, const scalar endTol, const point &p, const edge &e, const pointField &points)
 Detect if point close to edge of end. Returns -1: not close. More...
 

Private Attributes

pointField cutPoints_
 Newly introduced points. More...
 
edgeList cutEdges_
 Newly introduced edges (are on both surfaces). Reference into. More...
 
labelPairLookup facePairToVertex_
 From face on surf1 and face on surf2 to intersection point. More...
 
labelPairLookup facePairToEdge_
 From face on surf1 and face on surf2 to intersection edge. More...
 
labelListList surf1EdgeCuts_
 Edges on surf1 that are cut. From edge on surf1 to label in cutPoint. More...
 
labelListList surf2EdgeCuts_
 Edges on surf2 that are cut. From edge on surf2 to label in cutPoint. More...
 

Detailed Description

Basic surface-surface intersection description. Constructed from two surfaces it creates a description of the intersection.

The intersection information consists of the intersection line(s) with new points, new edges between points (note that these edges and points are on both surfaces) and various addressing from original surface faces/edges to intersection and vice versa.

Gets either precalculated intersection information or calculates it itself. Algorithm works by intersecting all edges of one surface with the other surface and storing a reference from both faces (one on surface1, one on surface 2) to the vertex. If the reference re-occurs we have the second hit of both faces and an edge is created between the retrieved vertex and the new one.

Note: when doing intersecting itself uses intersection::planarTol() as a fraction of current edge length to determine if intersection is a point-touching one instead of an edge-piercing action.

Source files

Definition at line 80 of file surfaceIntersection.H.

Constructor & Destructor Documentation

◆ surfaceIntersection() [1/4]

Construct null.

Definition at line 699 of file surfaceIntersection.C.

◆ surfaceIntersection() [2/4]

surfaceIntersection ( const triSurface surf1,
const edgeIntersections intersections1,
const triSurface surf2,
const edgeIntersections intersections2 
)

◆ surfaceIntersection() [3/4]

surfaceIntersection ( const triSurfaceSearch querySurf1,
const triSurfaceSearch querySurf2 
)

Construct from two surfaces. Does all its own cutting.

Has problems with degenerate cuts

Definition at line 712 of file surfaceIntersection.C.

References Foam::endl(), PrimitivePatch< Face, FaceList, PointField, PointType >::nEdges(), PrimitivePatch< Face, FaceList, PointField, PointType >::nPoints(), Foam::Pout, triSurfaceSearch::surface(), and writeOBJ().

Here is the call graph for this function:

◆ surfaceIntersection() [4/4]

surfaceIntersection ( const triSurfaceSearch querySurf1)

Member Function Documentation

◆ writeOBJ() [1/2]

void writeOBJ ( const point pt,
Ostream os 
)
staticprivate

Write point in obj format.

Definition at line 37 of file surfaceIntersectionFuncs.C.

References Foam::endl(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

Here is the call graph for this function:

◆ writeOBJ() [2/2]

void writeOBJ ( const List< point > &  pts,
const List< edge > &  edges,
Ostream os 
)
staticprivate

Write points and edges in obj format.

Definition at line 44 of file surfaceIntersectionFuncs.C.

References Foam::e, Foam::endl(), forAll, and writeOBJ().

Here is the call graph for this function:

◆ transfer()

void transfer ( List< DynamicList< T > > &  srcLst,
List< List< T > > &  dstLst 
)
staticprivate

Transfer contents of List<DynamicList<..> > to List<List<..>>

Definition at line 33 of file surfaceIntersectionTemplates.C.

References forAll.

◆ minEdgeLen()

Foam::scalar minEdgeLen ( const triSurface surf,
const label  pointI 
)
staticprivate

◆ getEdge()

Foam::label getEdge ( const triSurface surf,
const label  faceI,
const label  fp 
)
staticprivate

◆ removeDuplicates()

void removeDuplicates ( const labelList map,
labelList labels 
)
staticprivate

Remove duplicates from ordered dynamic list. Returns map from old.

to new (-1 if element removed)

Definition at line 118 of file surfaceIntersectionFuncs.C.

References forAll, and List::setSize().

Here is the call graph for this function:

◆ inlineRemap()

void inlineRemap ( const labelList map,
labelList elems 
)
staticprivate

Apply map to elements of a labelList.

Definition at line 167 of file surfaceIntersectionFuncs.C.

References forAll.

◆ filterEdges()

Foam::edgeList filterEdges ( const edgeList edges,
labelList map 
)
staticprivate

Definition at line 182 of file surfaceIntersectionFuncs.C.

References Foam::e, HashTable< nil, word, string::hash >::find(), forAll, HashSet< Key, Hash >::insert(), List::setSize(), and List::size().

Here is the call graph for this function:

◆ filterLabels()

Foam::labelList filterLabels ( const labelList elems,
labelList map 
)
staticprivate

Remove all duplicate elements.

Definition at line 223 of file surfaceIntersectionFuncs.C.

References HashTable::find(), forAll, HashSet< Key, Hash >::insert(), List::setSize(), and List::size().

Here is the call graph for this function:

◆ excludeEdgeHit()

bool excludeEdgeHit ( const triSurface surf,
const label  edgeI,
const label  faceI,
const scalar  tol 
)
staticprivate

Do some checks if edge and face (resulting from hit)

should not be considered. Returns true if can be discarded.

Definition at line 52 of file surfaceIntersection.C.

References Foam::constant::electromagnetic::e, PrimitivePatch< Face, FaceList, PointField, PointType >::edges(), f(), forAll, and PrimitivePatch< Face, FaceList, PointField, PointType >::localFaces().

Here is the call graph for this function:

◆ writeIntersectedEdges()

void writeIntersectedEdges ( const triSurface surf,
const labelListList edgeCutVerts,
Ostream os 
) const
private

◆ classify()

Foam::label classify ( const scalar  startTol,
const scalar  endTol,
const point p,
const edge e,
const pointField points 
)
staticprivate

Detect if point close to edge of end. Returns -1: not close.

0:close (within startTol) to start, 1:close (within endTol) to end

Definition at line 304 of file surfaceIntersectionFuncs.C.

References Foam::e, Foam::mag(), p, and points.

Here is the call graph for this function:

◆ storeIntersection()

void storeIntersection ( const bool  isFirstSurf,
const labelList facesA,
const label  faceB,
DynamicList< edge > &  allCutEdges,
DynamicList< point > &  allCutPoints 
)
private

Update reference between faceA and faceB. Updates facePairToVertex_.

(first occurrence of face pair) and facePairToEdge_ (second occ.)

Definition at line 197 of file surfaceIntersection.C.

References DynamicList::append(), Foam::endl(), forAll, Foam::mag(), and WarningInFunction.

Here is the call graph for this function:

◆ classifyHit()

void classifyHit ( const triSurface surf1,
const scalarField surf1PointTol,
const triSurface surf2,
const bool  isFirstSurf,
const label  edgeI,
const scalar  tolDim,
const pointIndexHit pHit,
DynamicList< edge > &  allCutEdges,
DynamicList< point > &  allCutPoints,
List< DynamicList< label > > &  surfEdgeCuts 
)
private

◆ doCutEdges()

void doCutEdges ( const triSurface surf1,
const triSurfaceSearch querySurf2,
const bool  isFirstSurf,
const bool  isSelfIntersection,
DynamicList< edge > &  allCutEdges,
DynamicList< point > &  allCutPoints,
List< DynamicList< label > > &  surfEdgeCuts 
)
private

◆ ClassName()

ClassName ( "surfaceIntersection"  )

◆ cutPoints()

const Foam::pointField & cutPoints ( ) const

Definition at line 1132 of file surfaceIntersection.C.

Referenced by edgeSurface::edgeSurface(), and intersectedSurface::intersectedSurface().

Here is the caller graph for this function:

◆ cutEdges()

const Foam::edgeList & cutEdges ( ) const

Definition at line 1138 of file surfaceIntersection.C.

Referenced by edgeSurface::edgeSurface(), and intersectedSurface::intersectedSurface().

Here is the caller graph for this function:

◆ facePairToVertex()

const Foam::labelPairLookup & facePairToVertex ( ) const

Definition at line 1144 of file surfaceIntersection.C.

◆ facePairToEdge()

const Foam::labelPairLookup & facePairToEdge ( ) const

Definition at line 1150 of file surfaceIntersection.C.

Referenced by edgeSurface::edgeSurface().

Here is the caller graph for this function:

◆ edgeCuts()

const Foam::labelListList & edgeCuts ( const bool  isFirstSurf) const

Access either surf1EdgeCuts (isFirstSurface = true) or.

surf2EdgeCuts

Definition at line 1157 of file surfaceIntersection.C.

Referenced by edgeSurface::edgeSurface().

Here is the caller graph for this function:

◆ surf1EdgeCuts()

const Foam::labelListList & surf1EdgeCuts ( ) const

Definition at line 1172 of file surfaceIntersection.C.

◆ surf2EdgeCuts()

const Foam::labelListList & surf2EdgeCuts ( ) const

Definition at line 1178 of file surfaceIntersection.C.

Field Documentation

◆ cutPoints_

pointField cutPoints_
private

Newly introduced points.

Definition at line 85 of file surfaceIntersection.H.

◆ cutEdges_

edgeList cutEdges_
private

Newly introduced edges (are on both surfaces). Reference into.

cutPoints.

Definition at line 89 of file surfaceIntersection.H.

◆ facePairToVertex_

labelPairLookup facePairToVertex_
private

From face on surf1 and face on surf2 to intersection point.

(label in cutPoints)

Definition at line 93 of file surfaceIntersection.H.

◆ facePairToEdge_

labelPairLookup facePairToEdge_
private

From face on surf1 and face on surf2 to intersection edge.

(label in cutEdges)

Definition at line 97 of file surfaceIntersection.H.

◆ surf1EdgeCuts_

labelListList surf1EdgeCuts_
private

Edges on surf1 that are cut. From edge on surf1 to label in cutPoint.

If multiple cuts:sorted from edge.start to edge.end

Definition at line 101 of file surfaceIntersection.H.

◆ surf2EdgeCuts_

labelListList surf2EdgeCuts_
private

Edges on surf2 that are cut. From edge on surf2 to label in cutPoint.

If multiple cuts:sorted from edge.start to edge.end

Definition at line 105 of file surfaceIntersection.H.


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