An axis aligned pyramid.
More...
#include <pyramid.h>
|
| Pyramid (const Vector &, const double &) |
| Create a pyramid. More...
|
|
| Pyramid (const Vector &, const double &, const double &) |
| Create a pyramid. More...
|
|
| Pyramid (const double &, const double &) |
| Create a pyramid. More...
|
|
double | Volume () const |
| Compute the volume of the pyramid.
|
|
double | Area () const |
| Compute the area of the pyramid. More...
|
|
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 |
| Normalized normal to the i-th face. More...
|
|
Vector | Normal (const Vector &) const |
| Compute the normal vector between a point and the pyramid. More...
|
|
double | R (const Vector &) const |
| Compute the squared distance between a point and the pyramid. More...
|
|
double | Signed (const Vector &) const |
| Compute the signed distance between a point and the pyramid. More...
|
|
Box | GetBox () const |
| Return the bounding box of the pyramid.
|
|
bool | Inside (const Vector &) const |
| Check if a point is inside the pyramid. More...
|
|
|
static constexpr int | VertexIndex (int, int) |
| Return the index of the j-th vertex of the i-th face.
|
|
|
Vector | center = Vector::Null |
| Center.
|
|
double | height = 1.0 |
| Height.
|
|
double | a = 1.0 |
| Half base-side size.
|
|
Vector | nt |
| Normal to triangular face.
|
|
Vector | neaa |
| Unit diagonal vector of the triangular faces.
|
|
|
static const int | face [6][3] |
| Array of triangles.
|
|
static const Vector | vertex [5] |
| Array of vertices.
|
|
◆ Pyramid() [1/3]
Pyramid::Pyramid |
( |
const Vector & |
c, |
|
|
const double & |
s |
|
) |
| |
|
explicit |
Create a pyramid.
- Parameters
-
c | Center. |
s | Half base-side size, which will be height as well. |
◆ Pyramid() [2/3]
Pyramid::Pyramid |
( |
const Vector & |
c, |
|
|
const double & |
s, |
|
|
const double & |
z |
|
) |
| |
|
explicit |
Create a pyramid.
- Parameters
-
c | Center. |
s | Half base-side size. |
z | Height. |
◆ Pyramid() [3/3]
Pyramid::Pyramid |
( |
const double & |
s, |
|
|
const double & |
z |
|
) |
| |
|
explicit |
Create a pyramid.
- Parameters
-
s | Half base-side size. |
z | Height. |
◆ Area()
double Pyramid::Area |
( |
| ) |
const |
Compute the area of the pyramid.
It is eight times the area of the small triangle, plus surface of the base square
◆ Inside()
bool Pyramid::Inside |
( |
const Vector & |
p | ) |
const |
Check if a point is inside the pyramid.
- Parameters
-
◆ Normal() [1/2]
Compute the normal vector between a point and the pyramid.
- Parameters
-
◆ Normal() [2/2]
Vector Pyramid::Normal |
( |
int |
i | ) |
const |
Normalized normal to the i-th face.
- Parameters
-
◆ R()
double Pyramid::R |
( |
const Vector & |
p | ) |
const |
Compute the squared distance between a point and the pyramid.
- Parameters
-
◆ Signed()
double Pyramid::Signed |
( |
const Vector & |
p | ) |
const |
Compute the signed distance between a point and the pyramid.
- Parameters
-
◆ operator<<
std::ostream & operator<< |
( |
std::ostream & |
s, |
|
|
const Pyramid & |
pyramid |
|
) |
| |
|
friend |
Overloaded.
- Parameters
-
s | Stream. |
pyramid | The pyramid. |