|
EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
|
Namespace containing all of EBGeometry's functionality. More...
Namespaces | |
| namespace | BoundingVolumes |
| Namespace encapsulating bounding volume types for use with bounding volume hierarchies. | |
| namespace | BVH |
| Namespace for various bounding volume hierarchy (BVH) functionalities. | |
| namespace | CSGDetail |
| Internal helpers shared by BVHUnion and BVHSmoothUnion. | |
| namespace | CSGOps |
| The arithmetic of each CSG operation, shared by the Tape and the fused operations. | |
| namespace | DCEL |
| Namespace containing various double-connected edge list (DCEL) functionality. | |
| namespace | Fused |
| Fused CSG: the expression builder's operations as types (see EBGeometry_Fused.hpp). | |
| namespace | GPU |
| Backend-neutral GPU runtime API surface (CUDA or HIP). | |
| namespace | Math |
| Scalar helpers and numeric limits usable in host and device code. | |
| namespace | Parser |
| Namespace which encapsulates possible file parsers for building EBGeometry data structures. | |
| namespace | PointCloud |
| Query results and helpers shared by PointCloudBVH and PointCloudHashGrid. | |
| namespace | PointCloudDetail |
| Internal helpers shared by the point-cloud search structures; not part of the public API. | |
| namespace | PointSoA |
| Namespace for PointSoAT-related compile-time utilities. | |
| namespace | Random |
| Namespace for random sampling utilities (a single, centralized home for RNG use). | |
| namespace | SFC |
| Namespace for space-filling curves (SFCs) used to linearly order 3D grid cells. | |
| namespace | SIMD |
| SIMD register wrappers and the scalar operations that mirror them. | |
| namespace | Soup |
| Namespace containing basic functionality for turning planar-polygon soups into DCEL meshes. | |
| namespace | TapeFeature |
| Optional tape features, listed among a Tape's template arguments: Tape<T, TapeFeature::ExactOffsets>. | |
| namespace | TriangleDistance |
| The triangle signed-distance kernel. | |
| namespace | TriangleRay |
| The triangle ray-crossing kernel. | |
| namespace | TriangleSoA |
| Namespace for TriangleSoAT-related compile-time utilities. | |
Classes | |
| struct | Affine3T |
| An affine map of 3D space, x -> A x + b, with A stored by rows. More... | |
| struct | Array |
| Fixed-size array with host- and device-callable members. More... | |
| class | BoxSDF |
| Signed distance field for an axis-aligned box (AABB). More... | |
| class | BVHSmoothUnion |
| BVH-accelerated smooth union of many primitives of one type. More... | |
| class | BVHUnion |
| BVH-accelerated union of many primitives of one type. More... | |
| class | CapsuleSDF |
| Signed distance field for a capsule (pill shape): a cylinder capped with hemispheres. More... | |
| struct | ClosestFace |
| The face of a mesh closest to a query point, as the mesh SDFs' getClosestFace() returns it. More... | |
| class | ConeSDF |
| Signed distance field for a finite cone. More... | |
| class | CylinderSDF |
| Signed distance field for a finite, flat-capped cylinder. More... | |
| class | DeviceMemoryResource |
Device memory resource: raw device allocation (GPU::memAlloc / GPU::memFree). More... | |
| struct | DistanceQualityOf |
The distance quality of a type: its static distanceQuality member if it has one, and DistanceQuality::Bound otherwise. More... | |
| struct | DistanceQualityOf< P, std::void_t< decltype(P::distanceQuality)> > |
| The distance quality of a type that declares one. More... | |
| class | EmulatedDeviceMemoryResource |
| Host memory that stands in for device memory: host RAM that reports itself device-accessible. More... | |
| struct | ExpMaxOp |
| Exponential smooth maximum for blending two signed-distance values. More... | |
| struct | ExpMinOp |
| Exponential smooth minimum for blending two signed-distance values. More... | |
| class | Expr |
| A composed object: an immutable tree of shapes and operations, built on the host and compiled by a Tape. More... | |
| class | FlatMeshSDF |
| Signed distance function for a DCEL mesh. Does not use BVHs. More... | |
| struct | HitT |
| Where a ray first crosses a surface. More... | |
| class | HostMemoryResource |
Host memory resource: plain aligned allocation in host RAM (std::aligned_alloc / free family). More... | |
| class | InfiniteConeSDF |
| Signed distance field for an infinite cone. More... | |
| class | InfiniteCylinderSDF |
| Signed distance field for an infinitely long cylinder. More... | |
| class | ManagedMemoryResource |
Managed (unified) memory resource: one allocation reachable from host and device (GPU::memAllocManaged / GPU::memFree). More... | |
| class | MappedMemoryResource |
Mapped (zero-copy) pinned host memory resource: page-locked host memory also mapped into the device address space (GPU::memAllocHostMapped / GPU::memFreeHost). More... | |
| class | MemoryResource |
| Abstract placement policy: allocates and frees raw, correctly-aligned byte blocks. More... | |
| class | MeshSDF |
| A FlatMeshSDF must be trivially copyable: that is what lets a rebasedView() be byte-copied into a device address space with no pointer patching. More... | |
| class | PerlinSDF |
| Ken Perlin's gradient-noise implicit function. More... | |
| class | PinnedMemoryResource |
Pinned (page-locked) host memory resource: fast host-to-device staging (GPU::memAllocHost / GPU::memFreeHost). More... | |
| class | PlaneSDF |
| Signed distance function for a plane. More... | |
| struct | PODSpan |
| Raw pointer + size view into a Pool block, for hot inner loops. More... | |
| struct | PODVector |
| Placement-independent descriptor of a POD array inside a Pool. More... | |
| struct | PointAoSoA |
| A PointSoAT<T, W> group that also carries each point's cloud index. More... | |
| class | PointCloudBVH |
| A BVH over a point cloud, with a fast build and turnkey queries. More... | |
| class | PointCloudHashGrid |
| A uniform spatial grid specialized for point clouds, with a fast build and turnkey queries. More... | |
| struct | PointSoAT |
| True SoA (Structure of Arrays) layout for W point positions, enabling SIMD distance evaluation against the whole group at once. More... | |
| class | PolygonSoup |
| Polygons as a file stores them: vertex coordinates, faces as lists of vertex indices, and named per-vertex and per-face scalar properties. More... | |
| class | Pool |
| Growable bump arena over a MemoryResource. More... | |
| struct | PoolControl |
| Stable, heap-resident handle to a Pool's current base address and identity. More... | |
| class | PoolHandle |
| Base of every pool-resident handle: the one PoolLocation its arrays resolve against. More... | |
| struct | PoolLocation |
| Where a pool-resident descriptor resolves its offsets, and the rules for moving it. More... | |
| struct | PrimitiveRef |
| The deciding leaf of a composition at a point: the primitive whose surface the composed value comes from there, as Tape::closestPrimitive() reports it. More... | |
| struct | RayForm |
| How to ray trace a shape directly, instead of marching its signed distance. More... | |
| struct | RayForm< BoxSDF< T > > |
| BoxSDF's ray form: the slab test, axis by axis. Exact, and callable on a device. More... | |
| struct | RayForm< BVHUnion< T, P, K > > |
| BVHUnion's ray form: the union of the spans of the primitives whose boxes the ray meets, found by walking the BVH nearest box first and leaving out the boxes beyond what the union so far is known up to. Exact where the primitive type has a ray form (and marched one primitive at a time otherwise), and callable on a device. More... | |
| struct | RayForm< CapsuleSDF< T > > |
| CapsuleSDF's ray form: the span of the cylinder between its centers and of the two balls at its ends, which, the capsule being convex, is one interval. Exact, and callable on a device. More... | |
| struct | RayForm< CylinderSDF< T > > |
| CylinderSDF's ray form: the infinite cylinder around its axis, clipped by the slab between its caps. Exact, and callable on a device. More... | |
| struct | RayForm< FlatMeshSDF< T > > |
| FlatMeshSDF's ray form: every face tested, as FlatMeshSDF's signed distance tests every face (no BVH). Exact, and callable on a device; as for MeshSDF otherwise. More... | |
| struct | RayForm< Fused::Node< Fused::ShiftOp< T, IsAnnulus >, C >, std::enable_if_t< RayDetail::HasLevelForm< C >::value > > |
| The ray form of a fused offset or annulus of a shape whose level sets have a closed form (see RayDetail::LevelForm): traced through its level view. More... | |
| struct | RayForm< Fused::Node< Op, Cs... >, std::enable_if_t< Fused::Detail::TracedExactly< Op >::value > > |
| The ray form of a fused union, intersection, difference (an intersection with a complement), complement or affine map: its operands' spans, combined. Exact where every leaf has a ray form, and callable on a device. More... | |
| struct | RayForm< InfiniteCylinderSDF< T > > |
| InfiniteCylinderSDF's ray form: the roots of a quadratic, in the plane across its axis. Exact, and callable on a device. More... | |
| struct | RayForm< MeshSDF< T, K > > |
| MeshSDF's ray form: the nearest polygon face the ray crosses, found by walking the BVH nearest box first and stopping at boxes farther than the nearest crossing so far. Exact, and callable on a device. More... | |
| struct | RayForm< PlaneSDF< T > > |
| PlaneSDF's ray form: the crossing of the plane, where the ray goes from one side to the other. Exact, and callable on a device. More... | |
| struct | RayForm< RayDetail::LevelView< S >, std::enable_if_t< RayDetail::HasLevelForm< S >::value > > |
| The ray form of a level view (RayDetail::LevelView): an offset or an annulus of a shape traced from its closed-form level sets, exactly and callable on a device. More... | |
| struct | RayForm< SphereSDF< T > > |
| SphereSDF's ray form: the roots of a quadratic. Exact, and callable on a device. More... | |
| struct | RayForm< Tape< T, UserPrimitives... > > |
| Tape's ray form: the tape traced along its ray program (see Tape::firstHit()). Callable on a device. More... | |
| struct | RayForm< TriMeshSDF< T, K, W > > |
| TriMeshSDF's ray form: the nearest triangle the ray crosses, found by walking the BVH nearest box first and stopping at boxes farther than the nearest crossing so far. Exact, and callable on a device. More... | |
| struct | RayOptions |
| How a query marches, where a shape has no ray form. More... | |
| struct | RaySpansT |
| Where a ray is inside an object over an interval [t0, t1]: its spans, in order, each from where it enters to where it leaves, complete up to a horizon. More... | |
| struct | RayT |
| A ray: the points origin + t * direction. More... | |
| class | RoundedBoxSDF |
| Signed distance field for an axis-aligned box with rounded edges and corners. More... | |
| class | RoundedCylinderSDF |
| Signed distance field for a cylinder with rounded (toroidal) edges. More... | |
| class | SimpleTimer |
| Simple timer class used for local performance profiling. More... | |
| struct | SmoothMaxOp |
| Quadratic polynomial smooth maximum for blending two signed-distance values. More... | |
| struct | SmoothMinOp |
| Quadratic polynomial smooth minimum for blending two signed-distance values. More... | |
| struct | SpanEndT |
| One end of a span: where a ray enters or leaves an object. More... | |
| class | SphereSDF |
| Signed distance field for a sphere. More... | |
| class | Tape |
| A composed object compiled into a pool: a trivially copyable handle that evaluates the object's signed distance (or implicit function value) on the host or on a device. More... | |
| struct | TapeOptions |
| Settings for compiling an Expr into a Tape. More... | |
| class | TorusSDF |
| Signed distance field for a torus. More... | |
| class | Triangle |
| Triangle class with signed distance functionality. More... | |
| struct | TriangleAoSoA |
| Face-id-carrying wrapper around a single TriangleSoAT<T, W>. More... | |
| struct | TriangleSoAT |
| SoA (Structure of Arrays) layout for W triangles, enabling SIMD evaluation. More... | |
| class | TriMeshSDF |
| Signed distance function for a pure triangle mesh using SoA-grouped primitives in a compact (linearized) BVH. More... | |
| class | Vec2T |
| Two-dimensional vector class with arithmetic operators. More... | |
| class | Vec3T |
| Three-dimensional vector class with arithmetic operators. More... | |
Typedefs | |
| template<class S > | |
| using | 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 | 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 | DistanceQuality { Exact , Bound , NotADistance } |
| How far the value of a signed distance function can be trusted, from strongest to weakest. More... | |
| enum class | BlendKind : uint8_t { Polynomial , Exponential } |
| How a smooth union, intersection or difference blends the two extreme values. More... | |
| enum class | HitStatus : uint8_t { Miss , Hit , Unresolved } |
| The outcome of a ray query. More... | |
Functions | |
| template<class A > | |
| Expr< ExprPrecision< A > > | toExpr (const A &a_operand) |
| Convert a shape or an Expr to an Expr. | |
| template<class A , class B > | |
| Expr< ExprPrecision< A > > | Union (const A &a_first, const B &a_second) |
| Union of two objects: the minimum of their values. | |
| template<class A > | |
| Expr< ExprPrecision< A > > | 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 > > | 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 > > | 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 > > | Intersection (const A &a_first, const B &a_second) |
| Intersection of two objects: the maximum of their values. | |
| template<class A > | |
| Expr< ExprPrecision< A > > | 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 > > | 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 > > | 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 > > | 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 > > | 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 > > | 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 > > | 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 > > | 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 > > | Complement (const A &a_operand) |
| Complement: inside and outside swapped, -v. | |
| template<class A > | |
| Expr< ExprPrecision< A > > | Translate (const A &a_operand, const Vec3T< ExprPrecision< A > > &a_shift) |
| Translate an object by a shift. | |
| template<class A > | |
| Expr< ExprPrecision< A > > | 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 > > | 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 > > | Scale (const A &a_operand, const ExprPrecision< A > a_factor) |
| Scale an object uniformly about the origin. | |
| template<class A > | |
| Expr< ExprPrecision< A > > | 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 > > | 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 > > | 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 > > | 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 > > | 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 > > | 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. | |
| template<class F , class T > | |
| BoundingVolumes::AABBT< T > | approximateBoundingVolumeOctree (const F &a_function, const Vec3T< T > &a_initialLowCorner, const Vec3T< T > &a_initialHighCorner, const unsigned int a_maxTreeDepth, const T &a_safety=T(0)) noexcept |
| Estimate the bounding box of a function's zero level set by octree subdivision. | |
| template<class F , class T > | |
| Vec3T< T > | normal (const F &a_function, const Vec3T< T > &a_point, const T &a_delta) noexcept |
| Outward unit normal of a function's level set, by central finite differences. | |
| HostMemoryResource & | hostMemoryResource () noexcept |
| Process-wide default host memory resource. | |
| EmulatedDeviceMemoryResource & | emulatedDeviceMemoryResource () noexcept |
| Process-wide emulated device memory resource. | |
| DeviceMemoryResource & | deviceMemoryResource () noexcept |
| Process-wide default device memory resource. | |
| ManagedMemoryResource & | managedMemoryResource () noexcept |
| Process-wide default managed (unified) memory resource. | |
| PinnedMemoryResource & | pinnedMemoryResource () noexcept |
| Process-wide default pinned (page-locked) host memory resource. | |
| MappedMemoryResource & | mappedMemoryResource () noexcept |
| Process-wide default mapped (zero-copy) pinned host memory resource. | |
| template<class T , class S > | |
| HitT< T > | firstHit (const S &a_shape, const RayT< T > &a_ray, typename RayT< T >::Scalar a_tMin, typename RayT< T >::Scalar a_tMax, const RayOptions< T > &a_options=RayOptions< T >()) noexcept |
| The first crossing of a shape's surface along a ray, entering or leaving. | |
| template<class T , class S > | |
| HitT< T > | firstHit (const S &a_shape, const Vec3T< T > &a_from, const Vec3T< T > &a_to, T a_tMin=T(0), const RayOptions< T > &a_options=RayOptions< T >()) noexcept |
| The first crossing of a shape's surface on the segment from a_from to a_to. | |
| template<class T , class S > | |
| HitStatus | intersects (const S &a_shape, const RayT< T > &a_ray, typename RayT< T >::Scalar a_tMin, typename RayT< T >::Scalar a_tMax, const RayOptions< T > &a_options=RayOptions< T >()) noexcept |
| Whether a ray crosses a shape's surface in [a_tMin, a_tMax]. | |
| template<class T , class S > | |
| HitStatus | intersects (const S &a_shape, const Vec3T< T > &a_from, const Vec3T< T > &a_to, T a_tMin=T(0), const RayOptions< T > &a_options=RayOptions< T >()) noexcept |
| Whether the segment from a_from to a_to crosses a shape's surface. | |
| template<class T > | |
| std::ostream & | operator<< (std::ostream &a_os, const Vec3T< T > &a_vec) |
| Print a vector as (x,y,z). | |
| template<class R , typename T , std::enable_if_t< std::is_arithmetic_v< R >, int > = 0> | |
| constexpr Vec2T< T > | operator* (const R &s, const Vec2T< T > &a_other) noexcept |
| Scalar-left multiplication: s * vec. | |
| template<class R , typename T , std::enable_if_t< std::is_arithmetic_v< R >, int > = 0> | |
| constexpr Vec2T< T > | operator/ (const R &s, const Vec2T< T > &a_other) noexcept |
| Component-wise scalar-left division: s / vec. | |
| template<typename T > | |
| Vec2T< T > | min (const Vec2T< T > &u, const Vec2T< T > &v) noexcept |
| Component-wise minimum of two vectors. | |
| template<typename T > | |
| Vec2T< T > | max (const Vec2T< T > &u, const Vec2T< T > &v) noexcept |
| Component-wise maximum of two vectors. | |
| template<typename T > | |
| T | dot (const Vec2T< T > &u, const Vec2T< T > &v) noexcept |
| Dot product of two 2D vectors. | |
| template<typename T > | |
| T | length (const Vec2T< T > &v) noexcept |
| Euclidean length of a 2D vector. | |
| template<class R , typename T , std::enable_if_t< std::is_arithmetic_v< R >, int > = 0> | |
| constexpr Vec3T< T > | operator* (const R &s, const Vec3T< T > &u) noexcept |
| Scalar-left multiplication: s * vec. | |
| template<class R , typename T , std::enable_if_t< std::is_arithmetic_v< R >, int > = 0> | |
| constexpr Vec3T< T > | operator/ (const R &s, const Vec3T< T > &u) noexcept |
| Component-wise scalar-left division: s / vec. | |
| template<typename T > | |
| constexpr Vec3T< T > | min (const Vec3T< T > &u, const Vec3T< T > &v) noexcept |
| Component-wise minimum of two 3D vectors. | |
| template<typename T > | |
| constexpr Vec3T< T > | max (const Vec3T< T > &u, const Vec3T< T > &v) noexcept |
| Component-wise maximum of two 3D vectors. | |
| template<typename T > | |
| constexpr Vec3T< T > | clamp (const Vec3T< T > &v, const Vec3T< T > &lo, const Vec3T< T > &hi) noexcept |
| Component-wise clamp of a 3D vector. | |
| template<typename T > | |
| constexpr T | dot (const Vec3T< T > &u, const Vec3T< T > &v) noexcept |
| Dot product of two 3D vectors. | |
| template<typename T > | |
| constexpr Vec3T< T > | cross (const Vec3T< T > &u, const Vec3T< T > &v) noexcept |
| Cross product of two 3D vectors. | |
| template<typename T > | |
| T | length (const Vec3T< T > &v) noexcept |
| Euclidean length of a 3D vector. | |
Variables | |
| template<class T > | |
| constexpr ExpMinOp< T > | ExpMin {} |
The exponential smooth minimum, as a ready-made function object: ExpMin<T>(a, b, s). | |
| template<class T > | |
| constexpr ExpMaxOp< T > | ExpMax {} |
The exponential smooth maximum, as a ready-made function object: ExpMax<T>(a, b, s). | |
| template<class T > | |
| constexpr SmoothMinOp< T > | SmoothMin {} |
The polynomial smooth minimum, as a ready-made function object: SmoothMin<T>(a, b, s). | |
| template<class T > | |
| constexpr SmoothMaxOp< T > | SmoothMax {} |
The polynomial smooth maximum, as a ready-made function object: SmoothMax<T>(a, b, s). | |
| template<class T > | |
| constexpr T | pi = T(3.14159265358979323846L) |
| The mathematical constant π, typed as T. | |
| template<class P > | |
| constexpr DistanceQuality | distanceQualityOf = DistanceQualityOf<P>::value |
| Shorthand for the value of DistanceQualityOf. | |
| template<class S > | |
| constexpr bool | 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>. | |
| constexpr unsigned int | MaxOctreeDepth = 24 |
| Deepest subdivision approximateBoundingVolumeOctree() accepts. | |
| constexpr size_t | PoolBaseAlign = 256 |
| Block-base alignment for every Pool, in bytes. | |
| template<class P > | |
| constexpr bool | isPoolHandle = std::is_base_of_v<PoolHandle, P> |
Whether P is a pool-resident handle (derives from PoolHandle). | |
Namespace containing all of EBGeometry's functionality.
EBGeometry is a header-only C++17 library for signed distance functions, constructive solid geometry (CSG), DCEL surface meshes, bounding volume hierarchies, point clouds and ray queries, on the host and on a GPU. Including EBGeometry.hpp exposes every public class and free function through this namespace, except the Random and SimpleTimer utilities (include EBGeometry_Random.hpp or EBGeometry_SimpleTimer.hpp for those).
| using EBGeometry::ExprPrecision = typedef 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.
| A | Expr<T> or shape type. |
| using EBGeometry::ShapePrecision = typedef typename ExprDetail::ShapeInfo<S>::precision |
The precision of a shape type: T for a shape whose box type is AABBT<T>.
| S | Shape type. |
|
strong |
|
strong |
How far the value of a signed distance function can be trusted, from strongest to weakest.
Every level keeps the sign: negative inside, positive outside, zero on the surface.
| Enumerator | |
|---|---|
| Exact | The value's magnitude is the Euclidean distance to the surface. |
| Bound | The value's magnitude never exceeds the distance to the surface: it may underestimate, but never overestimates. Exact implies Bound. |
| NotADistance | Only the sign is meaningful, so the function describes a surface (its zero level set) but says nothing about how far away it is. A BVH union of such functions is again only a sign. |
|
strong |
The outcome of a ray query.
| Enumerator | |
|---|---|
| Miss | The ray does not cross the surface in the interval. |
| Hit | The ray crosses the surface; HitT says where. |
| Unresolved | The query ran out of steps or passes before it could decide (a ray grazing the surface, say). |
|
inline |
A shell around an object's surface, |v| - delta.
| A | Shape or Expr type. |
| [in] | a_operand | Object. |
| [in] | a_delta | Shell half-thickness (finite). |
|
inlinenoexcept |
Estimate the bounding box of a function's zero level set by octree subdivision.
Subdivides the initial box depth-first into octants, keeping a cell when the function's value at its center is within (1 + a_safety) times the cell's half-diagonal, that is, when the surface may pass through it, and returns the box around the kept cells at depth a_maxTreeDepth. This relies on the function being close to a signed distance: a function whose value changes by at most the distance moved cannot have a surface farther from a cell's center than its value there. The cells are never stored; the traversal keeps a fixed stack and a running minimum and maximum, so the function allocates nothing and is callable on a device if the function is.
The function can be anything that is evaluated at a point: an object with a signedDistance(const Vec3T<T>&) member (an analytic shape, a mesh SDF or a Tape), or else a callable taking a const Vec3T<T>&.
If the initial box is empty or inverted along any axis, or the function's value at its center already rules the surface out of it, or no cell is kept at depth a_maxTreeDepth, the result is the maximal box, from -Vec3T<T>::max() to Vec3T<T>::max(): a sign that the initial box must be chosen more generously, or that the function is far from a signed distance.
| F | Function type. |
| T | Floating-point precision. |
| [in] | a_function | Function whose zero level set is bounded. |
| [in] | a_initialLowCorner | Low corner of the initial box. |
| [in] | a_initialHighCorner | High corner of the initial box. |
| [in] | a_maxTreeDepth | Subdivision depth; at most MaxOctreeDepth. |
| [in] | a_safety | Safety factor for the cell test; 0 = exact, 1 = a margin of one half-diagonal. Must be non-negative. |
|
inline |
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}.
The weights are alpha^(3-m) ((1 - alpha)/2)^m for a tap m steps from the center, which sum to one, so a 1-Lipschitz object stays 1-Lipschitz.
| A | Shape or Expr type. |
| [in] | a_operand | Object. |
| [in] | a_blur | Blur distance d (finite, >= 0). |
| [in] | a_alpha | Center weight factor in [0, 1]; 1 = no blur. |
|
inlineconstexprnoexcept |
Component-wise clamp of a 3D vector.
| T | Floating-point precision. |
| [in] | v | Vector to be clamped. |
| [in] | lo | Component-wise lower bound. |
| [in] | hi | Component-wise upper bound. |
|
inline |
Complement: inside and outside swapped, -v.
| A | Shape or Expr type. |
| [in] | a_operand | Object. |
|
inlineconstexprnoexcept |
Cross product of two 3D vectors.
| T | Floating-point precision. |
| [in] | u | First vector. |
| [in] | v | Second vector. |
|
noexcept |
Process-wide default device memory resource.
Returns a reference to a DeviceMemoryResource created on first use and never destroyed, so a Pool with static storage can still free its block at program exit. A free that fails because the GPU runtime has already shut down (GPU::isShutdownError()) is not an error.
|
inline |
|
inline |
|
inlinenoexcept |
Dot product of two 2D vectors.
| T | Floating-point precision. |
| [in] | u | First vector. |
| [in] | v | Second vector. |
|
inlineconstexprnoexcept |
Dot product of two 3D vectors.
| T | Floating-point precision. |
| [in] | u | First vector. |
| [in] | v | Second vector. |
|
inline |
Elongate an object: stretch it by inserting a box of half-lengths h at the origin.
The value at p is the object's value at p - clamp(p, -h, h); exact outside the object only.
| A | Shape or Expr type. |
| [in] | a_operand | Object. |
| [in] | a_elongation | Half-lengths h (finite, >= 0). |
|
noexcept |
Process-wide emulated device memory resource.
Created on first use and never destroyed, for the reason given in hostMemoryResource().
|
inline |
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.
The value is the minimum of the object's value over all its copies, so it is a distance bound whenever the object's value is one, whether or not the object fits inside its tile. The copy in the tile p folds into, p_i - c_i round(clamp(p_i / c_i, -lo_i, hi_i)), is evaluated first, and only the copies whose box comes closer to p than that value after it; an object well inside its tile has few. A Tape evaluates the copies as a sub-program, which takes one level of its call depth.
| A | Shape or Expr type. |
| [in] | a_operand | Object to repeat; its home copy sits in the tile around the origin. |
| [in] | a_period | Tile period along each axis (> 0). |
| [in] | a_repeatLo | Tiles in the decreasing direction of each axis (>= 0; rounded to whole tiles). |
| [in] | a_repeatHi | Tiles in the increasing direction of each axis (>= 0; rounded to whole tiles). |
|
inlinenoexcept |
The first crossing of a shape's surface along a ray, entering or leaving.
Searches [a_tMin, a_tMax], clipped to the shape's bounding box. The crossing is reported whichever way the ray goes through it: a ray that starts inside the object reports where it leaves, with HitT::m_entering false. A shape with a ray form is ray traced; any other is marched (see the file description and RayOptions). Callable on a device.
| T | Floating-point precision. |
| S | Shape type. |
| [in] | a_shape | The shape. |
| [in] | a_ray | The ray, with a unit direction. |
| [in] | a_tMin | Start of the interval. |
| [in] | a_tMax | End of the interval. |
| [in] | a_options | How to march. |
|
inlinenoexcept |
The first crossing of a shape's surface on the segment from a_from to a_to.
The ray from a_from towards a_to, over [a_tMin, |a_to - a_from|]: HitT::m_t is the distance from a_from. A crossing at a_tMin is a hit; a caller stepping off a surface it is sitting on passes a small a_tMin. A segment of zero length is a miss. Callable on a device.
| T | Floating-point precision. |
| S | Shape type. |
| [in] | a_shape | The shape. |
| [in] | a_from | Start of the segment. |
| [in] | a_to | End of the segment. |
| [in] | a_tMin | Distance from a_from where the search starts. |
| [in] | a_options | How to march. |
|
noexcept |
Process-wide default host memory resource.
Returns a reference to a HostMemoryResource created on first use and never destroyed, so a Pool with static storage can still free its block at program exit.
|
inline |
|
inline |
Intersection of any number of objects: the maximum of their values.
| A | Shape or Expr type. |
| [in] | a_operands | Objects (must not be empty). |
|
inlinenoexcept |
Whether a ray crosses a shape's surface in [a_tMin, a_tMax].
Stops at the first crossing found, not the nearest, where the shape's ray form allows it. Callable on a device.
| T | Floating-point precision. |
| S | Shape type. |
| [in] | a_shape | The shape. |
| [in] | a_ray | The ray, with a unit direction. |
| [in] | a_tMin | Start of the interval. |
| [in] | a_tMax | End of the interval. |
| [in] | a_options | How to march. |
|
inlinenoexcept |
Whether the segment from a_from to a_to crosses a shape's surface.
For a marched shape, where the value has different signs at the two ends the segment crosses the surface and no search is needed; otherwise the segment is searched, since it may go in and out again. A shape with a ray form is always searched. Callable on a device.
| T | Floating-point precision. |
| S | Shape type. |
| [in] | a_shape | The shape. |
| [in] | a_from | Start of the segment. |
| [in] | a_to | End of the segment. |
| [in] | a_tMin | Distance from a_from where the search starts. |
| [in] | a_options | How to march. |
|
inlinenoexcept |
Euclidean length of a 2D vector.
| T | Floating-point precision. |
| [in] | v | Vector. |
|
inlinenoexcept |
Euclidean length of a 3D vector.
| T | Floating-point precision. |
| [in] | v | Vector. |
|
noexcept |
Process-wide default managed (unified) memory resource.
Returns a reference to a ManagedMemoryResource created on first use and never destroyed, so a Pool with static storage can still free its block at program exit. A free that fails because the GPU runtime has already shut down (GPU::isShutdownError()) is not an error.
|
noexcept |
Process-wide default mapped (zero-copy) pinned host memory resource.
Returns a reference to a MappedMemoryResource created on first use and never destroyed, so a Pool with static storage can still free its block at program exit. A free that fails because the GPU runtime has already shut down (GPU::isShutdownError()) is not an error.
|
inlinenoexcept |
Component-wise maximum of two vectors.
Each component is Math::max of the two: the first vector's component when they compare equal or either is NaN, like std::max.
| T | Floating-point precision. |
| [in] | u | First vector. |
| [in] | v | Second vector. |
|
inlineconstexprnoexcept |
Component-wise maximum of two 3D vectors.
Each component is Math::max of the two: the first vector's component when they compare equal or either is NaN, like std::max.
| T | Floating-point precision. |
| [in] | u | First vector. |
| [in] | v | Second vector. |
|
inlinenoexcept |
Component-wise minimum of two vectors.
Each component is Math::min of the two: the first vector's component when they compare equal or either is NaN, like std::min.
| T | Floating-point precision. |
| [in] | u | First vector. |
| [in] | v | Second vector. |
|
inlineconstexprnoexcept |
Component-wise minimum of two 3D vectors.
Each component is Math::min of the two: the first vector's component when they compare equal or either is NaN, like std::min.
| T | Floating-point precision. |
| [in] | u | First vector. |
| [in] | v | Second vector. |
|
inline |
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.
The kernel weights are normalized to sum to one, so a 1-Lipschitz object stays 1-Lipschitz. With r = 0 or n = 1 the object is returned unchanged.
| A | Shape or Expr type. |
| [in] | a_operand | Object. |
| [in] | a_dist | Mollification distance r: the half-width of the sampling cube (finite). |
| [in] | a_samples | Samples per axis n (between 1 and 64). |
|
inlinenoexcept |
Outward unit normal of a function's level set, by central finite differences.
Approximates the gradient at a_point with step a_delta along each axis and normalizes it. The function is evaluated as in approximateBoundingVolumeOctree(). Callable on a device if the function is.
| F | Function type. |
| T | Floating-point precision. |
| [in] | a_function | Function to differentiate. |
| [in] | a_point | Query point. |
| [in] | a_delta | Finite-difference step. Must be positive. |
|
inline |
Offset an object's surface outward by a distance, v - r.
Exact for a dilation (r >= 0) of an exact distance; a bound for an erosion.
| A | Shape or Expr type. |
| [in] | a_operand | Object. |
| [in] | a_offset | Offset distance r (finite); negative erodes. |
|
inlineconstexprnoexcept |
Scalar-left multiplication: s * vec.
| R | Arithmetic type of the scalar (e.g. 2.0 * Vec2T<float>); it is converted to T first. |
| T | Floating-point precision of the vector. |
| [in] | s | Scalar multiplier. |
| [in] | a_other | Vector. |
|
inlineconstexprnoexcept |
Scalar-left multiplication: s * vec.
| R | Arithmetic type of the scalar (e.g. 2 * Vec3T<double>); it is converted to T first. |
| T | Floating-point precision of the vector. |
| [in] | s | Scalar multiplier. |
| [in] | u | Vector. |
|
inlineconstexprnoexcept |
Component-wise scalar-left division: s / vec.
Returns a new vector where each component i is T(s) / a_other[i].
| R | Arithmetic type of the scalar numerator; it is converted to T first. |
| T | Floating-point precision of the vector. |
| [in] | s | Scalar numerator. |
| [in] | a_other | Vector whose components are the denominators. |
|
inlineconstexprnoexcept |
Component-wise scalar-left division: s / vec.
Returns a new vector where each component i is T(s) / u[i].
| R | Arithmetic type of the scalar numerator; it is converted to T first. |
| T | Floating-point precision of the vector. |
| [in] | s | Scalar numerator. |
| [in] | u | Vector whose components are the denominators. |
|
inline |
Print a vector as (x,y,z).
| T | Floating-point precision. |
| [in,out] | a_os | Output stream. |
| [in] | a_vec | Vector to print. |
|
noexcept |
Process-wide default pinned (page-locked) host memory resource.
Returns a reference to a PinnedMemoryResource created on first use and never destroyed, so a Pool with static storage can still free its block at program exit. A free that fails because the GPU runtime has already shut down (GPU::isShutdownError()) is not an error.
|
inline |
Reflect an object in a coordinate plane through the origin.
| A | Shape or Expr type. |
| [in] | a_operand | Object. |
| [in] | a_axis | Axis normal to the plane (0, 1 or 2). |
|
inline |
Rotate an object about a coordinate axis through the origin.
| A | Shape or Expr type. |
| [in] | a_operand | Object. |
| [in] | a_degrees | Angle in degrees, counterclockwise seen from the positive end of the axis (finite). |
| [in] | a_axis | Coordinate axis (0, 1 or 2). |
|
inline |
Rotate an object about an arbitrary axis through the origin.
| A | Shape or Expr type. |
| [in] | a_operand | Object. |
| [in] | a_degrees | Angle in degrees, counterclockwise seen from the positive end of the axis (finite). |
| [in] | a_axis | Axis direction (finite, non-zero; need not be normalized). |
|
inline |
Scale an object uniformly about the origin.
The value at p is |s| times the object's value at p / s, which keeps a distance a distance.
| A | Shape or Expr type. |
| [in] | a_operand | Object. |
| [in] | a_factor | Scale factor s (finite, non-zero; a negative factor also reflects through the origin). |
|
inline |
Smooth difference A \ B: the smooth intersection of A and the complement of B.
| [in] | a_first | Object to subtract from. |
| [in] | a_second | Object to subtract. |
| [in] | a_smooth | Smoothing length (> 0). |
| [in] | a_blend | Blend kind. |
|
inline |
Smooth difference A \ (B1, B2, ...): the smooth intersection of A and the complement of each Bi.
| [in] | a_first | Object to subtract from. |
| [in] | a_others | Objects to subtract (must not be empty). |
| [in] | a_smooth | Smoothing length (> 0). |
| [in] | a_blend | Blend kind. |
|
inline |
Smooth intersection of two objects: a smooth maximum of their values.
| [in] | a_first | First object. |
| [in] | a_second | Second object. |
| [in] | a_smooth | Smoothing length (> 0). |
| [in] | a_blend | Blend kind. |
|
inline |
Smooth intersection of any number of objects: a smooth maximum of the two largest values.
| A | Shape or Expr type. |
| [in] | a_operands | Objects (must not be empty). |
| [in] | a_smooth | Smoothing length (> 0). |
| [in] | a_blend | Blend kind. |
|
inline |
|
inline |
Smooth union of any number of objects: a smooth minimum of the two smallest values.
Only the two smallest values are blended, which differs from folding a binary smooth minimum. A Tape evaluates a smooth union of many objects with a BVH, as for Union().
| A | Shape or Expr type. |
| [in] | a_operands | Objects (must not be empty). |
| [in] | a_smooth | Smoothing length (> 0). |
| [in] | a_blend | Blend kind. |
|
inline |
|
inline |
Translate an object by a shift.
| A | Shape or Expr type. |
| [in] | a_operand | Object. |
| [in] | a_shift | Shift (finite). |
|
inline |
|
inline |
Union of any number of objects: the minimum of their values.
A Tape evaluates a union of many objects with a BVH over their boxes (see TapeOptions), unless one of them is not a distance. With exact distances the value is the plain minimum; with operands that are only bounds it can be larger, but keeps the sign and is still a bound.
| A | Shape or Expr type. |
| [in] | a_operands | Objects (must not be empty). |
|
inlineconstexpr |
|
inlineconstexpr |
The exponential smooth maximum, as a ready-made function object: ExpMax<T>(a, b, s).
Callable from host and device code.
| T | Floating-point precision. |
|
inlineconstexpr |
The exponential smooth minimum, as a ready-made function object: ExpMin<T>(a, b, s).
Callable from host and device code, for instance as a BVHSmoothUnion's Blend.
| T | Floating-point precision. |
|
inlineconstexpr |
Whether P is a pool-resident handle (derives from PoolHandle).
| P | Type to inspect. |
|
inlineconstexpr |
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 analytic shapes, the mesh SDFs, the BVH unions and Tape are shapes. A shape may also have a static constexpr distanceQuality member (see DistanceQuality); without one it counts as DistanceQuality::Bound.
Every shape's value goes by the one name signedDistance, whatever its distance quality, and the two together say what the value means. The sign is the contract every shape keeps: negative inside, positive outside, zero on the surface. The magnitude is what the distance quality says: the distance to the surface (Exact), at most that distance (Bound), or nothing (NotADistance).
| S | Candidate type. |
|
constexpr |
Deepest subdivision approximateBoundingVolumeOctree() accepts.
A cell at this depth is 2^-24 of the initial box along each axis, below the resolution of a float coordinate in that box. The bound sizes the function's fixed traversal stack.
|
inlineconstexpr |
The mathematical constant π, typed as T.
Defined to 21 significant digits, which covers the full precision of both float (7 significant digits) and long double (18–21 significant digits).
| T | Floating-point type. |
|
inlineconstexpr |
Block-base alignment for every Pool, in bytes.
256 matches the cudaMalloc / hipMalloc base-address guarantee and is >= the natural alignment of every type the library stores in a pool (including the 64-byte-aligned SoA child-AABB blocks), so base() + (an alignof(T)-aligned offset) is always correctly aligned, and stays so after a grow (the new block is also 256-aligned) and after a mirror (a device base is >= 256-aligned). Defined here, in the placement layer, so both Pool and the device MemoryResource allocators reference a single source of truth.
|
inlineconstexpr |
The polynomial smooth maximum, as a ready-made function object: SmoothMax<T>(a, b, s).
Callable from host and device code.
| T | Floating-point precision. |
|
inlineconstexpr |
The polynomial smooth minimum, as a ready-made function object: SmoothMin<T>(a, b, s).
Callable from host and device code, for instance as a BVHSmoothUnion's Blend.
| T | Floating-point precision. |