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;
135 inline scalar
mag()
const;
203 const scalar tol = 0.0
243 friend Istream&
operator>> <Point, PointRef>
249 friend Ostream& operator<< <Point, PointRef>
tensor inertia(PointRef refPt=vector::zero, scalar density=1.0) const
Return the inertia tensor, with optional reference.
cachedRandom rndGen(label(0),-1)
A triangle primitive used to calculate face normals 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.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
scalar barycentric(const point &pt, List< scalar > &bary) const
Calculate the barycentric coordinates of the given.
bool classify(const point &p, label &nearType, label &nearLabel) const
Classify nearest point to p in triangle plane.
scalar quality() const
Return quality: Ratio of triangle and circum-circle.
Point randomPoint(Random &rndGen) const
Return a random point on the triangle from a uniform.
scalar sweptVol(const triangle &t) const
Return swept-volume.
proxType
Return types for classify.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
const Point & a() const
Return first vertex.
Point centre() const
Return centre (centroid)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Simple random number generator.
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.
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.
const Point & b() const
Return second vertex.
Point circumCentre() const
Return circum-centre.
static const Vector< scalar > zero
scalar circumRadius() const
Return circum-radius.
pointHit intersection(const point &p, const vector &q, const intersection::algorithm alg, const scalar tol=0.0) const
Fast intersection with a ray.
pointHit nearestPoint(const point &p) const
Return nearest point to p on triangle.
pointHit nearestPointClassify(const point &p, label &nearType, label &nearLabel) const
Find the nearest point to p on the triangle and classify it:
scalar mag() const
Return scalar magnitude.
vector normal() const
Return vector normal.