36bool Foam::triSurfaceSearch::checkUniqueHit
38 const pointIndexHit& currHit,
39 const UList<pointIndexHit>& hits,
47 const labelledTri&
f =
surface()[currHit.index()];
49 f.nearestPointClassify
61 const label nearPointi =
f[nearLabel];
68 const label pointFacei = pointFaces[pI];
70 if (pointFacei != currHit.index())
76 if (hit.index() == pointFacei)
91 const label edgeI = fEdges[nearLabel];
97 const label edgeFacei = edgeFaces[fI];
99 if (edgeFacei != currHit.index())
105 if (hit.index() == edgeFacei)
108 const vector currHitNormal =
111 const vector existingHitNormal =
114 const label signCurrHit =
115 pos0(currHitNormal & lineVec);
117 const label signExistingHit =
118 pos0(existingHitNormal & lineVec);
120 if (signCurrHit == signExistingHit)
159 Info<<
" using intersection tolerance " << tolerance_ <<
endl;
165 Info<<
" using maximum tree depth " << maxTreeDepth_ <<
endl;
173 const scalar tolerance,
174 const label maxTreeDepth
178 tolerance_(tolerance),
179 maxTreeDepth_(maxTreeDepth),
213 if (surface().size())
216 PatchTools::calcBounds(surface(), bb,
nPoints);
221 <<
"Surface does not have compact point numbering."
222 <<
" Of " << surface().points().
size()
224 <<
" are used. This might give problems in some routines."
272 if (!tree().bb().contains(
sample))
274 inside[sampleI] =
false;
278 inside[sampleI] =
true;
282 inside[sampleI] =
false;
307 info[i] = octree.findNearest
326 const scalar nearestDistSqr = 0.25*
magSqr(span);
328 return tree().findNearest(pt, nearestDistSqr);
348 info[i] = octree.findLine(start[i], end[i]);
387 info.setSize(start.
size());
439 info[pointi].transfer(hits);
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
void append(const T &val)
Copy append an element to the end of this list.
Minimal example by using system/controlDict.functions:
void setSize(const label n)
Alias for resize()
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
label index() const noexcept
Return the hit index.
bool hit() const noexcept
Is there a hit?
const Map< label > & meshPointMap() const
Mesh point map.
const Field< point_type > & faceNormals() const
Return face unit normals for patch.
const labelListList & pointFaces() const
Return point-face addressing.
const labelListList & edgeFaces() const
Return edge-face addressing.
const labelListList & faceEdges() const
Return face-edge addressing.
void size(const label n)
Older name for setAddressableSize.
const point & min() const
Minimum describing the bounding box.
const point & max() const
Maximum describing the bounding box.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
Non-pointer based hierarchical recursive searching.
static scalar & perturbTol()
Get the perturbation tolerance.
pointIndexHit findLineAny(const point &start, const point &end) const
Find any intersection of line between start and end.
label nearest() const
The nearest control point, or -1 if invalid.
Standard boundBox with extra functionality for use in octree.
treeBoundBox extend(Random &rndGen, const scalar s) const
Return slightly wider bounding box.
Encapsulation of data needed to search on PrimitivePatches.
Helper class to search on triSurface.
void findLineAll(const pointField &start, const pointField &end, List< List< pointIndexHit > > &info) const
Calculate all intersections from start to end.
boolList calcInside(const pointField &searchPoints) const
Calculate for each searchPoint inside/outside status.
const triSurface & surface() const
Return reference to the surface.
const indexedOctree< treeDataTriSurface > & tree() const
Demand driven construction of the octree.
~triSurfaceSearch()
Destructor.
void findLine(const pointField &start, const pointField &end, List< pointIndexHit > &info) const
void findLineAny(const pointField &start, const pointField &end, List< pointIndexHit > &info) const
void clearOut()
Clear storage.
void findNearest(const pointField &samples, const scalarField &nearestDistSqr, List< pointIndexHit > &info) const
Triangulated surface description with patch information.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
@ INSIDE
A location inside the volume.
#define WarningInFunction
Report a warning using Foam::Warning.
treeDataPrimitivePatch< triSurface > treeDataTriSurface
dimensionedScalar pos0(const dimensionedScalar &ds)
List< label > labelList
A List of labels.
quaternion normalised(const quaternion &q)
Return the normalised (unit) quaternion of the given quaternion.
PointIndexHit< point > pointIndexHit
A PointIndexHit for 3D points.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static constexpr const zero Zero
Global zero (0)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
#define forAll(list, i)
Loop across all elements in list.
scalarField samples(nIntervals, Zero)