Go to the documentation of this file.
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;
277 if (tmpNearType == triPointRef::EDGE && tmpNearLabel == 0)
286 else if (tmpNearType == triPointRef::POINT && tmpNearLabel < 2)
293 nearLabel = pI + tmpNearLabel;
327 points[
operator[](size()/3)],
328 points[
operator[]((2*size())/3)]
void setHit() noexcept
Set the hit status on.
void setMiss(const bool eligible) noexcept
Set the hit status off and set the eligible miss status.
pointHit nearestPoint(const point &p, const UList< point > &meshPoints) const
Return nearest point to face.
void setDistance(const scalar d) noexcept
Set the distance.
Describes the interaction of a face and a point. It carries the info of a successful hit and (if succ...
scalar distance() const noexcept
Return distance to hit.
const point_type & hitPoint() const
Return the hit point. Fatal if not hit.
#define forAll(list, i)
Loop across all elements in list.
A triangle primitive used to calculate face normals and swept volumes.
bool eligibleMiss() const noexcept
Is this an eligible miss.
const point_type & missPoint() const
Return the miss point. Fatal if hit.
pointHit ray(const point &p, const vector &n, const UList< point > &meshPoints, const intersection::algorithm alg=intersection::FULL_RAY, const intersection::direction dir=intersection::VECTOR) const
pointHit intersection(const point &p, const vector &q, const point &ctr, const UList< point > &meshPoints, const intersection::algorithm alg, const scalar tol=0.0) const
Fast intersection with a ray.
void setPoint(const point_type &p)
Set the point.
pointHit nearestPointClassify(const point &p, label &nearType, label &nearLabel) const
Find the nearest point to p on the triangle and classify it:
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
int sign(const point &p, const UList< point > &points, const scalar tol=SMALL) const
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:
bool hit() const noexcept
Is there a hit.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
triangle< point, const point & > triPointRef
A triangle using referred points.