40 #ifndef Foam_triangle_H 41 #define Foam_triangle_H 65 template<
class Po
int,
class Po
intRef>
66 inline Istream&
operator>>(Istream&, triangle<Point, PointRef>&);
68 template<
class Po
int,
class Po
intRef>
69 inline Ostream& operator<<(Ostream&, const triangle<Point, PointRef>&);
89 void front() =
delete;
162 inline scalar
mag()
const;
182 template<
class Po
int,
class Po
intRef>
258 inline static point planeIntersection
267 template<
class AboveOp,
class BelowOp>
268 inline static void triSliceWithPlane
351 inline static Pair<Point>
box 379 inline scalar
mag()
const;
382 inline Pair<Point>
box()
const;
414 PointRef refPt =
Zero,
476 const scalar tol = 0.0
519 inline int sign(
const point&
p,
const scalar tol = SMALL)
const;
522 template<
class AboveOp,
class BelowOp>
533 template<
class Ins
ideOp,
class Outs
ideOp>
551 friend Ostream& operator<< <Point, PointRef>
scalar sweptVol(const triangle &t) const
Return swept-volume.
const point & c() const noexcept
The third vertex.
A triangle primitive used to calculate face normals and swept volumes. Uses referred points...
barycentric2D pointToBarycentric(const point &pt) const
Calculate the barycentric coordinates from the given point.
A 1D vector of objects of type <T> with a fixed length <N>.
scalar mag() const
The magnitude of the triangle area.
vector vecC() const
Edge vector opposite point c(): from a() to b()
scalar quality() const
Return quality: Ratio of triangle and circum-circle.
void sliceWithPlane(const plane &pln, AboveOp &aboveOp, BelowOp &belowOp) const
Decompose triangle into triangles above and below plane.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Pair< Point > box() const
The enclosing (bounding) box for the triangle.
vector vecB() const
Edge vector opposite point b(): from c() to a()
tensor inertia(PointRef refPt=Zero, scalar density=1.0) const
Return the inertia tensor, with optional reference.
const Point & a() const noexcept
The first vertex.
Point point_type
The point type.
pointHit nearestPointClassify(const point &p, label &nearType, label &nearLabel) const
Find the nearest point to p on the triangle and classify it:
triPointRef tri() const
Return as triangle reference.
void flip()
Flip triangle orientation by swapping second and third vertices.
triPoints()=default
Default construct.
Geometric class that creates a 3D plane and can return the intersection point between a line and the ...
const Point & c() const noexcept
The third vertex.
int sign(const point &p, const scalar tol=SMALL) const
The sign for which side of the face plane the point is on.
Point vecB() const
Edge vector opposite point b(): from c() to a()
Templated 2D Barycentric derived from VectorSpace. Has 3 components, one of which is redundant...
FOAM_DEPRECATED_FOR(2018-12, "areaNormal() or unitNormal()") vector normal() const
Legacy name for areaNormal().
void back()=delete
The back() accessor (from FixedList) has no purpose.
triangle(const Point &p0, const Point &p1, const Point &p2)
Construct from three points.
bool classify(const point &p, label &nearType, label &nearLabel) const
Classify nearest point to p in triangle plane.
pointHit nearestPoint(const point &p) const
Return nearest point to p on triangle.
proxType
Proximity classifications.
vector unitNormal() const
Return unit normal.
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.
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
const Point & b() const noexcept
The second vertex.
Point vecA() const
Edge vector opposite point a(): from b() to c()
Istream & operator>>(Istream &, directionInfo &)
Triangle point storage. Default constructable (triangle is not)
FixedList< triPoints, 27 > triIntersectionList
Storage type for triangles originating from intersecting triangle with another triangle.
void operator()(const triPoints &)
Point centre() const
Return centre (centroid)
void operator()(const triPoints &)
scalar mag() const
The magnitude of the triangle area.
Describes the interaction of a object and a (templated) point. It carries the info of a successful hi...
scalar circumRadius() const
Return circum-radius.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
storeOp(triIntersectionList &, label &)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
void front()=delete
The front() accessor (from FixedList) has no purpose.
vector areaNormal() const
The area normal - with magnitude equal to area of triangle.
const point & a() const noexcept
The first vertex.
Point barycentricToPoint(const barycentric2D &bary) const
Calculate the point from the given barycentric coordinates.
bool intersects(const point &origin, const vector &normal) const
Fast intersection detection with a plane.
void triangleOverlap(const vector &n, const triangle< Point, PointRef > &tri, InsideOp &insideOp, OutsideOp &outsideOp) const
Decompose triangle into triangles inside and outside.
Pair< point > box() const
The enclosing (bounding) box for the triangle.
Point vecC() const
Edge vector opposite point c(): from a() to b()
Point circumCentre() const
Return circum-centre.
vector vecA() const
Edge vector opposite point a(): from b() to c()
Point randomPoint(Random &rndGen) const
Return a random point on the triangle from a uniform distribution.
components
Component labeling enumeration.
pointHit intersection(const point &p, const vector &q, const intersection::algorithm alg, const scalar tol=0.0) const
Fast intersection with a ray.
Tensor of scalars, i.e. Tensor<scalar>.
const point & b() const noexcept
The second vertex.
vector unitNormal() const
Return unit normal.
void operator()(const triPoints &)
const volScalarField & p0
point centre() const
Return centre (centroid)
triIntersectionList & tris_
vector areaNormal() const
The area normal - with magnitude equal to area of triangle.
static constexpr const zero Zero
Global zero (0)