58 meshPoints[
operator[](0)],
59 meshPoints[
operator[](1)],
60 meshPoints[
operator[](2)]
61 ).ray(
p,
n, alg, dir);
66 scalar nearestHitDist = GREAT;
67 scalar nearestMissDist = GREAT;
68 bool eligible =
false;
77 point nextPoint = ctr;
79 for (label pI = 0; pI <
nPoints; pI++)
81 nextPoint = meshPoints[
f[
fcIndex(pI)]];
90 ).ray(
p,
n, alg, dir);
101 else if (!nearest.
hit())
117 if (missDist < nearestMissDist)
119 nearestMissDist = missDist;
156 meshPoints[
operator[](0)],
157 meshPoints[
operator[](1)],
158 meshPoints[
operator[](2)]
159 ).intersection(
p, q, alg, tol);
162 scalar nearestHitDist = VGREAT;
175 meshPoints[
f[fcIndex(pI)]],
177 ).intersection(
p, q, alg, tol);
207 label nearLabel = -1;
209 return nearestPointClassify(
p, meshPoints, nearType, nearLabel);
226 meshPoints[
operator[](0)],
227 meshPoints[
operator[](1)],
228 meshPoints[
operator[](2)]
229 ).nearestPointClassify(
p, nearType, nearLabel);
232 const face&
f = *
this;
233 point ctr = centre(meshPoints);
243 point nextPoint = ctr;
245 for (label pI = 0; pI <
nPoints; pI++)
247 nextPoint = meshPoints[
f[fcIndex(pI)]];
249 label tmpNearType = -1;
250 label tmpNearLabel = -1;
293 nearLabel = pI + tmpNearLabel;
327 points[
operator[](size()/3)],
328 points[
operator[]((2*size())/3)]
Describes the interaction of a face and a point. It carries the info of a successful hit and (if succ...
void setHit() noexcept
Set the hit status on.
bool eligibleMiss() const noexcept
Is this an eligible miss.
scalar distance() const noexcept
Return distance to hit.
void setPoint(const point_type &p)
Set the point.
void setDistance(const scalar d) noexcept
Set the distance.
const point_type & missPoint() const
Return the miss point. Fatal if hit.
bool hit() const noexcept
Is there a hit.
void setMiss(const bool eligible) noexcept
Set the hit status off and set the eligible miss status.
const point_type & hitPoint() const
Return the hit point. Fatal if not hit.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
label size() const noexcept
The number of elements in the UList.
void size(const label n)
Older name for setAddressableSize.
label fcIndex(const label i) const noexcept
friend complex sign(const complex &c)
sgn() https://en.wikipedia.org/wiki/Sign_function#Complex_signum
A face is a list of labels corresponding to mesh vertices.
pointHit nearestPointClassify(const point &p, const UList< point > &meshPoints, label &nearType, label &nearLabel) const
Return nearest point to face and classify it:
pointHit nearestPoint(const point &p, const UList< point > &meshPoints) const
Return nearest point to face.
A reference point and direction.
A triangle primitive used to calculate face normals and swept volumes.
pointHit nearestPointClassify(const point &p, label &nearType, label &nearLabel) const
Find the nearest point to p on the triangle and classify it:
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
triangle< point, const point & > triPointRef
A triangle using referred points.
#define forAll(list, i)
Loop across all elements in list.