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())
112 if (missDist < nearestMissDist)
114 nearestMissDist = missDist;
141 const UList<point>& meshPoints,
151 meshPoints[
operator[](0)],
152 meshPoints[
operator[](1)],
153 meshPoints[
operator[](2)]
154 ).intersection(
p, q, alg, tol);
157 scalar nearestHitDist = VGREAT;
170 meshPoints[
f[fcIndex(pI)]],
172 ).intersection(
p, q, alg, tol);
178 nearestHitDist = curHit.distance();
179 nearest.hitPoint(curHit.point());
186 nearest.setDistance(nearestHitDist);
196 const UList<point>& meshPoints
201 label nearLabel = -1;
203 return nearestPointClassify(
p, meshPoints, nearType, nearLabel);
220 meshPoints[
operator[](0)],
221 meshPoints[
operator[](1)],
222 meshPoints[
operator[](2)]
223 ).nearestPointClassify(
p, nearType, nearLabel);
226 const face&
f = *
this;
227 point ctr = centre(meshPoints);
237 point nextPoint = ctr;
239 for (label pI = 0; pI <
nPoints; pI++)
241 nextPoint = meshPoints[
f[fcIndex(pI)]];
243 label tmpNearType = -1;
244 label tmpNearLabel = -1;
254 pointHit curHit = tri.nearestPointClassify
263 nearest.setDistance(curHit.distance());
287 nearLabel = pI + tmpNearLabel;
292 nearest.hitPoint(curHit.point());
297 nearest.setMiss(
true);
298 nearest.setPoint(curHit.point());
310 const UList<point>&
points,
320 points[
operator[](size()/3)],
321 points[
operator[]((2*size())/3)]
void size(const label n)
Older name for setAddressableSize.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &f1)
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.
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...
label size() const noexcept
The number of elements in the container.
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.
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.