surfaceIntersection Class Reference

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

Collaboration diagram for surfaceIntersection:
[legend]

Public Types

enum  intersectionType {
  FIRST , SECOND , SELF , SELF_REGION ,
  NONE
}
 Surface intersection types for classify, doCutEdges. More...
 

Public Member Functions

 ClassName ("surfaceIntersection")
 
 surfaceIntersection ()
 Construct null. More...
 
 surfaceIntersection (const triSurfaceSearch &querySurf1, const triSurfaceSearch &querySurf2, const dictionary &dict=dictionary::null)
 Construct from two surfaces. More...
 
 surfaceIntersection (const triSurfaceSearch &querySurf1, const dictionary &dict=dictionary::null)
 Construct from self-intersections. More...
 
 surfaceIntersection (const triSurface &surf1, const edgeIntersections &intersections1, const triSurface &surf2, const edgeIntersections &intersections2)
 Construct from precalculated intersection information. More...
 
const pointFieldcutPoints () const
 The list of cut points. More...
 
const edgeListcutEdges () const
 The list of created edges. More...
 
const labelPairLookupfacePairToEdgeId () const
 Lookup of pairs of faces to created edges. More...
 
const labelListListedgeCuts (const bool isFirstSurf) const
 Access either surf1EdgeCuts (isFirstSurface = true) or. More...
 
const labelListListsurf1EdgeCuts () const
 List of cut points on edges of surface1. More...
 
const labelListListsurf2EdgeCuts () const
 List of cut points on edges of surface2. More...
 
void mergePoints (const scalar mergeDist)
 Geometric merge points (points within mergeDist) prior to. More...
 
void mergeEdges ()
 Merge duplicate edges. More...
 

Static Public Attributes

static const Enum< intersectionTypeselfIntersectionNames
 The user-selectable self-intersection enumeration names. 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 'tolerance' as a fraction of current edge length to determine if intersection is a point-touching one instead of an edge-piercing action.

Some constructors allow a dictionary of intersection controls:

Property Description Type Default value
tolerance Edge-length tolerance scalar 1e-3
allowEdgeHits Edge-end cuts another edge bool true
snap Snap near end-points bool true
warnDegenerate Number of warnings about degenerate edges label 0
intersectionMethod Control for self intersection (self,region,none)
Source files

Definition at line 130 of file surfaceIntersection.H.

Member Enumeration Documentation

◆ intersectionType

Surface intersection types for classify, doCutEdges.

Enumerator
FIRST 

First surface.

SECOND 

Second surface.

SELF 

Self-intersection.

SELF_REGION 

Self-intersection, region-wise only.

NONE 

None = invalid (for input only)

Definition at line 135 of file surfaceIntersection.H.

Constructor & Destructor Documentation

◆ surfaceIntersection() [1/4]

Construct null.

Definition at line 1055 of file surfaceIntersection.C.

◆ surfaceIntersection() [2/4]

surfaceIntersection ( const triSurfaceSearch querySurf1,
const triSurfaceSearch querySurf2,
const dictionary dict = dictionary::null 
)

Construct from two surfaces.

Does its own cutting. Has problems with degenerate cuts

Definition at line 1070 of file surfaceIntersection.C.

References HashTable< T, Key, Hash >::clear(), dict, Foam::endl(), surfaceIntersection::FIRST, PrimitivePatch< FaceList, PointField >::nEdges(), PrimitivePatch< FaceList, PointField >::nPoints(), Foam::Pout, surfaceIntersection::SECOND, UList< T >::size(), triSurfaceSearch::surface(), List< T >::transfer(), and OBJstream::write().

Here is the call graph for this function:

◆ surfaceIntersection() [3/4]

surfaceIntersection ( const triSurfaceSearch querySurf1,
const dictionary dict = dictionary::null 
)

Construct from self-intersections.

Does its own cutting, but has problems with degenerate cuts

Definition at line 1183 of file surfaceIntersection.C.

References HashTable< T, Key, Hash >::clear(), dict, UList< T >::empty(), Foam::endl(), Enum< EnumType >::getOrDefault(), PrimitivePatch< FaceList, PointField >::nEdges(), surfaceIntersection::NONE, Foam::Pout, surfaceIntersection::SELF, surfaceIntersection::selfIntersectionNames, UList< T >::size(), triSurfaceSearch::surface(), List< T >::transfer(), and OBJstream::write().

Here is the call graph for this function:

◆ surfaceIntersection() [4/4]

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

Construct from precalculated intersection information.

Advantage: intersection information is guaranteed to have no degenerate cuts.

Definition at line 1295 of file surfaceIntersection.C.

References DynamicList< T, SizeMin >::append(), List< T >::append(), HashTable< T, Key, Hash >::clear(), PrimitivePatch< FaceList, PointField >::edgeFaces(), Foam::endl(), surfaceIntersection::FIRST, forAll, PointIndexHit< PointType >::hitPoint(), PointIndexHit< PointType >::index(), PrimitivePatch< FaceList, PointField >::nEdges(), PrimitivePatch< FaceList, PointField >::nPoints(), Foam::Pout, surfaceIntersection::SECOND, UList< T >::size(), List< T >::transfer(), and OBJstream::write().

Here is the call graph for this function:

Member Function Documentation

◆ ClassName()

ClassName ( "surfaceIntersection"  )

◆ cutPoints()

const Foam::pointField & cutPoints ( ) const

The list of cut points.

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

The list of created edges.

Definition at line 1447 of file surfaceIntersection.C.

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

Here is the caller graph for this function:

◆ facePairToEdgeId()

const Foam::labelPairLookup & facePairToEdgeId ( ) const

Lookup of pairs of faces to created edges.

Definition at line 1453 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 1459 of file surfaceIntersection.C.

Referenced by edgeSurface::edgeSurface().

Here is the caller graph for this function:

◆ surf1EdgeCuts()

const Foam::labelListList & surf1EdgeCuts ( ) const

List of cut points on edges of surface1.

Definition at line 1475 of file surfaceIntersection.C.

◆ surf2EdgeCuts()

const Foam::labelListList & surf2EdgeCuts ( ) const

List of cut points on edges of surface2.

Definition at line 1481 of file surfaceIntersection.C.

◆ mergePoints()

void mergePoints ( const scalar  mergeDist)

Geometric merge points (points within mergeDist) prior to.

automatically calling mergeEdges().

Definition at line 1487 of file surfaceIntersection.C.

References e, forAll, Foam::inplaceMergePoints(), Foam::inplaceRenumber(), and Foam::inplaceUniqueSort().

Here is the call graph for this function:

◆ mergeEdges()

void mergeEdges ( )

Merge duplicate edges.

Definition at line 1525 of file surfaceIntersection.C.

References e, forAll, HashSet< Key, Hash >::insert(), and List< T >::setSize().

Here is the call graph for this function:

Member Data Documentation

◆ selfIntersectionNames

const Foam::Enum< Foam::surfaceIntersection::intersectionType > selfIntersectionNames
static

The user-selectable self-intersection enumeration names.

Definition at line 145 of file surfaceIntersection.H.

Referenced by surfaceIntersection::surfaceIntersection().


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