|
EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
|
Signed distance field for a lattice of walls along a triply periodic minimal surface: a gyroid, Schwarz's P or D (diamond) surface, or Neovius' surface. Porous media, heat exchangers, scaffolds. More...
#include <EBGeometry_AnalyticDistanceFunctions.hpp>
Public Types | |
| enum class | Kind : uint32_t { Gyroid , SchwarzP , SchwarzD , Neovius } |
| Which surface, in coordinates scaled so that a cell is 2 pi. More... | |
Public Member Functions | |
| LatticeSDF ()=default | |
| Default constructor. Constructs a gyroid of unit cells, with walls 0.1 thick. | |
| LatticeSDF (const Kind a_kind, const Vec3T< T > &a_cellSize, const T a_thickness) | |
| Full constructor. | |
| LatticeSDF (const LatticeSDF &)=default | |
| Copy constructor. | |
| LatticeSDF (LatticeSDF &&)=default | |
| Move constructor. | |
| LatticeSDF & | operator= (const LatticeSDF &)=default |
| Copy assignment. | |
| LatticeSDF & | operator= (LatticeSDF &&)=default |
| Move assignment. | |
| Kind | getKind () const noexcept |
| Get which surface this is. | |
| const Vec3T< T > & | getCellSize () const noexcept |
| Get the cell size. | |
| const T & | getThickness () const noexcept |
| Get the walls' thickness. | |
| T | field (const Vec3T< T > &a_point) const noexcept |
| The surface's field f at a point, zero on the surface. | |
| T | signedDistance (const Vec3T< T > &a_point) const noexcept |
| Signed distance function for the lattice: a bound. | |
| BoundingVolumes::AABBT< T > | computeBoundingVolume () const noexcept |
| The shape's axis-aligned bounding box: unbounded. | |
Static Public Attributes | |
| static constexpr DistanceQuality | distanceQuality = DistanceQuality::Bound |
| How far signedDistance() can be trusted as a distance: never more than the Euclidean distance. | |
Protected Attributes | |
| Kind | m_kind = Kind::Gyroid |
| Which surface. | |
| Vec3T< T > | m_cellSize = Vec3T<T>::ones() |
| The cell size. | |
| T | m_thickness = T(0.1) |
| The walls' thickness. | |
| T | m_scale = T(1) / (T(2) * pi<T> * T(1.7320508075688772)) |
| One over the field's largest slope in space. | |
Signed distance field for a lattice of walls along a triply periodic minimal surface: a gyroid, Schwarz's P or D (diamond) surface, or Neovius' surface. Porous media, heat exchangers, scaffolds.
The four share their code: each is the zero set of a sum of products of sines and cosines f of the point scaled so that a cell is 2 pi, and the solid is the wall around it, |f| / g <= t / 2, with g the largest slope of f in space: G times 2 pi over the smallest cell size, G the largest gradient of f in the scaled coordinates (sqrt(3) for the gyroid, P and D, 7 for Neovius). The value is |f| / g - t / 2, a bound: it never changes faster than the distance. The wall is t thick where f is steepest, and thicker elsewhere. The lattice fills all of space; cut it to a part with an Intersection. By default it is a gyroid of unit cells with walls 0.1 thick.
| T | Floating-point precision. |
|
strong |
Which surface, in coordinates scaled so that a cell is 2 pi.
|
inline |
Full constructor.
| [in] | a_kind | Which surface. |
| [in] | a_cellSize | The size of a cell along x, y and z, finite and positive. |
| [in] | a_thickness | The walls' thickness where they are thinnest, positive and less than the smallest cell size. |
|
inlinenoexcept |
The shape's axis-aligned bounding box: unbounded.
|
inlinenoexcept |
The surface's field f at a point, zero on the surface.
Out of line on a device (the lattice's solver): inlined, it would be copied into every level of every tape kernel, whatever shapes the tape holds, which makes the device compile of every tape kernel much slower. A call costs little beside its trigonometry.
| [in] | a_point | Position. |
|
inlinenoexcept |
Get the cell size.
|
inlinenoexcept |
Get which surface this is.
|
inlinenoexcept |
Get the walls' thickness.
|
default |
Copy assignment.
|
default |
Move assignment.
|
inlinenoexcept |
Signed distance function for the lattice: a bound.
| [in] | a_point | Position. |