24#ifndef EBGEOMETRY_TAPE_HPP
25#define EBGEOMETRY_TAPE_HPP
55template <
class TapeType>
110namespace TapeFeature {
131namespace TapeDetail {
139enum class Op : uint8_t
231static_assert(
sizeof(
RayClause) == 16,
"TapeDetail::RayClause must be 16 bytes");
270static_assert(
sizeof(
Clause) == 16,
"TapeDetail::Clause must be 16 bytes");
284 c.
m_op =
static_cast<Op>(a_clause.m_op);
286 c.
m_type = a_clause.m_type;
287 c.
m_a = a_clause.m_a;
288 c.
m_b = a_clause.m_b;
289 c.
m_c = a_clause.m_c;
306 c.
m_op =
static_cast<RayOp>(a_clause.m_op);
308 c.
m_type = a_clause.m_type;
309 c.
m_a = a_clause.m_a;
310 c.
m_b = a_clause.m_b;
311 c.
m_c = a_clause.m_c;
348template <
class T,
size_t K>
367template <
class... Ps>
373 static constexpr size_t size =
sizeof...(Ps);
382template <
size_t I,
class List>
391template <
class T,
class List>
400template <
class T,
class... Ps>
412template <
class T,
class List>
421template <
class T,
class... Ps>
422struct AnyDrill<T,
TypeList<Ps...>> : std::bool_constant<((hasSurfaces<Ps, T> || hasParts<Ps, T>) || ...)>
432template <
size_t I,
class... Ps>
438 using type = std::tuple_element_t<I, std::tuple<Ps...>>;
447template <
class P,
class List>
461 static constexpr size_t value = 0;
471template <
class P,
class Q,
class... Rest>
477 static constexpr size_t value = std::is_same_v<P, Q> ? 0 : 1 +
IndexOf<P,
TypeList<Rest...>>::value;
485template <
class... Lists>
500template <
class... Ps,
class... Rest>
515template <
class... Ps,
class... Qs>
530inline constexpr bool IsFeature = std::is_base_of_v<TapeFeature::Tag, A>;
537template <
class... Args>
545template <
class... Args>
553template <
class... Ps>
564template <
class P,
class... Ps>
591template <
class... Ps>
609template <
size_t I,
class P,
class... Ps>
614 if constexpr (I == 0) {
615 return a_store.m_head;
618 return storeAt<I - 1>(a_store.m_tail);
631template <
size_t I,
class P,
class... Ps>
636 if constexpr (I == 0) {
637 return a_store.m_head;
640 return storeAt<I - 1>(a_store.m_tail);
655template <
class T,
class... UserPrimitives>
689template <
class T,
class List>
698template <
class T,
class... Ps>
704 static constexpr bool shapes = (isShape<Ps> && ...);
709 static constexpr bool precision = (std::is_same_v<ShapePrecision<Ps>, T> && ...);
719template <
class T,
size_t K,
class List>
756template <
class T,
class... UserPrimitives>
760 static_assert(std::is_floating_point_v<T>,
"Tape requires a floating-point type T");
762 "Tape: every user primitive type must be a shape (see isShape)");
764 "Tape: every user primitive type must have the tape's precision");
1004 const
Vec3T<T>& a_to,
1036 const
Vec3T<T>& a_to,
1065 const
Vec3T<T>& a_to,
1267 template <class Visit>
1355 const
Vec3T<T>& a_to,
1379 uint32_t a_subdomain,
1462 template <class TapeType>
1468 static constexpr uint32_t MarchedLeaf = UINT32_MAX;
1473 static constexpr uint32_t LevelLeaf = UINT32_MAX - 1;
1484 template <
unsigned D>
1526 return m_tape->template evaluate<D>(m_program, a_point, m_base, m_location);
1562 traceRay(
const RayT<T>& a_ray, T a_tMin, T a_tMax,
const RayOptions<T>& a_options)
const noexcept;
1578 uint32_t a_program,
const RayT<T>& a_ray, T a_tMin, T a_tMax,
const RayOptions<T>& a_options)
const noexcept;
1597 tracePart(uint32_t a_program,
1602 uint32_t& a_part)
const noexcept;
1621 template <
bool Whole,
bool Part = false>
1624 traceBody(uint32_t a_program,
1629 uint32_t* a_part =
nullptr) const noexcept;
1642 raySpans(const
RayT<T>& a_ray,
1662 template <
unsigned D>
1666 rayEvaluate(uint32_t a_program,
1667 const
RayT<T>& a_ray,
1697 template <
unsigned D,
bool Level = false,
bool Part = false>
1701 rayLeafHit(uint32_t a_program,
1702 const
RayT<T>& a_ray,
1724 primitiveLeafHit(const TapeDetail::RayClause& a_clause,
1725 const
RayT<T>& a_ray,
1746 dispatchLeafHit(const TapeDetail::RayClause& a_clause,
1747 const
RayT<T>& a_ray,
1768 template <
unsigned D>
1772 rayMarchedWithin(const TapeDetail::RayClause& a_clause,
1773 const
RayT<T>& a_ray,
1796 rayLeaf(const TapeDetail::RayClause& a_clause,
1797 const
RayT<T>& a_ray,
1824 rayLevelLeaf(const TapeDetail::RayClause& a_clause,
1825 const
RayT<T>& a_ray,
1851 rayLevelWithin(const TapeDetail::RayClause& a_clause,
1852 const
RayT<T>& a_ray,
1876 levelClauseHit(const TapeDetail::RayClause& a_clause,
1877 const
RayT<T>& a_ray,
1900 resolveLevelHit(uint32_t a_clause,
1901 const
RayT<T>& a_ray,
1918 template <
size_t I,
bool MeshOnly, class Visit>
1921 visitLevelPrimitive(const TapeDetail::RayClause& a_clause,
1924 const Visit& a_visit) const noexcept;
1942 dispatchRayLeaf(const TapeDetail::RayClause& a_clause,
1943 const
RayT<T>& a_ray,
1966 template <
unsigned D>
1969 rayUnion(const TapeDetail::RayClause& a_clause,
1970 const
RayT<T>& a_ray,
2004 wholeValue(const
Vec3T<T>& a_point) const noexcept;
2013 numRegionOperands() const noexcept;
2022 leafOf(const CSGOps::Tagged<T>& a_value) const noexcept;
2038 tracedLeaf(const uint32_t a_program, const uint32_t a_leaf, const
Vec3T<T>& a_point) const noexcept;
2061 inline CSGOps::Tagged<T>
2062 regionSolidTagged(uint32_t a_region, uint32_t a_level, const
Vec3T<T>& a_point) const noexcept;
2075 regionSolid(uint32_t a_region, uint32_t a_level, const
Vec3T<T>& a_point) const noexcept;
2086 sharedMasks(uint32_t a_first, uint32_t a_second) const noexcept;
2088 template <
unsigned D, class V = T>
2092 evaluate(const uint32_t a_program,
2093 const
Vec3T<T>& a_point,
2134 template <
unsigned D, class V = T>
2137 evaluateBody(const uint32_t a_program,
2138 const
Vec3T<T>& a_point,
2150 template <
size_t I, class F>
2153 dispatchVisit(const
LeafRef<T>& a_ref, F&& a_f) const noexcept;
2167 template <
size_t I,
bool Handles>
2170 dispatchPrimitive(const uint32_t a_type,
2171 const uint32_t a_index,
2172 const
Vec3T<T>& a_point,
2181 static constexpr
size_t DispatchSplit = 6;
2195 dispatchRest(const uint32_t a_type,
2196 const uint32_t a_index,
2197 const
Vec3T<T>& a_point,
2212 evaluatePrimitive(const uint32_t a_type,
2213 const uint32_t a_index,
2214 const
Vec3T<T>& a_point,
2233 evaluateHandle(const uint32_t a_type,
2234 const uint32_t a_index,
2235 const
Vec3T<T>& a_point,
2250 template <
unsigned D, class V = T>
2254 evaluateBlur(const TapeDetail::Clause& a_clause,
2255 const
Vec3T<T>& a_point,
2273 template <
unsigned D, class V = T>
2276 evaluateRepeat(const TapeDetail::Clause& a_clause,
2277 const
Vec3T<T>& a_point,
2298 evaluateLeaf(uint32_t a_program,
2299 const
Vec3T<T>& a_point,
2314 template <
unsigned D, class V = T>
2317 evaluateUnion(const TapeDetail::Clause& a_clause,
2318 const
Vec3T<T>& a_point,
2338template <class T, class... UserPrimitives>
2358 return a_shape.traceRay(a_ray, a_tMin, a_tMax, a_options);
2380 [&a_shape, &a_ray, &a_options](
const T a_t0,
const T a_t1,
const bool a_all,
RaySpansT<T>& a_spans)
noexcept {
2381 a_shape.raySpans(a_ray, a_t0, a_t1, a_options, !a_all, a_spans);
2384 return RayDetail::traceCrossing(trace, a_ray, a_tMin, a_tMax);
2407 a_shape.raySpans(a_ray, a_tMin, a_tMax, a_options, a_firstOnly, a_spans);
2413#include "EBGeometry_TapeImplem.hpp"
File containing various analytic signed distance fields.
BVH-accelerated unions of many primitives of one or more types: BVHUnion and BVHSmoothUnion.
Declarations of bounding volume types used in bounding volume hierarchies.
How far a function's value can be trusted as a distance: DistanceQuality, and the distanceQualityOf t...
The tape's front end: Expr, a host-side value that describes a composed object, and the free function...
GPU portability layer: host/device decoration macros and backend detection.
#define EBGEOMETRY_HOST_NOINLINE
Keep a function out of line in a host pass (GCC and Clang); nothing in a device pass.
Definition EBGeometry_GPU.hpp:135
#define EBGEOMETRY_DEVICE_NOINLINE
Keep a function out of line in the device pass (CUDA/HIP); nothing on the host.
Definition EBGeometry_GPU.hpp:110
#define EBGEOMETRY_HOST_DEVICE
Mark a function as callable from both host and device code (no-op on host compilers).
Definition EBGeometry_GPU.hpp:80
#define EBGEOMETRY_HOST
Mark a function as callable from host code only (no-op on host compilers).
Definition EBGeometry_GPU.hpp:83
LeafRef: which leaf of a composition decides its value at a point.
Declaration of signed distance functions for DCEL meshes.
Placement-independent POD array views for the GPU memory foundation.
The flattened, device-callable bounding volume hierarchy: PackedBVH, its node layout,...
Growable bump arena for the GPU memory foundation.
Ray queries on any shape: where a ray, or the segment between two points, first crosses its surface (...
Subdomains: the subdomain of each region of a tape, read on the host or a device.
SurfaceRef: which surface of a shape decides its value at a point, and the container protocol that na...
typename Concat< TypeList< PlaneSDF< T >, SphereSDF< T >, BoxSDF< T >, TorusSDF< T >, CylinderSDF< T >, InfiniteCylinderSDF< T >, CapsuleSDF< T >, InfiniteConeSDF< T >, ConeSDF< T >, RoundedBoxSDF< T >, RoundedCylinderSDF< T >, PerlinSDF< T >, FlatMeshSDF< T >, MeshSDF< T, BVH::DefaultBranchingRatio< T >()>, TriMeshSDF< T, BVH::DefaultBranchingRatio< T >(), TriangleSoA::DefaultWidth< T >()> >, UserTypesOf< UserPrimitives... >, TypeList< EllipsoidSDF< T >, CappedConeSDF< T >, RoundConeSDF< T >, PolygonPrismSDF< T >, TubeSDF< T >, CappedTorusSDF< T >, CutSphereSDF< T >, CutHollowSphereSDF< T >, WedgeSDF< T > > >::type Primitives
The tape's primitive types: twelve analytic shapes (PlaneSDF to PerlinSDF), the three mesh SDFs with ...
Definition EBGeometry_Tape.hpp:681
const auto & storeAt(const PrimitiveStore< P, Ps... > &a_store) noexcept
The pool array of the I-th primitive type.
Definition EBGeometry_Tape.hpp:612
RayOp
The operations of a ray program.
Definition EBGeometry_Tape.hpp:172
@ PopAffine
Pop a ray, and map the top list back through the map at params[m_a..m_a+12).
RayClause rayClause(const Clause &a_clause) noexcept
The ray program clause a stored clause is.
Definition EBGeometry_Tape.hpp:302
constexpr uint32_t LeafProgram
The bit a BVH union's leaf sets on its sub-program's index when that sub-program is one shape,...
Definition EBGeometry_Tape.hpp:339
Clause stored(const RayClause &a_clause) noexcept
A ray program clause, stored in the clause array (the two have the same fields).
Definition EBGeometry_Tape.hpp:280
Op
The tape's operations.
Definition EBGeometry_Tape.hpp:140
@ PairInsert
Pop v and insert it into the pair below: the two smallest, or largest if m_flags is 1.
@ MulConstant
v -> v * params[m_a].
@ PushAffine
Push the top point mapped by the affine map at params[m_a..m_a+12).
@ Max
Pop b and a, push max(a, b).
@ Min
Pop b and a, push min(a, b).
@ AddConstant
v -> v + params[m_a].
@ PushElongate
Push p - clamp(p, -h, h), h at params[m_a..m_a+3).
@ PairInit
Push the empty pair of extreme values (+inf, +inf), or (-inf, -inf) if m_flags is 1.
typename Concat< std::conditional_t< IsFeature< Args >, TypeList<>, TypeList< Args > >... >::type UserTypesOf
The user primitive types among a Tape's template arguments: those that are not features.
Definition EBGeometry_Tape.hpp:546
constexpr bool IsFeature
Whether a Tape template argument is a feature (see TapeFeature).
Definition EBGeometry_Tape.hpp:530
typename Concat< std::conditional_t< IsFeature< Args >, TypeList< Args >, TypeList<> >... >::type FeaturesOf
The features among a Tape's template arguments.
Definition EBGeometry_Tape.hpp:538
Declaration of 2D and 3D point/vector classes with templated precision, and free functions on them.
Forward declaration of the linearised BVH, defined below.
Definition EBGeometry_PackedBVH.hpp:369
Axis-aligned bounding box (AABB) enclosing a set of 3D points.
Definition EBGeometry_BoundingVolumes.hpp:37
Signed distance field for an axis-aligned box (AABB).
Definition EBGeometry_AnalyticDistanceFunctions.hpp:352
Signed distance field for a capped cone (a frustum): a cone cut flat at both ends,...
Definition EBGeometry_AnalyticDistanceFunctions.hpp:2779
Signed distance field for a capped torus: an arc of a torus with flat ends, such as a pipe elbow.
Definition EBGeometry_AnalyticDistanceFunctions.hpp:3841
Signed distance field for a capsule (pill shape): a cylinder capped with hemispheres.
Definition EBGeometry_AnalyticDistanceFunctions.hpp:1178
Signed distance field for a finite cone.
Definition EBGeometry_AnalyticDistanceFunctions.hpp:1516
Signed distance field for a cut hollow sphere: a spherical shell of some thickness,...
Definition EBGeometry_AnalyticDistanceFunctions.hpp:4326
Signed distance field for a cut sphere: the part of a sphere above a horizontal plane,...
Definition EBGeometry_AnalyticDistanceFunctions.hpp:4116
Signed distance field for a finite, flat-capped cylinder.
Definition EBGeometry_AnalyticDistanceFunctions.hpp:758
A composed object: an immutable tree of shapes and operations, built on the host and compiled by a Ta...
Definition EBGeometry_Expr.hpp:452
Signed distance function for a DCEL mesh. Does not use BVHs.
Definition EBGeometry_MeshDistanceFunctions.hpp:99
Signed distance field for an infinite cone.
Definition EBGeometry_AnalyticDistanceFunctions.hpp:1390
Signed distance field for an infinitely long cylinder.
Definition EBGeometry_AnalyticDistanceFunctions.hpp:1008
A FlatMeshSDF must be trivially copyable: that is what lets a rebasedView() be byte-copied into a dev...
Definition EBGeometry_MeshDistanceFunctions.hpp:315
Ken Perlin's gradient-noise implicit function.
Definition EBGeometry_AnalyticDistanceFunctions.hpp:1863
Signed distance field for a regular prism: a regular polygon of n sides, extruded between two end cen...
Definition EBGeometry_AnalyticDistanceFunctions.hpp:3294
Base of every pool-resident handle: the one PoolLocation its arrays resolve against.
Definition EBGeometry_Pool.hpp:563
PoolHandle() noexcept=default
An unset location; the first reservation attaches it.
Growable bump arena over a MemoryResource.
Definition EBGeometry_Pool.hpp:205
The visible regions of a tape, as a shape to look at: its surfaces are the regions' surfaces,...
Definition EBGeometry_RegionView.hpp:51
Signed distance field for a round cone: two spheres, of different radii, and the cone tangent to both...
Definition EBGeometry_AnalyticDistanceFunctions.hpp:3040
Signed distance field for an axis-aligned box with rounded edges and corners.
Definition EBGeometry_AnalyticDistanceFunctions.hpp:1688
Signed distance field for a cylinder with rounded (toroidal) edges.
Definition EBGeometry_AnalyticDistanceFunctions.hpp:2165
Signed distance field for a sphere.
Definition EBGeometry_AnalyticDistanceFunctions.hpp:200
The subdomains of a domain (see Domain), read on the host or a device: the subdomain of each region o...
Definition EBGeometry_Subdomains.hpp:51
A composed object compiled into a pool: a trivially copyable handle that evaluates the object's signe...
Definition EBGeometry_Tape.hpp:758
static constexpr uint32_t RayStackSize
Span lists a ray program may hold at once; a subtree that would need more is marched.
Definition EBGeometry_Tape.hpp:806
SurfaceRef< T > closestSurface(const Vec3T< T > &a_point, uint32_t a_region) const noexcept
The surface of a region that decides its function at a point: the region's own boundary,...
HitStatus intersects(const RayT< T > &a_ray, T a_tMin, T a_tMax, const RayOptions< T > &a_options=RayOptions< T >()) const noexcept
Whether a ray crosses the object's surface in [a_tMin, a_tMax].
MaterialLabelId getMaterialOf(uint32_t a_region) const noexcept
A region's material, as ExprIndex numbers the material labels. Callable on a device.
Tape(const Layout &a_layout, const PoolLocation &a_location) noexcept
Rebuild a handle from a stored layout and the location of the pool that holds it.
Definition EBGeometry_Tape.hpp:945
P primitive(const LeafRef< T > &a_ref) const noexcept
The primitive a reference names, by value: the shape itself, or for a pool-resident type (a mesh SDF,...
uint32_t region(const Vec3T< T > &a_point) const noexcept
The region a point is in: the last operand of the Overlays whose solid holds it (later operands are o...
static constexpr uint32_t ValueStackSize
Values a sub-program may hold at once.
Definition EBGeometry_Tape.hpp:796
Tape()=delete
No empty tape.
uint32_t getNumClauses() const noexcept
Number of clauses over all sub-programs (the ray programs' not counted).
void regionDistances(const Vec3T< T > &a_point, Visit &&a_visit) const noexcept
Every region's function at a point (signedDistance(point, region), the same values),...
uint32_t getFirstSurface(uint32_t a_leaf) const noexcept
A leaf's first surface: the leaf covers [getFirstSurface(leaf), getFirstSurface(leaf + 1)),...
static constexpr size_t BranchingRatio
Branching factor of the BVHs over union operands.
Definition EBGeometry_Tape.hpp:786
HitT< T > firstHit(const RayT< T > &a_ray, T a_tMin, T a_tMax, const RayOptions< T > &a_options=RayOptions< T >()) const noexcept
The first crossing of the object's surface along a ray, entering or leaving.
static constexpr uint32_t PointStackSize
Points a sub-program may hold at once (its input point included).
Definition EBGeometry_Tape.hpp:801
SurfaceLabelId getSurfaceLabel(uint32_t a_leaf) const noexcept
A leaf's label, as SurfaceLabel() resolves it (ExprIndex::getSurfaceLabel()): the nearest label above...
uint32_t getCallDepth() const noexcept
How deep sub-program calls nest (0 if the tape has no Blur, Mollify, FiniteRepetition or BVH union).
bool leafValue(uint32_t a_leaf, const Vec3T< T > &a_point, T &a_value) const
A leaf's own value at a point in its frame (as LeafRef::m_localPoint gives one): its shape's signedDi...
DistanceQuality getDistanceQuality() const noexcept
How far signedDistance() can be trusted as a distance.
uint32_t getNumPrograms() const noexcept
Number of sub-programs (1 plus one per Blur, Mollify, FiniteRepetition and BVH union operand).
TapeDetail::Primitives< T, UserPrimitives... > Primitives
The primitive types: the built-in ones, then UserPrimitives.
Definition EBGeometry_Tape.hpp:811
Tape deepCopy(Pool &a_dstPool) const
Copy the tape, and every pool-resident primitive and BVH it holds, into another pool.
bool isPrimitive(const LeafRef< T > &a_ref) const noexcept
Whether a reference's leaf is a primitive of type P.
uint32_t getNumSurfaces() const noexcept
How many surfaces the tape numbers (see closestSurface()).
LeafRef< T > closestLeaf(const Vec3T< T > &a_point) const noexcept
The deciding leaf at a point: the primitive whose surface the value comes from there (see LeafRef),...
T signedDistance(const Vec3T< T > &a_point) const noexcept
The object's value at a point: negative inside, positive outside, zero on the surface.
uint32_t getNumRegions() const noexcept
How many regions the object has: the background (region 0) and one per operand of its Overlays,...
uint32_t getNumPrimitives() const noexcept
Number of primitives (leaves) in the tape, each occurrence counted.
TapeDetail::FeaturesOf< UserPrimitives... > Features
The features the tape compiles (see TapeFeature): its template arguments derived from TapeFeature::Ta...
Definition EBGeometry_Tape.hpp:769
uint32_t getNumSurfaceLabels() const noexcept
How many distinct labels the expression has (ExprIndex::getNumSurfaceLabels()).
uint32_t getLargestPlainUnion() const noexcept
The most objects in one union evaluated as written (one not built with Accelerate::BVH),...
Tape rebasedView(const Pool &a_pool) const noexcept
A view of this tape resolving against another pool of its mirror chain.
Tape(Pool &a_pool, const Expr< T > &a_expr, const TapeOptions &a_options=TapeOptions())
Compile an expression into a pool.
const Layout & layout() const noexcept
The tape's arrays, with no location: what an outer pool-resident object stores.
static constexpr bool hasFeature
Whether the tape compiles feature F (see TapeFeature).
Definition EBGeometry_Tape.hpp:776
static constexpr unsigned MaxCallDepth
How deep Blur, Mollify, FiniteRepetition and BVH unions may nest.
Definition EBGeometry_Tape.hpp:791
void visitPrimitive(const LeafRef< T > &a_ref, F &&a_f) const noexcept
Call a function with the primitive a reference names, as primitive.
BV computeBoundingVolume() const noexcept
A box enclosing the object.
SurfaceHitT< T > firstSurface(const RayT< T > &a_ray, T a_tMin, T a_tMax, const RayOptions< T > &a_options=RayOptions< T >()) const noexcept
The first crossing along a ray, and the surface crossed: the ray counterpart of closestSurface(),...
uint32_t getNumBVHUnions() const noexcept
Number of unions evaluated with a BVH (those built with Accelerate::BVH).
SurfaceHitT< T > firstRegionChange(const RayT< T > &a_ray, T a_tMin, T a_tMax, const RayOptions< T > &a_options=RayOptions< T >()) const noexcept
The first point along a ray where the region changes: for a particle crossing layers,...
Signed distance field for a torus.
Definition EBGeometry_AnalyticDistanceFunctions.hpp:563
Signed distance function for a pure triangle mesh using SoA-grouped primitives in a compact (lineariz...
Definition EBGeometry_MeshDistanceFunctions.hpp:627
Signed distance field for a tube (a pipe): the space between two coaxial cylinders,...
Definition EBGeometry_AnalyticDistanceFunctions.hpp:3605
Three-dimensional vector class with arithmetic operators.
Definition EBGeometry_Vec.hpp:258
Signed distance field for an infinite wedge: a knife edge.
Definition EBGeometry_AnalyticDistanceFunctions.hpp:4545
Construction
The preset BVH construction methods that the library's own BVH users accept.
Definition EBGeometry_PackedBVH.hpp:65
Namespace containing all of EBGeometry's functionality.
Definition EBGeometry_Affine.hpp:26
Expr< ExprPrecision< A > > Union(const A &a_first, const B &a_second)
Union of two objects: the minimum of their values.
@ Part
The surface's part: a box's face, a mesh's face.
Expr< ExprPrecision< A > > Intersection(const A &a_first, const B &a_second)
Intersection of two objects: the maximum of their values.
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),...
Expr< ExprPrecision< A > > Complement(const A &a_operand)
Complement: inside and outside swapped, -v.
DistanceQuality
How far the value of a signed distance function can be trusted, from strongest to weakest.
Definition EBGeometry_DistanceQuality.hpp:25
@ NotADistance
Only the sign is meaningful, so the function describes a surface (its zero level set) but says nothin...
HitStatus
The outcome of a ray query.
Definition EBGeometry_Ray.hpp:86
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 s...
@ None
As written: the tape evaluates every operand, however many there are.
The BVH's arrays as offsets into its pool, and its root box: a PackedBVH minus its location.
Definition EBGeometry_PackedBVH.hpp:1140
Where a ray first crosses a surface, without the normal or the primitive there: what firstCrossing() ...
Definition EBGeometry_Ray.hpp:157
Where a ray first crosses a surface.
Definition EBGeometry_Ray.hpp:98
The deciding leaf of a composition at a point: the primitive whose surface the composed value comes f...
Definition EBGeometry_LeafRef.hpp:42
Placement-independent descriptor of a POD array inside a Pool.
Definition EBGeometry_PODVector.hpp:131
Where a pool-resident descriptor resolves its offsets, and the rules for moving it.
Definition EBGeometry_Pool.hpp:99
How a query marches, where a shape has no ray form.
Definition EBGeometry_Ray.hpp:203
Where a ray is inside an object over an interval [t0, t1]: its spans, in order, each from where it en...
Definition EBGeometry_Ray.hpp:296
A ray: the points origin + t * direction.
Definition EBGeometry_Ray.hpp:56
A ray's first crossing of a shape's surface, with the surface it crossed, as firstSurface() reports i...
Definition EBGeometry_Ray.hpp:550
The surface that decides a shape's value at a point, as closestSurface() reports it.
Definition EBGeometry_SurfaceRef.hpp:39
Whether a TypeList holds a container (see hasSurfaces).
Definition EBGeometry_Tape.hpp:392
Whether a TypeList holds a container or a shape with parts (see hasSurfaces, hasParts): whether close...
Definition EBGeometry_Tape.hpp:413
One tape clause.
Definition EBGeometry_Tape.hpp:238
uint32_t m_a
First operand.
Definition EBGeometry_Tape.hpp:257
uint32_t m_b
Second operand.
Definition EBGeometry_Tape.hpp:262
Op m_op
Operation.
Definition EBGeometry_Tape.hpp:242
uint16_t m_type
Primitive type index (Primitive).
Definition EBGeometry_Tape.hpp:252
uint32_t m_c
Third operand.
Definition EBGeometry_Tape.hpp:267
uint8_t m_flags
Operation flags.
Definition EBGeometry_Tape.hpp:247
typename Concat< TypeList< Ps... >, typename Concat< Rest... >::type >::type type
The concatenation.
Definition EBGeometry_Tape.hpp:506
The concatenation of TypeLists.
Definition EBGeometry_Tape.hpp:487
TypeList<> type
The concatenation.
Definition EBGeometry_Tape.hpp:491
The index of type P in a TypeList (its size if P is not in it).
Definition EBGeometry_Tape.hpp:448
PODVector< CSGDetail::Stored< P > > m_head
The first type's primitives.
Definition EBGeometry_Tape.hpp:570
PrimitiveStore< Ps... > m_tail
The remaining types' primitives.
Definition EBGeometry_Tape.hpp:575
One pool array per primitive type, holding the type's stored form (CSGDetail::Stored).
Definition EBGeometry_Tape.hpp:555
A sub-program: a range of clauses.
Definition EBGeometry_Tape.hpp:321
uint32_t m_begin
First clause.
Definition EBGeometry_Tape.hpp:325
uint32_t m_end
One past the last clause.
Definition EBGeometry_Tape.hpp:330
One ray program clause.
Definition EBGeometry_Tape.hpp:199
RayOp m_op
Operation.
Definition EBGeometry_Tape.hpp:203
uint16_t m_type
Primitive type index (Leaf, and a Marched clause holding a deferred level set).
Definition EBGeometry_Tape.hpp:213
uint32_t m_c
Third operand.
Definition EBGeometry_Tape.hpp:228
uint8_t m_flags
Operation flags.
Definition EBGeometry_Tape.hpp:208
uint32_t m_a
First operand.
Definition EBGeometry_Tape.hpp:218
uint32_t m_b
Second operand.
Definition EBGeometry_Tape.hpp:223
Host-side arrays the compiler fills before they are reserved in the pool.
Definition EBGeometry_Tape.hpp:720
The PrimitiveStore for the types of a TypeList.
Definition EBGeometry_Tape.hpp:584
std::tuple_element_t< I, std::tuple< Ps... > > type
The type.
Definition EBGeometry_Tape.hpp:438
The I-th type of a TypeList.
Definition EBGeometry_Tape.hpp:383
A list of types.
Definition EBGeometry_Tape.hpp:369
static constexpr size_t size
Number of types.
Definition EBGeometry_Tape.hpp:373
A BVH union's two parts, as layouts in the tape's pool: a BVH over the sub-programs with bounded boxe...
Definition EBGeometry_Tape.hpp:350
BVH::PackedBVH< T, uint32_t, K >::Layout m_bvh
BVH over the sub-programs with bounded boxes.
Definition EBGeometry_Tape.hpp:354
BVH::PackedBVH< T, uint32_t, K >::Layout m_unbounded
Leaf holding the sub-programs with unbounded boxes.
Definition EBGeometry_Tape.hpp:359
Whether a tape's user primitive types are shapes of its precision.
Definition EBGeometry_Tape.hpp:690
Ray queries trace an Offset or Annular of a primitive with closed-form level sets (or of an affine ma...
Definition EBGeometry_Tape.hpp:126
Base of every feature: a Tape template argument derived from it is a feature, not a primitive type.
Definition EBGeometry_Tape.hpp:116
Settings for compiling an Expr into a Tape.
Definition EBGeometry_Tape.hpp:62
BVH::Construction m_construction
How the BVHs of unions built with Accelerate::BVH are built.
Definition EBGeometry_Tape.hpp:79
uint32_t m_largeUnionWarning
A union or smooth union evaluated as written (not built with Accelerate::BVH) of at least this many o...
Definition EBGeometry_Tape.hpp:74
The tape's arrays as offsets into its pool, with no location (see PoolHandle).
Definition EBGeometry_Tape.hpp:822
PODVector< uint32_t > m_regionPrograms
The regions: the number n of the Overlays' operands (0 without an Overlay), then each operand's recor...
Definition EBGeometry_Tape.hpp:913
uint32_t m_largestPlainUnion
The most objects in one union evaluated as written (see getLargestPlainUnion()).
Definition EBGeometry_Tape.hpp:881
uint32_t m_numPrograms
How many sub-programs there are (the first entries of m_programs).
Definition EBGeometry_Tape.hpp:871
uint32_t m_rayPrograms
Where in m_programs the ray programs begin: sub-program i's is entry m_rayPrograms + i (an empty rang...
Definition EBGeometry_Tape.hpp:887
uint32_t m_numLabels
How many distinct labels the expression has.
Definition EBGeometry_Tape.hpp:918
BV m_boundingVolume
A box enclosing the object.
Definition EBGeometry_Tape.hpp:856
PODVector< TapeDetail::UnionBVH< T, BranchingRatio > > m_unions
The BVH unions.
Definition EBGeometry_Tape.hpp:851
PODVector< TapeDetail::Clause > m_clauses
The clauses of every sub-program, one after another.
Definition EBGeometry_Tape.hpp:831
PODVector< uint32_t > m_surfaceLabels
Each leaf's label (see getSurfaceLabel()); empty when the expression has no Label.
Definition EBGeometry_Tape.hpp:892
PODVector< TapeDetail::Program > m_programs
Each sub-program's clause range; sub-program 0 is the whole object. After the m_numPrograms sub-progr...
Definition EBGeometry_Tape.hpp:841
PODVector< uint32_t > m_partSurfaceLabels
The part labels (see SurfaceLabel(shape, FaceGroups)): first, per leaf, where its parts' labels begin...
Definition EBGeometry_Tape.hpp:904
DistanceQuality m_quality
How far the value can be trusted as a distance.
Definition EBGeometry_Tape.hpp:861
PODVector< uint32_t > m_surfaces
Each leaf's first surface, and the number of surfaces last (see getFirstSurface()); empty when no lea...
Definition EBGeometry_Tape.hpp:898
PODVector< T > m_params
Constant parameters the clauses refer to.
Definition EBGeometry_Tape.hpp:846
uint32_t m_numPrimitives
How many primitives (leaves) the tape has, each occurrence counted.
Definition EBGeometry_Tape.hpp:876
uint32_t m_callDepth
How deep sub-program calls nest from sub-program 0.
Definition EBGeometry_Tape.hpp:866
TapeDetail::StoreOf< Primitives >::type m_primitives
One array per primitive type.
Definition EBGeometry_Tape.hpp:826