58 template<
class Po
int,
class Po
intRef>
class triangle;
60 template<
class Po
int,
class Po
intRef>
67 template<
class Po
int,
class Po
intRef>
79 template<
class Po
int,
class Po
intRef>
101 inline triangle(
const Point&
a,
const Point&
b,
const Point&
c);
120 inline const Point&
a()
const;
123 inline const Point&
b()
const;
126 inline const Point&
c()
const;
132 inline Point
centre()
const;
138 inline scalar
mag()
const;
206 const scalar tol = 0.0
246 friend Istream&
operator>> <Point, PointRef>
252 friend Ostream& operator<< <Point, PointRef>
Templated 2D Barycentric derived from VectorSpace. Has 3 components, one of which is redundant.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A 2-tuple for storing two objects of different types.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
A triangle primitive used to calculate face areas and swept volumes.
barycentric2D pointToBarycentric(const point &pt) const
Calculate the barycentric coordinates from the given point.
triangle(const Point &a, const Point &b, const Point &c)
Construct from three points.
vector area() const
Return vector area.
Point barycentricToPoint(const barycentric2D &bary) const
Calculate the point from the given barycentric coordinates.
tensor inertia(PointRef refPt=vector::zero, scalar density=1.0) const
Return the inertia tensor, with optional reference.
scalar sweptVol(const triangle &t) const
Return swept-volume.
const Point & a() const
Return first vertex.
Point centre() const
Return centre (centroid)
pointHit nearestPointClassify(const point &p, label &nearType, label &nearLabel) const
Find the nearest point to p on the triangle and classify it:
proxType
Return types for classify.
pointHit ray(const point &p, const vector &q, const intersection::algorithm=intersection::algorithm::fullRay, const intersection::direction dir=intersection::direction::vector) const
Return point intersection with a ray.
const Point & c() const
Return third vertex.
scalar mag() const
Return scalar magnitude.
pointHit nearestPoint(const point &p) const
Return nearest point to p on triangle.
Tuple2< Point, scalar > circumCircle() const
Return the circum centre and radius.
Point randomPoint(randomGenerator &rndGen) const
Return a random point on the triangle from a uniform.
pointHit intersection(const point &p, const vector &q, const intersection::algorithm alg, const scalar tol=0.0) const
Fast intersection with a ray.
bool classify(const point &p, label &nearType, label &nearLabel) const
Classify nearest point to p in triangle plane.
vector normal() const
Return unit normal.
const Point & b() const
Return second vertex.
scalar quality() const
Return quality: Ratio of triangle and circum-circle.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
randomGenerator rndGen(653213)