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)]
157 scalar nearestHitDist = VGREAT;
170 meshPoints[
f[fcIndex(pI)]],
178 nearestHitDist = curHit.distance();
196 const UList<point>& meshPoints
201 label nearLabel = -1;
220 meshPoints[
operator[](0)],
221 meshPoints[
operator[](1)],
222 meshPoints[
operator[](2)]
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
287 nearLabel = pI + tmpNearLabel;
320 points[
operator[](size()/3)],
321 points[
operator[]((2*size())/3)]
bool eligibleMiss() const noexcept
Is this an eligible miss.
scalar distance() const noexcept
Return distance to hit.
void setPoint(const point_type &p)
Set the point.
void setDistance(const scalar d) noexcept
Set the distance.
bool hit() const noexcept
Is there a hit.
void setMiss(const bool eligible) noexcept
Set the hit status off and set the eligible miss status.
const point_type & point() const noexcept
Return the point, no checks.
const point_type & hitPoint() const
Return the hit point. Fatal if not hit.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
label size() const noexcept
label fcIndex(const label i) const noexcept
scalar dist(const Vector< Cmpt > &v2) const
The L2-norm distance from another vector. The mag() of the difference.
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...
pointHit nearestPointClassify(const point &p, const UList< point > &meshPoints, label &nearType, label &nearLabel) const
Return nearest point to face and classify it:
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 nearestPoint(const point &p, const UList< point > &meshPoints) const
Return nearest point to face.
point centre(const UList< point > &points) const
Centre point of face.
pointField points(const UList< point > &pts) const
Return the points corresponding to this face.
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...
constexpr face() noexcept=default
Default construct.
pointHit nearestPointClassify(const point &p, label &nearType, label &nearLabel) const
Find the nearest point to p on the triangle and classify it:
pointHit ray(const point &p, const vector &q, const intersection::algorithm=intersection::FULL_RAY, const intersection::direction dir=intersection::VECTOR) const
Return point intersection with a ray.
pointHit intersection(const point &p, const vector &q, const intersection::algorithm alg, const scalar tol=0.0) const
Fast intersection with a ray.
int sign(const point &p, const scalar tol=SMALL) const
The sign for which side of the face plane the point is on.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
PointHit< point > pointHit
A PointHit with a 3D point.
List< label > labelList
A List of labels.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
vector point
Point is a vector.
triangle< point, const point & > triPointRef
A triangle using referred points.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &f1, const label comm)
#define forAll(list, i)
Loop across all elements in list.