|
AXOM_HOST_DEVICE | Octahedron () |
| Default constructor. Creates a degenerate octahedron. More...
|
|
AXOM_HOST_DEVICE | Octahedron (const PointType &p, const PointType &q, const PointType &r, const PointType &s, const PointType &t, const PointType &u) |
| Creates an octahedron from the 6 points p,q,r,s,t,u. More...
|
|
AXOM_HOST_DEVICE PointType & | operator[] (int idx) |
| Index operator to get the i^th vertex. More...
|
|
AXOM_HOST_DEVICE const PointType & | operator[] (int idx) const |
| Index operator to get the i^th vertex. More...
|
|
AXOM_HOST_DEVICE bool | equals (const Octahedron &other, double eps=1.e-24) const |
| Test if this Octahedron is equal to another, within a tolerance. More...
|
|
std::ostream & | print (std::ostream &os) const |
| Simple formatted print of an octahedron instance. More...
|
|
template<typename T, int NDIMS = 3>
class axom::primal::Octahedron< T, NDIMS >
Represents an octahedral geometric shape defined by six points.
- Template Parameters
-
T | the coordinate type, e.g., double, float, etc. |
NDIMS | the number of spatial dimensions |
There are six vertices in the octahedron, labelled P through U as the constructor's arguments. They are accessible using the square-brackets operator, with P being index 0, Q index 1, through U as index 5.
Imagine a regular octahedron with two parallel triangles, top and bottom— the end-caps, as it were. If you look "down", normal to the end-cap triangles, you will see that the vertices of the top triangle protrude beyond the edges of the bottom triangle (and vice versa). Here's a diagram showing just the end-cap triangles, omitting the other edges for clarity.
*
* P
* /\
* Q -------- U
* \ /
* /\ /\
* R --\ /-- T
* \/
* S
*
*
Now imagine looking from the side, edge-on to the end-caps. If you unroll the "side-wall" triangles, you get a triangle strip. Here's another diagram showing just the triangle strip, with the same points labeled. Points P and Q are repeated so we can show all eight faces.
*
* Q --- S --- U --- Q
* / \ / \ / \ /
* / \ / \ / \ /
* P --- R --- T --- P
*
*