|
UFO 1.0.0
An Efficient Probabilistic 3D Mapping Framework That Embraces the Unknown
|
Triangle in Dim-dimensional space. More...
#include <lib/geometry/include/ufo/geometry/triangle.hpp>
Public Types | |
| using | value_type = T |
Public Member Functions | |
| constexpr | Triangle () noexcept=default |
| Default constructor. | |
| constexpr | Triangle (Triangle const &) noexcept=default |
| Copy constructor. | |
| template<std::convertible_to< T > U> | |
| constexpr | Triangle (Triangle< Dim, U > const &other) noexcept |
| Converting constructor from a triangle with a different scalar type. | |
| constexpr | Triangle (Vec< Dim, T > point_1, Vec< Dim, T > point_2, Vec< Dim, T > point_3) noexcept |
| Constructs a triangle from three points. | |
| constexpr AABB< Dim, T > | aabb () const noexcept |
| Returns the AABB of the triangle. | |
| constexpr T | area () const noexcept |
| Returns the area of the triangle. | |
| constexpr Vec< Dim, T > | center () const noexcept |
| Returns the centroid (arithmetic mean) of the triangle. | |
| constexpr T | diameter () const noexcept |
| Returns the diameter of the triangle. | |
| constexpr bool | isDegenerate (T eps=std::numeric_limits< T >::epsilon()) const noexcept |
| Returns true if the triangle is degenerate. | |
| constexpr Vec< 3, T > | normal () const noexcept |
| Returns the surface unit normal of the triangle. | |
| bool | operator== (Triangle const &) const =default |
| Equality operator. | |
| constexpr auto & | operator[] (this auto &self, std::size_t pos) noexcept |
| Returns the vertex at position pos. | |
| constexpr T | volume () const noexcept |
| Returns the volume of the triangle. | |
Static Public Member Functions | |
| static constexpr std::size_t | dimension () noexcept |
| Returns the dimensionality of the triangle. | |
Public Attributes | |
| std::array< Vec< Dim, T >, 3 > | points |
| The vertices of the triangle. | |
Triangle in Dim-dimensional space.
| Dim | The dimensionality of the space (default: 3). |
| T | The numeric type (default: float), must be a floating-point type. |
Represents a triangle defined by three points.
Definition at line 70 of file triangle.hpp.
| using ufo::Triangle< Dim, T >::value_type = T |
Definition at line 71 of file triangle.hpp.
|
inlineconstexprnoexcept |
Constructs a triangle from three points.
| [in] | point_1 | The first point. |
| [in] | point_2 | The second point. |
| [in] | point_3 | The third point. |
Definition at line 94 of file triangle.hpp.
|
inlineexplicitconstexprnoexcept |
Converting constructor from a triangle with a different scalar type.
| U | The scalar type of the other triangle. |
| [in] | other | The other triangle. |
Definition at line 106 of file triangle.hpp.
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
Returns the area of the triangle.
Uses the general formula for a triangle in N-dimensional space.
Definition at line 142 of file triangle.hpp.
|
inlineconstexprnoexcept |
Returns the centroid (arithmetic mean) of the triangle.
Definition at line 131 of file triangle.hpp.
|
inlineconstexprnoexcept |
Returns the diameter of the triangle.
Definition at line 197 of file triangle.hpp.
|
inlinestaticconstexprnoexcept |
Returns the dimensionality of the triangle.
Definition at line 115 of file triangle.hpp.
|
inlineconstexprnoexcept |
Returns true if the triangle is degenerate.
| [in] | eps | The epsilon value for the check. |
A triangle is degenerate if its area is effectively zero.
Definition at line 181 of file triangle.hpp.
|
inlineconstexprnoexcept |
Returns the surface unit normal of the triangle.
This method is only available for 3D triangles.
Definition at line 168 of file triangle.hpp.
|
inlineconstexprnoexcept |
Returns the vertex at position pos.
| [in] | pos | The position of the vertex [0..2]. |
Definition at line 122 of file triangle.hpp.
|
inlineconstexprnoexcept |
Returns the volume of the triangle.
Definition at line 191 of file triangle.hpp.
| std::array<Vec<Dim, T>, 3> ufo::Triangle< Dim, T >::points |
The vertices of the triangle.
Definition at line 76 of file triangle.hpp.