Core 1.0
RhombicDodecahedron Class Reference

A rhombic dodecahedron. More...

#include <dodecahedron.h>

Public Member Functions

 RhombicDodecahedron (const double &=1.0)
 Create a dodecahedron.
 
 RhombicDodecahedron (const Vector &, const double &)
 Create a dodecahedron.
 
double Volume () const
 Compute the volume of the dodecahedron.
 
double Area () const
 Compute the area of the dodecahedron.
 
double Radius () const
 Compute the radius of the circmscribed sphere of the rhombic-dodecahedron.
 
Box GetBox () const
 Return the bounding box of the shape.
 
bool Inside (const Vector &) const
 Check if a point is inside.
 
Vector RandomInside (Random &=Random::R239) const
 Generate a random vector inside the dodecahedron.
 
double Signed (const Vector &) const
 Compute the approximate signed distance to the dodecahedron.
 

Protected Attributes

Vector c = Vector::Null
 Center of dodecahedron.
 
double r = 1.0
 Radius, i.e. radius of the sphere passing through the eight order-tree vertexex, which is equal to the edge length.
 

Detailed Description

A rhombic dodecahedron.

The rhombic dodecahedron is a convex polyhedron with 12 congruent rhombic faces. It has 24 edges, and 14 vertices of 2 types. As a Catalan solid, it is the dual polyhedron of the cuboctahedron.

Constructor & Destructor Documentation

◆ RhombicDodecahedron() [1/2]

RhombicDodecahedron::RhombicDodecahedron ( const double & r = 1.0)
explicit

Create a dodecahedron.

Parameters
rRadius.

◆ RhombicDodecahedron() [2/2]

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

Create a dodecahedron.

Parameters
cCenter.
rRadius.

Member Function Documentation

◆ Inside()

bool RhombicDodecahedron::Inside ( const Vector & p) const

Check if a point is inside.

Parameters
pThe point.

◆ RandomInside()

Vector RhombicDodecahedron::RandomInside ( Random & random = Random::R239) const

Generate a random vector inside the dodecahedron.

Uses a simple rejection method.

Parameters
randomRandom number generator.

◆ Signed()

double RhombicDodecahedron::Signed ( const Vector & p) const

Compute the approximate signed distance to the dodecahedron.

Parameters
pPoint.