59 meshPoints[
operator[](0)],
60 meshPoints[
operator[](1)],
61 meshPoints[
operator[](2)]
62 ).ray(
p,
n, alg, dir);
67 scalar nearestHitDist = GREAT;
68 scalar nearestMissDist = GREAT;
69 bool eligible =
false;
78 point nextPoint = ctr;
80 for (label pI = 0; pI <
nPoints; pI++)
82 nextPoint = meshPoints[
f[
fcIndex(pI)]];
91 ).ray(
p,
n, alg, dir);
101 else if (!nearest.
hit())
117 if (missDist < nearestMissDist)
119 nearestMissDist = missDist;
146 const UList<point>& meshPoints,
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);
183 nearestHitDist = curHit.distance();
184 nearest.hitPoint(curHit.point());
191 nearest.setDistance(nearestHitDist);
201 const UList<point>& meshPoints
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;
244 for (label pI = 0; pI <
nPoints; pI++)
246 nextPoint = meshPoints[
f[fcIndex(pI)]];
248 label tmpNearType = -1;
249 label tmpNearLabel = -1;
259 pointHit curHit = tri.nearestPointClassify
268 nearest.setDistance(curHit.distance());
292 nearLabel = pI + tmpNearLabel;
297 nearest.hitPoint(curHit.point());
302 nearest.setMiss(
true);
303 nearest.setPoint(curHit.point());
315 const UList<point>&
points,
325 points[
operator[](size()/3)],
326 points[
operator[]((2*size())/3)]
void size(const label n)
Older name for setAddressableSize.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
void setPoint(const point_type &p)
Set the point.
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.
#define forAll(list, i)
Loop across all elements in list.
label fcIndex(const label i) const noexcept
The forward circular index. The next index in the list which returns to the first at the end of the l...
bool hit() const noexcept
Is there a hit.
pointField points(const UList< point > &pts) const
Return the points corresponding to this face.
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 at p, direction n (does not need to be no...
int sign(const point &p, const UList< point > &points, const scalar tol=SMALL) const
The sign for the side of the face plane the point is on, using three evenly distributed face points f...
void setDistance(const scalar d) noexcept
Set the distance.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
Describes the interaction of a object and a (templated) point. It carries the info of a successful hi...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void setMiss(const bool eligible) noexcept
Set the hit status off and set the eligible miss status.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
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.
vector point
Point is a vector.
const point_type & hitPoint() const
Return the hit point. Fatal if not hit.
scalar distance() const noexcept
Return distance to hit.
triangle< point, const point & > triPointRef
A triangle using referred points.
const point_type & point() const noexcept
Return the point, no checks.
label size() const noexcept
The number of elements in the UList.
bool eligibleMiss() const noexcept
Is this an eligible miss.
List< label > labelList
A List of labels.
PointHit< point > pointHit
A PointHit with a 3D point.