56 meshPoints[
operator[](0)],
57 meshPoints[
operator[](1)],
58 meshPoints[
operator[](2)]
59 ).ray(p, n, alg, dir);
64 scalar nearestHitDist = GREAT;
66 scalar nearestMissDist = GREAT;
67 bool eligible =
false;
76 point nextPoint = ctr;
80 nextPoint = meshPoints[f[fcIndex(pI)]];
89 ).ray(p, n, alg, dir);
100 else if (!nearest.
hit())
116 if (missDist < nearestMissDist)
118 nearestMissDist = missDist;
155 meshPoints[
operator[](0)],
156 meshPoints[
operator[](1)],
157 meshPoints[
operator[](2)]
158 ).intersection(p, q, alg, tol);
161 scalar nearestHitDist = VGREAT;
174 meshPoints[f[fcIndex(pI)]],
176 ).intersection(p, q, alg, tol);
206 label nearLabel = -1;
208 return nearestPointClassify(p, meshPoints, nearType, nearLabel);
225 meshPoints[
operator[](0)],
226 meshPoints[
operator[](1)],
227 meshPoints[
operator[](2)]
228 ).nearestPointClassify(p, nearType, nearLabel);
231 const face&
f = *
this;
232 point ctr = centre(meshPoints);
242 point nextPoint = ctr;
246 nextPoint = meshPoints[f[fcIndex(pI)]];
248 label tmpNearType = -1;
249 label tmpNearLabel = -1;
276 if (tmpNearType == triPointRef::EDGE && tmpNearLabel == 0)
285 else if (tmpNearType == triPointRef::POINT && tmpNearLabel < 2)
292 nearLabel = pI + tmpNearLabel;
pointHit intersection(const point &p, const vector &q, const point &ctr, const pointField &, const intersection::algorithm alg, const scalar tol=0.0) const
Fast intersection with a ray.
#define forAll(list, i)
Loop across all elements in list.
A triangle primitive used to calculate face normals and swept volumes.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A face is a list of labels corresponding to mesh vertices.
const Point & missPoint() const
Return miss point.
void size(const label)
Override size to be inconsistent with allocated storage.
bool eligibleMiss() const
Is this an eligible miss.
scalar distance() const
Return distance to hit.
void setDistance(const scalar d)
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
void setMiss(const bool eligible)
pointHit nearestPoint(const point &p, const pointField &) const
Return nearest point to face.
pointHit ray(const point &p, const vector &n, const pointField &, const intersection::algorithm alg=intersection::FULL_RAY, const intersection::direction dir=intersection::VECTOR) const
Return potential intersection with face with a ray starting.
pointHit nearestPointClassify(const point &p, const pointField &, label &nearType, label &nearLabel) const
Return nearest point to face and classify it:
const Point & hitPoint() const
Return hit point.
triangle< point, const point & > triPointRef
dimensioned< scalar > mag(const dimensioned< Type > &)
bool hit() const
Is there a hit.
void setPoint(const Point &p)
pointHit nearestPointClassify(const point &p, label &nearType, label &nearLabel) const
Find the nearest point to p on the triangle and classify it: