Basic surface-surface intersection description. Constructed from two surfaces it creates a description of the intersection. More...
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 pointField & | cutPoints () const |
The list of cut points. More... | |
const edgeList & | cutEdges () const |
The list of created edges. More... | |
const labelPairLookup & | facePairToEdgeId () const |
Lookup of pairs of faces to created edges. More... | |
const labelListList & | edgeCuts (const bool isFirstSurf) const |
Access either surf1EdgeCuts (isFirstSurface = true) or. More... | |
const labelListList & | surf1EdgeCuts () const |
List of cut points on edges of surface1. More... | |
const labelListList & | surf2EdgeCuts () 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< intersectionType > | selfIntersectionNames |
The user-selectable self-intersection enumeration names. More... | |
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) |
Definition at line 130 of file surfaceIntersection.H.
enum 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.
Construct null.
Definition at line 1055 of file surfaceIntersection.C.
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().
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().
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().
ClassName | ( | "surfaceIntersection" | ) |
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().
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().
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().
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().
const Foam::labelListList & surf1EdgeCuts | ( | ) | const |
List of cut points on edges of surface1.
Definition at line 1475 of file surfaceIntersection.C.
const Foam::labelListList & surf2EdgeCuts | ( | ) | const |
List of cut points on edges of surface2.
Definition at line 1481 of file surfaceIntersection.C.
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().
void mergeEdges | ( | ) |
Merge duplicate edges.
Definition at line 1525 of file surfaceIntersection.C.
References e, forAll, HashSet< Key, Hash >::insert(), and List< T >::setSize().
|
static |
The user-selectable self-intersection enumeration names.
Definition at line 145 of file surfaceIntersection.H.
Referenced by surfaceIntersection::surfaceIntersection().