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

Holder of intersections of edges of a surface with another surface. Optionally shuffles around points on surface to resolve any 'conflicts' (edge hitting triangle edge, edge hitting point etc.). More...

Inheritance diagram for edgeIntersections:
Inheritance graph
[legend]
Collaboration diagram for edgeIntersections:
Collaboration graph
[legend]

Public Member Functions

 ClassName ("edgeIntersections")
 
 edgeIntersections ()
 Construct null. More...
 
 edgeIntersections (const triSurface &surf1, const triSurfaceSearch &query2, const scalarField &surf1PointTol)
 Construct from surface and tolerance. More...
 
 edgeIntersections (const List< List< pointIndexHit > > &, const labelListList &)
 Construct from components. More...
 
const labelListListclassification () const
 For every intersection the classification status. More...
 
label removeDegenerates (const label nIters, const triSurface &surf1, const triSurfaceSearch &query2, const scalarField &surf1PointTol, pointField &points1)
 Resolve ties. Shuffles points so all edge - face intersections. More...
 
void merge (const edgeIntersections &, const labelList &edgeMap, const labelList &faceMap, const bool merge=true)
 Merge (or override) edge intersection for a subset. More...
 
- Public Member Functions inherited from List< List< pointIndexHit > >
label size () const
 Return the number of elements in the UList. More...
 
 List ()
 Null constructor. More...
 
 List (const label)
 Construct with given size. More...
 
 List (const label, const T &)
 Construct with given size and value for all elements. More...
 
 List (const List< T > &)
 Copy constructor. More...
 
 List (const Xfer< List< T > > &)
 Construct by transferring the parameter contents. More...
 
 List (List< T > &, bool reUse)
 Construct as copy or re-use as specified. More...
 
 List (const UList< T > &, const labelUList &mapAddressing)
 Construct as subset. More...
 
 List (InputIterator first, InputIterator last)
 Construct given start and end iterators. More...
 
 List (const FixedList< T, Size > &)
 Construct as copy of FixedList<T, Size> More...
 
 List (const PtrList< T > &)
 Construct as copy of PtrList<T> More...
 
 List (const SLList< T > &)
 Construct as copy of SLList<T> More...
 
 List (const UIndirectList< T > &)
 Construct as copy of UIndirectList<T> More...
 
 List (const BiIndirectList< T > &)
 Construct as copy of BiIndirectList<T> More...
 
 List (Istream &)
 Construct from Istream. More...
 
 List (const label s)
 
 List (const label s, const T &a)
 
 List (const List< T > &a)
 
 List (const Xfer< List< T > > &lst)
 
 List (List< T > &a, bool reUse)
 
 List (const UList< T > &a, const labelUList &map)
 
 List (const PtrList< T > &lst)
 
 List (const SLList< T > &lst)
 
 List (const UIndirectList< T > &lst)
 
 List (const BiIndirectList< T > &lst)
 
 List ()
 
 List (Istream &is)
 
autoPtr< List< T > > clone () const
 Clone. More...
 
 ~List ()
 Destructor. More...
 
void resize (const label)
 Alias for setSize(const label) More...
 
void resize (const label, const T &)
 Alias for setSize(const label, const T&) More...
 
void setSize (const label)
 Reset size of List. More...
 
void setSize (const label, const T &)
 Reset size of List and value for new elements. More...
 
void clear ()
 Clear the list, i.e. set size to zero. More...
 
void append (const T &)
 Append an element at the end of the list. More...
 
void append (const UList< T > &)
 Append a List at the end of this list. More...
 
void append (const UIndirectList< T > &)
 Append a UIndirectList at the end of this list. More...
 
void transfer (List< T > &)
 Transfer the contents of the argument List into this list. More...
 
void transfer (DynamicList< T, SizeInc, SizeMult, SizeDiv > &)
 Transfer the contents of the argument List into this list. More...
 
void transfer (SortableList< T > &)
 Transfer the contents of the argument List into this list. More...
 
void transfer (List< T > &a)
 
void transfer (SortableList< T > &a)
 
Xfer< List< T > > xfer ()
 Transfer contents to the Xfer container. More...
 
TnewElmt (const label)
 Return subscript-checked element of UList. More...
 
void operator= (const UList< T > &)
 Assignment from UList operator. Takes linear time. More...
 
void operator= (const List< T > &)
 Assignment operator. Takes linear time. More...
 
void operator= (const SLList< T > &)
 Assignment from SLList operator. Takes linear time. More...
 
void operator= (const UIndirectList< T > &)
 Assignment from UIndirectList operator. Takes linear time. More...
 
void operator= (const BiIndirectList< T > &)
 Assignment from BiIndirectList operator. Takes linear time. More...
 
void operator= (const T &)
 Assignment of all entries to the given value. More...
 

Static Public Member Functions

static scalarField minEdgeLength (const triSurface &surf)
 Calculate min edge length for every surface point. More...
 
- Static Public Member Functions inherited from List< List< pointIndexHit > >
static const List< T > & null ()
 Return a null List. More...
 

Static Public Attributes

static scalar alignedCos_ = cos(degToRad(89.0))
 Cosine between edge and face normal when considered parallel. More...
 

Private Member Functions

void intersectEdges (const triSurface &surf1, const pointField &points1, const triSurfaceSearch &querySurf2, const scalarField &surf1PointTol, const labelList &edgeLabels)
 Intersect selected surface edges (edgeLabels) with surface2. More...
 
bool inlinePerturb (const triSurface &surf1, const scalarField &surf1PointTol, const label edgeI, Random &rndGen, pointField &points1, boolList &affectedEdges) const
 Perturb endpoints of edge if they are close to the intersection. More...
 
bool rotatePerturb (const triSurface &surf1, const scalarField &surf1PointTol, const label edgeI, Random &rndGen, pointField &points1, boolList &affectedEdges) const
 Perturb single endpoint of edge if edge is algigned with face. More...
 
bool offsetPerturb (const triSurface &surf1, const triSurface &surf2, const label edgeI, Random &rndGen, pointField &points1, boolList &affectedEdges) const
 Perturb edge by shifting in direction trianglecentre - intersection. More...
 

Static Private Member Functions

static void checkEdges (const triSurface &surf)
 Check for too small edges. More...
 

Private Attributes

labelListList classification_
 For every entry in *this gives the edge classification result. More...
 

Additional Inherited Members

- Public Types inherited from List< List< pointIndexHit > >
typedef SubList< TsubList
 Declare type of subList. More...
 
- Protected Member Functions inherited from List< List< pointIndexHit > >
void size (const label)
 Override size to be inconsistent with allocated storage. More...
 

Detailed Description

Holder of intersections of edges of a surface with another surface. Optionally shuffles around points on surface to resolve any 'conflicts' (edge hitting triangle edge, edge hitting point etc.).

Source files

Definition at line 60 of file edgeIntersections.H.

Constructor & Destructor Documentation

◆ edgeIntersections() [1/3]

Construct null.

Definition at line 446 of file edgeIntersections.C.

◆ edgeIntersections() [2/3]

edgeIntersections ( const triSurface surf1,
const triSurfaceSearch query2,
const scalarField surf1PointTol 
)

Construct from surface and tolerance.

Definition at line 454 of file edgeIntersections.C.

References Foam::identity(), PrimitivePatch< Face, FaceList, PointField, PointType >::nEdges(), and PrimitivePatch< Face, FaceList, PointField, PointType >::points().

Here is the call graph for this function:

◆ edgeIntersections() [3/3]

edgeIntersections ( const List< List< pointIndexHit > > &  intersections,
const labelListList classification 
)

Construct from components.

Definition at line 482 of file edgeIntersections.C.

Member Function Documentation

◆ checkEdges()

void checkEdges ( const triSurface surf)
staticprivate

◆ intersectEdges()

void intersectEdges ( const triSurface surf1,
const pointField points1,
const triSurfaceSearch querySurf2,
const scalarField surf1PointTol,
const labelList edgeLabels 
)
private

◆ inlinePerturb()

bool inlinePerturb ( const triSurface surf1,
const scalarField surf1PointTol,
const label  edgeI,
Random rndGen,
pointField points1,
boolList affectedEdges 
) const
private

Perturb endpoints of edge if they are close to the intersection.

Move point (in points1) by factor*surf1PointTol in direction of edge. Mark pointEdges of moved point in affectedEdges. Return true if anything changed.

Definition at line 216 of file edgeIntersections.C.

References Foam::e, PrimitivePatch< Face, FaceList, PointField, PointType >::edges(), forAll, Foam::mag(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), n, PrimitivePatch< Face, FaceList, PointField, PointType >::pointEdges(), rndGen(), cachedRandom::scalar01(), and List::size().

Here is the call graph for this function:

◆ rotatePerturb()

bool rotatePerturb ( const triSurface surf1,
const scalarField surf1PointTol,
const label  edgeI,
Random rndGen,
pointField points1,
boolList affectedEdges 
) const
private

Perturb single endpoint of edge if edge is algigned with face.

See inlinePerturb. Return true if anything changed.

Definition at line 296 of file edgeIntersections.C.

References Foam::e, PrimitivePatch< Face, FaceList, PointField, PointType >::edges(), Foam::endl(), forAll, Foam::mag(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), n, PrimitivePatch< Face, FaceList, PointField, PointType >::pointEdges(), Foam::Pout, and rndGen().

Here is the call graph for this function:

◆ offsetPerturb()

bool offsetPerturb ( const triSurface surf1,
const triSurface surf2,
const label  edgeI,
Random rndGen,
pointField points1,
boolList affectedEdges 
) const
private

◆ ClassName()

ClassName ( "edgeIntersections"  )

◆ minEdgeLength()

Foam::scalarField minEdgeLength ( const triSurface surf)
static

◆ classification()

const labelListList& classification ( ) const
inline

For every intersection the classification status.

Definition at line 178 of file edgeIntersections.H.

References edgeIntersections::classification_.

Referenced by edgeIntersections::merge().

Here is the caller graph for this function:

◆ removeDegenerates()

Foam::label removeDegenerates ( const label  nIters,
const triSurface surf1,
const triSurfaceSearch query2,
const scalarField surf1PointTol,
pointField points1 
)

Resolve ties. Shuffles points so all edge - face intersections.

will be on the face interior. Points will be the new surface points. Returns number of iterations needed. (= nIters if still has degenerate cuts)

Definition at line 522 of file edgeIntersections.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAll, PrimitivePatch< Face, FaceList, PointField, PointType >::nEdges(), Foam::nl, Foam::Pout, rndGen(), List::setSize(), List::size(), triSurfaceSearch::surface(), and List::transfer().

Here is the call graph for this function:

◆ merge()

void merge ( const edgeIntersections subInfo,
const labelList edgeMap,
const labelList faceMap,
const bool  merge = true 
)

Merge (or override) edge intersection for a subset.

(given as edge map and face map - for face indices stored in pointIndexHit.index())

Definition at line 680 of file edgeIntersections.C.

References edgeIntersections::classification(), Foam::faceMap(), forAll, PointIndexHit< Point >::hit(), PointIndexHit< Point >::index(), merge(), PointIndexHit< Point >::rawPoint(), List::setSize(), and List::size().

Here is the call graph for this function:

Field Documentation

◆ classification_

labelListList classification_
private

For every entry in *this gives the edge classification result.

-1 : intersection not close to edge 0 : intersection close to e[0] 1 : intersection close to e[1] 2 : edge aligned with intersection face

Definition at line 71 of file edgeIntersections.H.

Referenced by edgeIntersections::classification().

◆ alignedCos_

scalar alignedCos_ = cos(degToRad(89.0))
static

Cosine between edge and face normal when considered parallel.

(note: should be private and make access- and set- function)

Definition at line 142 of file edgeIntersections.H.


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