|
EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
|
The tape's front end: Expr, a host-side value that describes a composed object, and the free functions that build it (Union, SmoothUnion, Intersection, Difference, Translate, Rotate, ...). More...
#include <cstddef>#include <cstdint>#include <memory>#include <type_traits>#include <typeindex>#include <typeinfo>#include <utility>#include <vector>#include "EBGeometry_Affine.hpp"#include "EBGeometry_BoundingVolumes.hpp"#include "EBGeometry_DistanceQuality.hpp"#include "EBGeometry_Pool.hpp"#include "EBGeometry_Vec.hpp"#include "EBGeometry_ExprImplem.hpp"

Go to the source code of this file.
Namespaces | |
| namespace | EBGeometry |
| Namespace containing all of EBGeometry's functionality. | |
Typedefs | |
| template<class S > | |
| using | EBGeometry::ShapePrecision = typename ExprDetail::ShapeInfo< S >::precision |
| The precision of a shape type: T for a shape whose box type is AABBT<T>. | |
| template<class A > | |
| using | EBGeometry::ExprPrecision = typename ExprDetail::ExprLike< A >::type |
| The precision of an expression-like type: T for Expr<T> or for a shape of precision T. Not defined for other types, so a function taking it drops out of overload resolution. | |
Enumerations | |
| enum class | EBGeometry::BlendKind : uint8_t { EBGeometry::Polynomial , EBGeometry::Exponential } |
| How a smooth union, intersection or difference blends the two extreme values. More... | |
| enum class | EBGeometry::ExprDetail::Kind : uint8_t { Primitive , Affine , Elongate , Repeat , Complement , Offset , Annular , Blur , Mollify , Union , Intersection , SmoothUnion , SmoothIntersection } |
| What an expression node does. More... | |
Functions | |
| template<class A > | |
| Expr< ExprPrecision< A > > | EBGeometry::toExpr (const A &a_operand) |
| Convert a shape or an Expr to an Expr. | |
| template<class A , class B > | |
| Expr< ExprPrecision< A > > | EBGeometry::Union (const A &a_first, const B &a_second) |
| Union of two objects: the minimum of their values. | |
| template<class A > | |
| Expr< ExprPrecision< A > > | EBGeometry::Union (const std::vector< A > &a_operands) |
| Union of any number of objects: the minimum of their values. | |
| template<class A , class B > | |
| Expr< ExprPrecision< A > > | EBGeometry::SmoothUnion (const A &a_first, const B &a_second, const ExprPrecision< A > a_smooth, const BlendKind a_blend=BlendKind::Polynomial) |
| Smooth union of two objects: a smooth minimum of their values. | |
| template<class A > | |
| Expr< ExprPrecision< A > > | EBGeometry::SmoothUnion (const std::vector< A > &a_operands, const ExprPrecision< A > a_smooth, const BlendKind a_blend=BlendKind::Polynomial) |
| Smooth union of any number of objects: a smooth minimum of the two smallest values. | |
| template<class A , class B > | |
| Expr< ExprPrecision< A > > | EBGeometry::Intersection (const A &a_first, const B &a_second) |
| Intersection of two objects: the maximum of their values. | |
| template<class A > | |
| Expr< ExprPrecision< A > > | EBGeometry::Intersection (const std::vector< A > &a_operands) |
| Intersection of any number of objects: the maximum of their values. | |
| template<class A , class B > | |
| Expr< ExprPrecision< A > > | EBGeometry::SmoothIntersection (const A &a_first, const B &a_second, const ExprPrecision< A > a_smooth, const BlendKind a_blend=BlendKind::Polynomial) |
| Smooth intersection of two objects: a smooth maximum of their values. | |
| template<class A > | |
| Expr< ExprPrecision< A > > | EBGeometry::SmoothIntersection (const std::vector< A > &a_operands, const ExprPrecision< A > a_smooth, const BlendKind a_blend=BlendKind::Polynomial) |
| Smooth intersection of any number of objects: a smooth maximum of the two largest values. | |
| template<class A , class B > | |
| Expr< ExprPrecision< A > > | EBGeometry::Difference (const A &a_first, const B &a_second) |
| Difference A \ B: max(A, -B), inside A and outside B. | |
| template<class A , class B > | |
| Expr< ExprPrecision< A > > | EBGeometry::Difference (const A &a_first, const std::vector< B > &a_others) |
| Difference A \ (B1 u B2 u ...): max(A, -min_i Bi). | |
| template<class A , class B > | |
| Expr< ExprPrecision< A > > | EBGeometry::SmoothDifference (const A &a_first, const B &a_second, const ExprPrecision< A > a_smooth, const BlendKind a_blend=BlendKind::Polynomial) |
| Smooth difference A \ B: the smooth intersection of A and the complement of B. | |
| template<class A , class B > | |
| Expr< ExprPrecision< A > > | EBGeometry::SmoothDifference (const A &a_first, const std::vector< B > &a_others, const ExprPrecision< A > a_smooth, const BlendKind a_blend=BlendKind::Polynomial) |
| Smooth difference A \ (B1, B2, ...): the smooth intersection of A and the complement of each Bi. | |
| template<class A > | |
| Expr< ExprPrecision< A > > | EBGeometry::FiniteRepetition (const A &a_operand, const Vec3T< ExprPrecision< A > > &a_period, const Vec3T< ExprPrecision< A > > &a_repeatLo, const Vec3T< ExprPrecision< A > > &a_repeatHi) |
Finite repetition: copies of an object on a grid of tiles, a_repeatLo tiles below and a_repeatHi tiles above the home tile along each axis. | |
| template<class A > | |
| Expr< ExprPrecision< A > > | EBGeometry::Complement (const A &a_operand) |
| Complement: inside and outside swapped, -v. | |
| template<class A > | |
| Expr< ExprPrecision< A > > | EBGeometry::Translate (const A &a_operand, const Vec3T< ExprPrecision< A > > &a_shift) |
| Translate an object by a shift. | |
| template<class A > | |
| Expr< ExprPrecision< A > > | EBGeometry::Rotate (const A &a_operand, const ExprPrecision< A > a_degrees, const size_t a_axis) |
| Rotate an object about a coordinate axis through the origin. | |
| template<class A > | |
| Expr< ExprPrecision< A > > | EBGeometry::Rotate (const A &a_operand, const ExprPrecision< A > a_degrees, const Vec3T< ExprPrecision< A > > &a_axis) |
| Rotate an object about an arbitrary axis through the origin. | |
| template<class A > | |
| Expr< ExprPrecision< A > > | EBGeometry::Scale (const A &a_operand, const ExprPrecision< A > a_factor) |
| Scale an object uniformly about the origin. | |
| template<class A > | |
| Expr< ExprPrecision< A > > | EBGeometry::Reflect (const A &a_operand, const size_t a_axis) |
| Reflect an object in a coordinate plane through the origin. | |
| template<class A > | |
| Expr< ExprPrecision< A > > | EBGeometry::Offset (const A &a_operand, const ExprPrecision< A > a_offset) |
| Offset an object's surface outward by a distance, v - r. | |
| template<class A > | |
| Expr< ExprPrecision< A > > | EBGeometry::Annular (const A &a_operand, const ExprPrecision< A > a_delta) |
| A shell around an object's surface, |v| - delta. | |
| template<class A > | |
| Expr< ExprPrecision< A > > | EBGeometry::Elongate (const A &a_operand, const Vec3T< ExprPrecision< A > > &a_elongation) |
| Elongate an object: stretch it by inserting a box of half-lengths h at the origin. | |
| template<class A > | |
| Expr< ExprPrecision< A > > | EBGeometry::Blur (const A &a_operand, const ExprPrecision< A > a_blur, const ExprPrecision< A > a_alpha=ExprPrecision< A >(0.5)) |
| Blur an object: a weighted average of its values at the 27 points p + d (i, j, k), i, j, k in {-1, 0, 1}. | |
| template<class A > | |
| Expr< ExprPrecision< A > > | EBGeometry::Mollify (const A &a_operand, const ExprPrecision< A > a_dist, const size_t a_samples) |
| Mollify an object: convolve it with a smooth, non-negative bump kernel sampled on an n x n x n grid spanning [-r, r]^3. | |
Variables | |
| template<class S > | |
| constexpr bool | EBGeometry::isShape = ExprDetail::ShapeInfo<S>::value |
Whether S is a shape: a trivially copyable type with a const signedDistance(const Vec3T<T>&) returning T and a const computeBoundingVolume() returning BoundingVolumes::AABBT<T>. | |
The tape's front end: Expr, a host-side value that describes a composed object, and the free functions that build it (Union, SmoothUnion, Intersection, Difference, Translate, Rotate, ...).
An Expr is an immutable tree of shapes and operations. It is cheap to copy (copies share the tree) and is never evaluated itself: a Tape compiles it into a pool, and the tape is what is evaluated, on the host or on a device. Any trivially copyable type with signedDistance() and computeBoundingVolume() is a shape (isShape) and converts to an Expr.
|
strong |
What an expression node does.
Internal helper; not part of the public API. Difference and SmoothDifference are built from Intersection, SmoothIntersection, Complement and Union, so they have no kind of their own.