|
OpenBEM
Open-source framework for electromagnetic simulation with the boundary element method.
|
Triangle primitive class. More...
#include <triangle.hpp>
Triangle primitive class.
| dim | - The dimension of the triangle (2 or 3). |
Definition at line 44 of file triangle.hpp.
|
inline |
Constructs a default reference Triangle object.
Definition at line 51 of file triangle.hpp.
|
inline |
Constructs a Triangle with given vertices.
| [in] | v | - Vertices of the triangle. |
| [in] | edge_polarities | - Polarity of each edge of the triangle (optional). |
Definition at line 63 of file triangle.hpp.
|
inline |
Constructs a Triangle with given vertices.
| [in] | v_array | - Array of vertices of the triangle. |
| [in] | edge_polarities | - Polarity of each edge of the triangle (optional). |
Definition at line 78 of file triangle.hpp.
| void bem::Triangle< dim >::set_v | ( | ConstEigRef< EigMatMN< Float, dim, 3 > > | v, |
| EigRowVecN< Float, 3 > | edge_polarities = EigRowVecN<Float, 3>::Constant(1, 3, 1) |
||
| ) |
Sets the vertices of this Triangle.
| [in] | v | - Vertices of the triangle. |
| [in] | edge_polarities | - Polarity of each edge of the triangle (optional). |
Definition at line 33 of file triangle.cpp.
Returns the vertices of this Triangle.
Definition at line 106 of file triangle.hpp.
|
inline |
Returns the vertex of this Triangle at a given index.
| [in] | idx | - Index of the desired vertex (0, 1, or 2). |
Definition at line 117 of file triangle.hpp.
|
inline |
Returns the edge polarities of this Triangle.
Definition at line 129 of file triangle.hpp.
Returns the edge polarity of this Triangle at a given index.
| [in] | idx | - Index of the desired edge (0, 1, or 2). |
Definition at line 140 of file triangle.hpp.
|
inline |
Reverses the orientation of this Triangle.
Definition at line 151 of file triangle.hpp.
|
inline |
Returns the area of this Triangle.
Definition at line 162 of file triangle.hpp.
|
inline |
Returns the unit normal vector for this Triangle.
Definition at line 170 of file triangle.hpp.
|
inline |
Returns the centroid of this Triangle.
Definition at line 178 of file triangle.hpp.
|
inline |
Returns the mean edge length of this Triangle.
Definition at line 186 of file triangle.hpp.
| Triangle< 2 > bem::Triangle< dim >::to_2d | ( | ) | const |
Returns an equivalent triangle with coordinates in a local 2D system, with the local origin at this triangle's first vertex, and with its edge connecting the first two vertices lying along the local x axis.
Triangle with coordinates in a local 2D system. Definition at line 48 of file triangle.cpp.
Adds a 0-valued third dimension if this Triangle is in 2D, otherwise just returns a copy of this Triangle.
Triangle. Definition at line 74 of file triangle.cpp.
|
inline |
Returns the local origin of this Triangle in the global coordinate system. The local origin is just the first vertex of the triangle.
Definition at line 217 of file triangle.hpp.
| EigMatMN< Float, dim, dim > bem::Triangle< dim >::local_coordinate_basis | ( | ) | const |
Returns the unit vectors of a local coordinate system, defined in the global system, such that the edge connecting the first two vertices lie along the local x axis, and the Triangle lies in the local xy plane.
Definition at line 83 of file triangle.cpp.
| void bem::Triangle< dim >::get_plane_projection | ( | EigMatNX< Float, dim > & | r_proj, |
| EigRowVec< Float > & | d, | ||
| ConstEigRef< EigMatNX< Float, 3 > > | r, | ||
| uint8_t | ref_idx = 0 |
||
| ) | const |
Returns the projection of given points on to the triangle's plane, along with the normal distance to the plane. For a 2D Triangle, its third (z) dimension is assumed to be 0.
| [out] | r_proj | - Projected points. |
| [out] | d | - Perpendicular distances of the original points to the triangle's plane. |
| [in] | r | - Points to be projected onto the triangle's plane. |
| [in] | ref_idx | - Index of the reference vertex to be used for the projection (optional). |
Definition at line 111 of file triangle.cpp.
|
static |
Returns a reference triangle in the specified dimension.
Definition at line 129 of file triangle.cpp.
|
inline |
Returns the lengths of each edge of this Triangle.
Definition at line 259 of file triangle.hpp.
|
inline |
Returns the index associated with the longest edge of this Triangle.
Definition at line 272 of file triangle.hpp.
|
inline |
Returns the index associated with the shortest edge of this Triangle.
Definition at line 285 of file triangle.hpp.
|
inline |
Length of the longest edge of this Triangle.
Definition at line 298 of file triangle.hpp.
|
inline |
Length of the shortest edge of this Triangle.
Definition at line 308 of file triangle.hpp.
| EigMatNX< Float, 3 > bem::Triangle< dim >::barycentric_coords | ( | ConstEigRef< EigMatNX< Float, dim > > | p | ) | const |
Returns barycentric coordinates of given points lying in the Triangle's plane.
| [in] | p | - Points in the triangle's plane for which to compute barycentric coordinates. |
Definition at line 141 of file triangle.cpp.
| EigRowVec< uint8_t > bem::Triangle< dim >::projection_loc | ( | ConstEigRef< EigMatNX< Float, 3 > > | r | ) | const |
Returns flags that indicate whether the given points project inside or outside the triangle, or onto a vertex or edge.
| [in] | r | - Points to be projected. |
Definition at line 172 of file triangle.cpp.
| bool bem::Triangle< dim >::point_in_triangle | ( | ConstEigRef< EigColVecN< Float, dim > > | r, |
| const Float | tol = TRIANGLE_DEFAULT_TOL |
||
| ) | const |
Checks whether a given point is inside the triangle, inclusive of edges and vertices.
| [in] | r | - Point to be tested. |
| [in] | tol | - Comparison tolerance (optional). |
Definition at line 241 of file triangle.cpp.
|
inline |
Performs an affine transform to map points lying in this triangle's plane to the output triangle's plane.
| dim_out | - Output triangle's dimension (2 or 3). |
| [in] | points | - Coordinates in this triangle's plane. |
| [in] | tri_out | - Target Triangle into whose plane points will be mapped. |
tri_out's plane. Definition at line 349 of file triangle.hpp.
|
static |
Computes the area of the triangle formed by the given vertices.
| [in] | v | - Vertices. |
Definition at line 287 of file triangle.cpp.
|
static |
Computes the unit normal vector for the triangle formed by the given vertices.
| [in] | v | - Vertices. |
Definition at line 307 of file triangle.cpp.
|
inlinestatic |
Computes the centroid of the triangle formed by the given vertices.
| [in] | v | - Vertices. |
Definition at line 383 of file triangle.hpp.
Definition at line 389 of file triangle.hpp.
|
protected |
Definition at line 390 of file triangle.hpp.
|
protected |
Definition at line 391 of file triangle.hpp.
|
protected |
Definition at line 392 of file triangle.hpp.
|
protected |
Definition at line 393 of file triangle.hpp.