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 setMiss(const bool eligible)
pointHit nearestPoint(const point &p, const UList< point > &meshPoints) const
Return nearest point to face.
bool hit() const
Is there a hit.
#define forAll(list, i)
Loop across all elements in list.
A triangle primitive used to calculate face normals and swept volumes.
scalar distance() const
Return distance to hit.
bool eligibleMiss() const
Is this an eligible miss.
void setPoint(const Point &p)
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
Return potential intersection with face with a ray starting.
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.
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.
const Point & missPoint() const
Return miss point.
pointHit nearestPointClassify(const point &p, const UList< point > &meshPoints, label &nearType, label &nearLabel) const
Return nearest point to face and classify it:
const Point & hitPoint() const
Return hit point.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
triangle< point, const point & > triPointRef
void setDistance(const scalar d)