|
Core 1.0
|
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 rhombic dodecahedron. | |
| double | Volume () const |
| Compute the volume of the dodecahedron. | |
| double | Area () const |
| Compute the area of the rhombic 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 rhombic dodecahedron. | |
| double | Signed (const Vector &) const |
| Compute the approximate signed distance to the rhombic 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. | |
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.
|
explicit |
Create a dodecahedron.
| r | Radius. |
|
explicit |
Create a rhombic dodecahedron.
| c | Center. |
| r | Radius. |
|
inline |
Return the bounding box of the shape.
The farthest vertices from the center are the six order-four vertices, at the distance \( 2r/\sqrt{3} \) along the axes, which is larger than the distance r to the eight order-three vertices.
| bool RhombicDodecahedron::Inside | ( | const Vector & | p | ) | const |
Check if a point is inside.
| p | The point. |
| Vector RhombicDodecahedron::RandomInside | ( | Random & | random = Random::R239 | ) | const |
Generate a random vector inside the rhombic dodecahedron.
Uses a simple rejection method.
| random | Random number generator. |
| double RhombicDodecahedron::Signed | ( | const Vector & | p | ) | const |
Compute the approximate signed distance to the rhombic dodecahedron.
| p | Point. |