Core 1.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Cuboctahedron Class Reference

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Cuboctahedron() [1/2]

Cuboctahedron::Cuboctahedron ( const Vector c,
const double &  r 
)
explicit

Creates a cuboctahedron.

Parameters
cCenter.
rRadius.

◆ Cuboctahedron() [2/2]

Cuboctahedron::Cuboctahedron ( const double &  r)
explicit

Creates a cuboctahedron.

Parameters
rRadius.

Member Function Documentation

◆ Inside()

bool Cuboctahedron::Inside ( const Vector p) const

Check if a point is inside a cuboctahedron.

Parameters
pPoint.

◆ Normal()

Vector Cuboctahedron::Normal ( int  i) const
inline

Return the normal of the i-th face.

Note that the first 8 faces are triangles, and the 6 last are squares.

Parameters
iIndex, should be 0 &#8804; i &#8804; 14.

◆ Signed()

double Cuboctahedron::Signed ( const Vector p) const

Compute the signed distance approximation.

Parameters
pPoint.