encodes a point inside a triangle using barycentric coordinates More...
#include <MRTriPoint.h>
Public Member Functions | |
| constexpr | TriPoint () noexcept |
| TriPoint (NoInit) noexcept | |
| constexpr | TriPoint (T a, T b) noexcept |
| template<typename U > | |
| constexpr | TriPoint (const TriPoint< U > &s) |
| TriPoint (const Vector3< T > &p, const Vector3< T > &v0, const Vector3< T > &v1, const Vector3< T > &v2) | |
| given a point coordinates and triangle (v0,v1,v2) computes barycentric coordinates of the point | |
| TriPoint (const Vector3< T > &p, const Vector3< T > &v1, const Vector3< T > &v2) | |
| given a point coordinates and triangle (0,v1,v2) computes barycentric coordinates of the point | |
| template<typename U > | |
| U | interpolate (const U &v0, const U &v1, const U &v2) const |
| given three values in three vertices, computes interpolated value at this barycentric coordinates | |
| TriPoint | lnext () const |
| represents the same point relative to next edge in the same triangle | |
| constexpr int | inVertex () const |
| returns [0,2] if the point is in a vertex or -1 otherwise | |
| constexpr int | onEdge () const |
| constexpr bool | operator== (const TriPoint &rhs) const =default |
| returns true if two points have equal (a,b) representation | |
Public Attributes | |
| T | a |
| a in [0,1], a=0 => point is on [v2,v0] edge, a=1 => point is in v1 | |
| T | b |
| b in [0,1], b=0 => point is on [v0,v1] edge, b=1 => point is in v2 | |
Static Public Attributes | |
| static constexpr auto | eps = SegmPoint<T>::eps |
encodes a point inside a triangle using barycentric coordinates
Notations used below: v0, v1, v2 - points of the triangle
|
inlineconstexprnoexcept |
|
inlineexplicitnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexpr |
|
inline |
given a point coordinates and triangle (v0,v1,v2) computes barycentric coordinates of the point
| MR::TriPoint< T >::TriPoint | ( | const Vector3< T > & | p, |
| const Vector3< T > & | v1, | ||
| const Vector3< T > & | v2 ) |
given a point coordinates and triangle (0,v1,v2) computes barycentric coordinates of the point
|
inline |
given three values in three vertices, computes interpolated value at this barycentric coordinates
|
constexpr |
returns [0,2] if the point is in a vertex or -1 otherwise
|
inlinenodiscard |
represents the same point relative to next edge in the same triangle
|
constexpr |
returns [0,2] if the point is on edge or -1 otherwise: 0 means edge [v1,v2]; 1 means edge [v2,v0]; 2 means edge [v0,v1]
|
nodiscardconstexprdefault |
returns true if two points have equal (a,b) representation
| T MR::TriPoint< T >::a |
a in [0,1], a=0 => point is on [v2,v0] edge, a=1 => point is in v1
barycentric coordinates: a+b in [0,1], a+b=0 => point is in v0, a+b=1 => point is on [v1,v2] edge
| T MR::TriPoint< T >::b |
b in [0,1], b=0 => point is on [v0,v1] edge, b=1 => point is in v2
|
staticconstexpr |