Core 1.0
|
A cuboctahedron is a polyhedron with 8 triangular faces and 6 square faces. More...
#include <cuboctahedron.h>
Public Member Functions | |
Cuboctahedron (const Vector &, const double &) | |
Creates a cuboctahedron. More... | |
Cuboctahedron (const double &) | |
Creates a cuboctahedron. More... | |
double | Volume () const |
Compute the volume of the cuboctahedron. | |
double | Area () const |
Compute the area of the cuboctahedron. | |
Vector | Vertex (int) const |
Return the i-th vertex as a vector. | |
Vector | Vertex (int, int) const |
Return the j-th vertex of the i-th face. | |
Vector | Normal (int) const |
Return the normal of the i-th face. More... | |
bool | Inside (const Vector &) const |
Check if a point is inside a cuboctahedron. More... | |
double | Signed (const Vector &) const |
Compute the signed distance approximation. More... | |
Box | GetBox () const |
Return the bounding box of the cuboctahedron. | |
Static Public Member Functions | |
static constexpr int | VertexIndex (int, int) |
Return the index of the j-th vertex of the i-th face. | |
Protected Member Functions | |
double | EdgeLength () const |
Compute the length of an edge. | |
Protected Attributes | |
Vector | c = Vector::Null |
Center. | |
double | r = 1.0 |
Radius. | |
Static Protected Attributes | |
static const int | face [20][3] |
Array of triangles. | |
static const Vector | vertex [12] |
Array of vertices. | |
static const Vector | normal [14] |
Array of normals. | |
A cuboctahedron is a polyhedron with 8 triangular faces and 6 square faces.
A cuboctahedron has 12 identical vertices, with 2 triangles and 2 squares meeting at each, and 24 identical edges, each separating a triangle from a square.
|
explicit |
Creates a cuboctahedron.
c | Center. |
r | Radius. |
|
explicit |
Creates a cuboctahedron.
r | Radius. |
bool Cuboctahedron::Inside | ( | const Vector & | p | ) | const |
Check if a point is inside a cuboctahedron.
p | Point. |
|
inline |
Return the normal of the i-th face.
Note that the first 8 faces are triangles, and the 6 last are squares.
i | Index, should be 0 ≤ i ≤ 14. |
double Cuboctahedron::Signed | ( | const Vector & | p | ) | const |
Compute the signed distance approximation.
p | Point. |