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;
209 const scalar tol = 0.0
249 friend Istream&
operator>> <Point, PointRef>
255 friend Ostream& operator<< <Point, PointRef>
scalar sweptVol(const triangle &t) const
Return swept-volume.
A triangle primitive used to calculate face areas and swept volumes.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const Point & c() const
Return third vertex.
barycentric2D pointToBarycentric(const point &pt) const
Calculate the barycentric coordinates from the given point.
scalar mag() const
Return scalar magnitude.
scalar quality() const
Return quality: Ratio of triangle and circum-circle.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
pointHit nearestPointClassify(const point &p, label &nearType, label &nearLabel) const
Find the nearest point to p on the triangle and classify it:
Templated 2D Barycentric derived from VectorSpace. Has 3 components, one of which is redundant...
vector area() const
Return vector area.
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
Return types for classify.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Point centre() const
Return centre (centroid)
scalar circumRadius() const
Return circum-radius.
tensor inertia(PointRef refPt=vector::zero, scalar density=1.0) const
Return the inertia tensor, with optional reference.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
vector normal() const
Return unit normal.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
triangle(const Point &a, const Point &b, const Point &c)
Construct from three points.
Point barycentricToPoint(const barycentric2D &bary) const
Calculate the point from the given barycentric coordinates.
const Point & a() const
Return first vertex.
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.
Point circumCentre() const
Return circum-centre.
const Point & b() const
Return second vertex.
Point randomPoint(Random &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.
static const Vector< scalar > zero