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

An icosidodecahedron. More...

#include <dodecahedron.h>

Public Member Functions

 Icosidodecahedron (const Vector &, const double &)
 Create an icosidodecahedron given its center and radius. More...
 
 Icosidodecahedron (const double &)
 Create an icosidodecahedron given its radius. More...
 
double Volume () const
 Compute the volume.
 
double Area () const
 Compute the area.
 
double Radius () const
 Compute the radius of the circmscribed sphere of the icosi-dodecahedron.
 
Vector Vertex (int) const
 Return the i-th vertex. More...
 
Vector Vertex (int, int) const
 Return the j-th vertex of the i-th face. More...
 
Vector Normal (int) const
 Return the normal to the i-th face as a normalized vector. More...
 
QVector< VectorVertexes () const
 Get all vertexes.
 
Box GetBox () const
 Return the bounding box of the shape.
 
Plane GetPlane (int) const
 Return the plane of the k-th face. More...
 
bool Intersect (const Ray &, double &, double &, int &, int &) const
 Compute the intersection with a ray. More...
 
bool Inside (const Vector &) const
 Check if a point is inside. More...
 
double Signed (const Vector &) const
 Compute the approximate signed distance to the icosahedron. More...
 

Static Public Member Functions

static int VertexTriangleIndex (int, int)
 Return the index of the j-th vertex of the i-th triangle face. More...
 
static int VertexPentagonIndex (int, int)
 Return the index of the j-th vertex of the i-th pentagon face. More...
 

Protected Attributes

Vector c = Vector::Null
 Center of icosi-dodecahedron.
 
double r = 1.0
 Radius.
 

Static Protected Attributes

static const double R2 = sqrt(3.0)
 Radius of the circumscribed sphere of an icosidodecahedron with edge length 2.0/Phi.
 
static const double Phi = (1 + sqrt(5.0)) / 2.0
 Golden ratio.
 
static const Vector vertex [30]
 Array of vertices.
 
static const Vector normal [32]
 Array of normals.
 
static const int pentagon [12][5]
 Array of pentagons.
 
static const int triangle [20][3]
 Array of triangles.
 

Friends

std::ostream & operator<< (std::ostream &, const Icosidodecahedron &)
 Overloaded. More...
 

Detailed Description

An icosidodecahedron.

See also
Dodecahedron, Icosahedron

Constructor & Destructor Documentation

◆ Icosidodecahedron() [1/2]

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

Create an icosidodecahedron given its center and radius.

Parameters
cCenter.
rRadius.

◆ Icosidodecahedron() [2/2]

Icosidodecahedron::Icosidodecahedron ( const double &  r)
explicit

Create an icosidodecahedron given its radius.

Parameters
rRadius.

Member Function Documentation

◆ GetPlane()

Plane Icosidodecahedron::GetPlane ( int  k) const

Return the plane of the k-th face.

Parameters
kFace, pentagon if k in [0,11], and triangle if k in [12,31]

◆ Inside()

bool Icosidodecahedron::Inside ( const Vector p) const

Check if a point is inside.

Parameters
pThe point.

◆ Intersect()

bool Icosidodecahedron::Intersect ( const Ray ray,
double &  ta,
double &  tb,
int &  fa,
int &  fb 
) const

Compute the intersection with a ray.

Parameters
rayThe ray.
ta,tbIntersection depths.
fa,fbIndex of the intersected faces.

◆ Normal()

Vector Icosidodecahedron::Normal ( int  i) const
inline

Return the normal to the i-th face as a normalized vector.

Parameters
iIndex.

◆ Signed()

double Icosidodecahedron::Signed ( const Vector p) const

Compute the approximate signed distance to the icosahedron.

Parameters
pPoint.

◆ Vertex() [1/2]

Vector Icosidodecahedron::Vertex ( int  i) const
inline

Return the i-th vertex.

Parameters
iIndex.

◆ Vertex() [2/2]

Vector Icosidodecahedron::Vertex ( int  i,
int  j 
) const
inline

Return the j-th vertex of the i-th face.

Parameters
iFace number, starting with the 12 pentagons, and following with the 20 triangles.
jIndex representing the j-th vertex of the face.

◆ VertexPentagonIndex()

int Icosidodecahedron::VertexPentagonIndex ( int  i,
int  j 
)
inlinestatic

Return the index of the j-th vertex of the i-th pentagon face.

Parameters
iFace (pentagon).
jIndex representing the j-th vertex of the face.

◆ VertexTriangleIndex()

int Icosidodecahedron::VertexTriangleIndex ( int  i,
int  j 
)
inlinestatic

Return the index of the j-th vertex of the i-th triangle face.

Parameters
iFace (pentagon).
jIndex representing the j-th vertex of the face.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  s,
const Icosidodecahedron icosi 
)
friend

Overloaded.

Parameters
sStream.
icosiThe icosidodecahedron.