|
EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
|
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...
#include <EBGeometry_Tape.hpp>


Classes | |
| struct | Layout |
| The tape's arrays as offsets into its pool, with no location (see PoolHandle). More... | |
Public Types | |
| using | Features = TapeDetail::FeaturesOf< UserPrimitives... > |
| The features the tape compiles (see TapeFeature): its template arguments derived from TapeFeature::Tag. | |
| using | BV = BoundingVolumes::AABBT< T > |
| Bounding box type. | |
| using | Primitives = TapeDetail::Primitives< T, UserPrimitives... > |
| The primitive types: the built-in ones, then UserPrimitives. | |
| using | UnionRoot = BVH::PackedBVH< T, uint32_t, BranchingRatio > |
| The BVH type over union operands. | |
Public Member Functions | |
| Tape ()=delete | |
| No empty tape. | |
| Tape (Pool &a_pool, const Expr< T > &a_expr, const TapeOptions &a_options=TapeOptions()) | |
| Compile an expression into a pool. | |
| 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. | |
| T | signedDistance (const Vec3T< T > &a_point) const noexcept |
| The object's value at a point: negative inside, positive outside, zero on the surface. | |
| 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), with the point in its own frame. | |
| 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. | |
| HitT< T > | firstHit (const Vec3T< T > &a_from, const Vec3T< T > &a_to, T a_tMin=T(0), const RayOptions< T > &a_options=RayOptions< T >()) const noexcept |
| The first crossing of the object's surface on the segment from a_from to a_to. | |
| 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(), as firstHit() is of signedDistance(). The same as the free function firstSurface(). Callable on a device. | |
| SurfaceHitT< T > | firstSurface (const Vec3T< T > &a_from, const Vec3T< T > &a_to, T a_tMin=T(0), const RayOptions< T > &a_options=RayOptions< T >()) const noexcept |
| The first crossing on the segment from a_from to a_to, and the surface crossed (see firstSurface() for a ray). Callable on a device. | |
| 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]. | |
| HitStatus | intersects (const Vec3T< T > &a_from, const Vec3T< T > &a_to, T a_tMin=T(0), const RayOptions< T > &a_options=RayOptions< T >()) const noexcept |
| Whether the segment from a_from to a_to crosses the object's surface. | |
| template<class P > | |
| bool | isPrimitive (const LeafRef< T > &a_ref) const noexcept |
| Whether a reference's leaf is a primitive of type P. | |
| template<class P > | |
| 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, a BVH union, a tape) its handle, rebuilt with the tape's location, so that it resolves against the same pool (or mirror) the tape does. | |
| template<class F > | |
| 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. | |
| 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). | |
| uint32_t | getNumClauses () const noexcept |
| Number of clauses over all sub-programs (the ray programs' not counted). | |
| uint32_t | getNumBVHUnions () const noexcept |
| Number of unions evaluated with a BVH (those built with Accelerate::BVH). | |
| uint32_t | getNumPrimitives () const noexcept |
| Number of primitives (leaves) in the tape, each occurrence counted. | |
| uint32_t | getLargestPlainUnion () const noexcept |
| The most objects in one union evaluated as written (one not built with Accelerate::BVH), nested sharp unions counted as one: what TapeOptions::m_largeUnionWarning is compared with. An Overlay, which is evaluated as written and takes no BVH, is not counted. | |
| SurfaceLabelId | getSurfaceLabel (uint32_t a_leaf) const noexcept |
| A leaf's label, as SurfaceLabel() resolves it (ExprIndex::getSurfaceLabel()): the nearest label above the leaf, the leaf's own included, but a label above a chain of maps relabels the object below them. | |
| SurfaceLabelId | getSurfaceLabel (const LeafRef< T > &a_ref) const noexcept |
| The label of the leaf a reference names (see getSurfaceLabel(uint32_t)). | |
| uint32_t | getNumSurfaceLabels () const noexcept |
| How many distinct labels the expression has (ExprIndex::getNumSurfaceLabels()). | |
| 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 signedDistance(), on the host, for diagnostics (ExprIndex::checkLabels()). The tape's pool must be readable on the host. | |
| uint32_t | getNumRegions () const noexcept |
| How many regions the object has: the background (region 0) and one per operand of its Overlays, numbered as ExprIndex numbers them; 2 for an object with no Overlay (the outside and the object). | |
| MaterialLabelId | getMaterialOf (uint32_t a_region) const noexcept |
| A region's material, as ExprIndex numbers the material labels. Callable on a device. | |
| 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 on top), or the background (0). Exact in sign: every point is in exactly one region. Callable on a device. | |
| T | signedDistance (const Vec3T< T > &a_point, uint32_t a_region) const noexcept |
| A region's implicit function: negative exactly inside the region, its zero contour the region's surface, interfaces with other regions included. For region k it is max(S_k, -min of the later S_j), S_j being operand j's solid; for the background, minus signedDistance(). A distance bound, exact near a smooth piece of surface of exact operands; what a cut-cell code cuts for one region. Callable on a device. | |
| template<class Visit > | |
| 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), in one pass: calls a_visit(region, value) for each region, from the last one down to the background (0). Each operand's solid is evaluated once, twice when the regions share masks, where asking signedDistance() region by region evaluates the later solids again for each; regions with different masks are asked one by one. Callable on a device. | |
| 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, an interface with a later region, or a mask's cut; drilled, with its part and surface label, as closestSurface() reports a surface, and with the regions on its two sides at that point: m_ownerRegion the region asked about (inside), m_neighborRegion the region across. The sides belong to the point, not to the surface: one surface can face different regions in different places. For the background, the whole object's surface. Callable on a device. | |
| T | signedDistance (const Vec3T< T > &a_point, const Subdomains &a_subdomains, uint32_t a_subdomain) const noexcept |
| A subdomain's implicit function: half the difference of the smallest function of a region in the subdomain and the smallest of one not in it (the background included), negative exactly inside the subdomain and zero only on its surface: where one of its regions meets a region not in it, never on the contact between two of its own. A distance bound, exact near a smooth piece of surface; what a cut-cell solver cuts for the subdomain, and the function of a union of materials (a subdomain of their regions). Callable on a device. | |
| SurfaceRef< T > | closestSurface (const Vec3T< T > &a_point, const Subdomains &a_subdomains, uint32_t a_subdomain) const noexcept |
| The surface of a subdomain that decides its function at a point: that of its region whose function is smallest there (see closestSurface(p, region)), with the regions on its two sides; the surface's role for the solver is a_subdomains.role(surface). A contact between two of the subdomain's own regions is not its surface: where that region's nearest surface is one, the nearest region outside the subdomain names the surface instead, seen from the subdomain's side, if it borders the subdomain there. Callable on a device. | |
| 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, from inside any region, the background included. The crossing is the nearer of leaving the current region's solid and entering a later one, each traced exactly where the operands have ray forms (and marched where they do not). m_hit is the crossing, its normal pointing from the region left into the region entered; m_surface the surface crossed (leaf, part, surface label), its m_ownerRegion the region left and m_neighborRegion the region entered. The ray starts counting a hundredth of the march's tolerance at the object's scale past a_tMin (RayOptions::m_tolerance times m_scale, or the box's diagonal), so a ray crossing several layers asks again from the last crossing's t, and layers thinner than that are passed over. Callable on a device. | |
| SurfaceHitT< T > | firstRegionChange (const Vec3T< T > &a_from, const Vec3T< T > &a_to, T a_tMin=T(0), const RayOptions< T > &a_options=RayOptions< T >()) const noexcept |
| The first change of region along a particle's step from one point to another (see firstRegionChange(ray)), t measured from a_from. | |
| SurfaceHitT< T > | firstSurface (const RayT< T > &a_ray, T a_tMin, T a_tMax, const Subdomains &a_subdomains, uint32_t a_subdomain, const RayOptions< T > &a_options=RayOptions< T >()) const noexcept |
| The first point along a ray where it crosses a subdomain's boundary, entering or leaving the subdomain: changes between two of its regions are passed through. For rendering, the subdomain is the set of visible regions: hidden ones are seen through. Reported as firstRegionChange() reports a crossing. Callable on a device. | |
| SurfaceRef< T > | closestSurface (const Vec3T< T > &a_point) const noexcept |
| The surface that decides the value at a point: the deciding leaf (closestLeaf()), drilled into when it is a container (a sphere cloud, a BVH union, a nested tape; see hasSurfaces) down to the member that decides there, at any depth. | |
| uint32_t | getNumSurfaces () const noexcept |
| How many surfaces the tape numbers (see closestSurface()). | |
| uint32_t | getFirstSurface (uint32_t a_leaf) const noexcept |
| A leaf's first surface: the leaf covers [getFirstSurface(leaf), getFirstSurface(leaf + 1)), so per-member data of a container leaf (a sphere's) is an array indexed by SurfaceRef::m_surface minus it. | |
| uint32_t | getCallDepth () const noexcept |
| How deep sub-program calls nest (0 if the tape has no Blur, Mollify, FiniteRepetition or BVH union). | |
| const Layout & | layout () const noexcept |
| The tape's arrays, with no location: what an outer pool-resident object stores. | |
| Tape | rebasedView (const Pool &a_pool) const noexcept |
| A view of this tape resolving against another pool of its mirror chain. | |
| Tape | deepCopy (Pool &a_dstPool) const |
| Copy the tape, and every pool-resident primitive and BVH it holds, into another pool. | |
Public Member Functions inherited from EBGeometry::PoolHandle | |
| PoolLocation | location () const noexcept |
| Where this handle's arrays live. | |
| bool | isAttachedTo (const Pool &a_pool) const noexcept |
Check whether this handle's arrays were reserved from a_pool. | |
Static Public Attributes | |
| template<class F > | |
| static constexpr bool | hasFeature = TapeDetail::IndexOf<F, Features>::value < Features::size |
| Whether the tape compiles feature F (see TapeFeature). | |
| static constexpr size_t | BranchingRatio = 4 |
| Branching factor of the BVHs over union operands. | |
| static constexpr unsigned | MaxCallDepth = 4 |
| How deep Blur, Mollify, FiniteRepetition and BVH unions may nest. | |
| static constexpr uint32_t | ValueStackSize = 16 |
| Values a sub-program may hold at once. | |
| static constexpr uint32_t | PointStackSize = 8 |
| Points a sub-program may hold at once (its input point included). | |
| static constexpr uint32_t | RayStackSize = 4 |
| Span lists a ray program may hold at once; a subtree that would need more is marched. | |
Friends | |
| struct | RayForm< Tape > |
| Tape's ray form follows the ray programs. | |
| template<class TapeType > | |
| class | RegionView |
| A view of the tape's regions traces the whole object through traceProgram(), out of line. | |
Additional Inherited Members | |
Protected Member Functions inherited from EBGeometry::PoolHandle | |
| PoolHandle () noexcept=default | |
| An unset location; the first reservation attaches it. | |
| PoolHandle (const PoolLocation &a_location) noexcept | |
| Adopt a location, as a handle rebuilt from a stored layout does. | |
| PoolHandle (const PoolHandle &) noexcept=default | |
| Copy a handle, as a derived handle's copy does. | |
| PoolHandle (PoolHandle &&) noexcept=default | |
| Move a handle; the same as a copy. | |
| PoolHandle & | operator= (const PoolHandle &) noexcept=default |
| Copy-assign a handle, as a derived handle's assignment does. | |
| PoolHandle & | operator= (PoolHandle &&) noexcept=default |
| Move-assign a handle; the same as a copy. | |
| ~PoolHandle () noexcept=default | |
| Destructor; protected, since a PoolHandle exists only as the base of a handle. | |
| void * | base () noexcept |
| The base address this handle's offsets resolve against; see PoolLocation::base(). | |
| const void * | base () const noexcept |
| The base address this handle's offsets resolve against, for read-only access. | |
| void | attach (const Pool &a_pool, const char *a_who, const bool a_deviceWritten=false) noexcept |
Follow a_pool, as the first reservation does; see PoolLocation::attach(). | |
| PoolLocation | rebasedLocation (const Pool &a_pool, uint64_t a_endByte, const char *a_who) const noexcept |
| The location of this handle's arrays in another pool of its mirror chain; see PoolLocation::rebasedOnto(). | |
| void | setLocation (const PoolLocation &a_location) noexcept |
| Replace the location, for a view or a copy made by a derived handle. | |
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.
Build one from an Expr:
The analytic shapes and the mesh SDFs (FlatMeshSDF, and MeshSDF and TriMeshSDF with the default branching factor and width) are built-in primitive types; any other shape type, such as a BVHUnion, a MeshSDF with another branching factor, another Tape or a type of your own, is listed in UserPrimitives. A pool-resident primitive must live in the tape's pool. The pool must outlive the tape and every copy and view of it (see PoolHandle).
The compiler works out each sub-expression's bounding box and distance quality (see Expr). A union or smooth union is evaluated as written, unless it was built with Accelerate::BVH: then with a BVH over its operands' boxes, pruned as BVHUnion is, unless an operand is not a distance. With exact distances the value is the plain minimum; with operands that are only bounds (DistanceQuality::Bound) pruning can skip an operand whose value is below its box's distance, so the value can be larger than the plain minimum, but it keeps the sign and is still a bound. Blur, Mollify, FiniteRepetition and BVH unions evaluate a sub-program several times; they nest at most MaxCallDepth deep, and a sub-program needs at most ValueStackSize values and PointStackSize points at once; the constructor rejects an expression that needs more.
Optional features (see TapeFeature) are listed among the template arguments, before the user primitive types by convention: Tape<T, TapeFeature::ExactOffsets, MyUnion>. A tape compiles only the features it lists, and without one computes the same object by the general path.
| T | Floating-point precision. |
| UserPrimitives | Additional primitive types (each a shape of precision T), and features (see TapeFeature). |
| EBGeometry::Tape< T, UserPrimitives >::Tape | ( | Pool & | a_pool, |
| const Expr< T > & | a_expr, | ||
| const TapeOptions & | a_options = TapeOptions() |
||
| ) |
Compile an expression into a pool.
| [in,out] | a_pool | Pool to compile into; pool-resident primitives must live in it too. Must outlive this object and every copy of it. |
| [in] | a_expr | Expression. |
| [in] | a_options | Compile settings. |
|
inlinenoexcept |
Rebuild a handle from a stored layout and the location of the pool that holds it.
How an outer pool-resident object evaluates a Tape it stores as a layout. a_location must belong to the pool the layout was reserved from, to a mirror of it, or to a pool holding its image (Pool::forImage()); nothing is checked, since a device has no pool to check against.
| [in] | a_layout | The arrays. |
| [in] | a_location | Where they live. |
|
inlinenoexcept |
The deciding leaf at a point: the primitive whose surface the value comes from there (see LeafRef), with the point in its own frame.
Evaluates the tape as signedDistance() does, carrying with each value the leaf it comes from. The leaves are numbered in expression order, depth first, each occurrence counted. A primitive that is itself a composition (a fused one, a tape, a BVH union) is one leaf: the tape is the scene, its leaves the parts. closestSurface() goes on into a leaf that is a collection. Callable on a device, like signedDistance().
| [in] | a_point | Query point. |
|
inlinenoexcept |
The surface that decides the value at a point: the deciding leaf (closestLeaf()), drilled into when it is a container (a sphere cloud, a BVH union, a nested tape; see hasSurfaces) down to the member that decides there, at any depth.
The surfaces are numbered across the scene: each leaf covers [getFirstSurface(leaf), getFirstSurface(leaf + 1)), one surface for a leaf that is not a container, and a container's are its own numbers (a cloud's cloud indices, a union's members in the order it was given them) after the leaf's first. A container costs one more query of that leaf (a second search of a cloud, say), paid only here; for a tape without one, the surface is the leaf. For a ray hit, closestSurface(hit.m_point) names the surface crossed. Labels of a nested tape are its own, not reported here. Callable on a device.
| [in] | a_point | Query point. |
|
inlinenoexcept |
The surface of a subdomain that decides its function at a point: that of its region whose function is smallest there (see closestSurface(p, region)), with the regions on its two sides; the surface's role for the solver is a_subdomains.role(surface). A contact between two of the subdomain's own regions is not its surface: where that region's nearest surface is one, the nearest region outside the subdomain names the surface instead, seen from the subdomain's side, if it borders the subdomain there. Callable on a device.
| [in] | a_point | Point, on or near the subdomain's surface. |
| [in] | a_subdomains | The subdomains. |
| [in] | a_subdomain | Subdomain. |
|
inlinenoexcept |
The surface of a region that decides its function at a point: the region's own boundary, an interface with a later region, or a mask's cut; drilled, with its part and surface label, as closestSurface() reports a surface, and with the regions on its two sides at that point: m_ownerRegion the region asked about (inside), m_neighborRegion the region across. The sides belong to the point, not to the surface: one surface can face different regions in different places. For the background, the whole object's surface. Callable on a device.
| [in] | a_point | Point, on or near the region's surface. |
| [in] | a_region | Region (below getNumRegions()). |
|
inlinenoexcept |
A box enclosing the object.
|
inline |
|
inlinenoexcept |
The first crossing of the object's surface along a ray, entering or leaving.
The tape is traced along its ray program: exactly through its unions, intersections, complements and affine maps of primitives with ray forms, and marched in the parts that have anything else (see EBGeometry_Ray.hpp). HitT::m_primitive is the leaf crossed (see closestLeaf()). The same as the free function firstHit(). Callable on a device.
| [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 the object's surface on the segment from a_from to a_to.
HitT::m_t is the distance from a_from. The same as the free function firstHit(). Callable on a device.
| [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 |
The first point along a ray where the region changes: for a particle crossing layers, from inside any region, the background included. The crossing is the nearer of leaving the current region's solid and entering a later one, each traced exactly where the operands have ray forms (and marched where they do not). m_hit is the crossing, its normal pointing from the region left into the region entered; m_surface the surface crossed (leaf, part, surface label), its m_ownerRegion the region left and m_neighborRegion the region entered. The ray starts counting a hundredth of the march's tolerance at the object's scale past a_tMin (RayOptions::m_tolerance times m_scale, or the box's diagonal), so a ray crossing several layers asks again from the last crossing's t, and layers thinner than that are passed over. Callable on a device.
| [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 the parts without a ray form. |
|
inlinenoexcept |
The first change of region along a particle's step from one point to another (see firstRegionChange(ray)), t measured from a_from.
| [in] | a_from | Start of the step. |
| [in] | a_to | End of the step. |
| [in] | a_tMin | Distance from a_from where the step starts counting. |
| [in] | a_options | How to march the parts without a ray form. |
|
inlinenoexcept |
The first crossing along a ray, and the surface crossed: the ray counterpart of closestSurface(), as firstHit() is of signedDistance(). The same as the free function firstSurface(). Callable on a device.
| [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 point along a ray where it crosses a subdomain's boundary, entering or leaving the subdomain: changes between two of its regions are passed through. For rendering, the subdomain is the set of visible regions: hidden ones are seen through. Reported as firstRegionChange() reports a crossing. Callable on a device.
| [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_subdomains | The subdomains. |
| [in] | a_subdomain | Subdomain. |
| [in] | a_options | How to march the parts without a ray form. |
|
inlinenoexcept |
The first crossing on the segment from a_from to a_to, and the surface crossed (see firstSurface() for a ray). Callable on a device.
| [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 |
How deep sub-program calls nest (0 if the tape has no Blur, Mollify, FiniteRepetition or BVH union).
|
inlinenoexcept |
How far signedDistance() can be trusted as a distance.
A runtime value, unlike a shape's static distanceQuality; a Tape used as another object's primitive therefore counts as DistanceQuality::Bound there.
|
inlinenoexcept |
A leaf's first surface: the leaf covers [getFirstSurface(leaf), getFirstSurface(leaf + 1)), so per-member data of a container leaf (a sphere's) is an array indexed by SurfaceRef::m_surface minus it.
| [in] | a_leaf | Leaf number, at most getNumPrimitives() (which gives getNumSurfaces()). |
|
inlinenoexcept |
The most objects in one union evaluated as written (one not built with Accelerate::BVH), nested sharp unions counted as one: what TapeOptions::m_largeUnionWarning is compared with. An Overlay, which is evaluated as written and takes no BVH, is not counted.
|
inlinenoexcept |
A region's material, as ExprIndex numbers the material labels. Callable on a device.
| [in] | a_region | Region. |
|
inlinenoexcept |
Number of unions evaluated with a BVH (those built with Accelerate::BVH).
|
inlinenoexcept |
Number of clauses over all sub-programs (the ray programs' not counted).
|
inlinenoexcept |
Number of primitives (leaves) in the tape, each occurrence counted.
|
inlinenoexcept |
Number of sub-programs (1 plus one per Blur, Mollify, FiniteRepetition and BVH union operand).
|
inlinenoexcept |
How many regions the object has: the background (region 0) and one per operand of its Overlays, numbered as ExprIndex numbers them; 2 for an object with no Overlay (the outside and the object).
|
inlinenoexcept |
How many distinct labels the expression has (ExprIndex::getNumSurfaceLabels()).
|
inlinenoexcept |
How many surfaces the tape numbers (see closestSurface()).
|
inlinenoexcept |
The label of the leaf a reference names (see getSurfaceLabel(uint32_t)).
| [in] | a_ref | Reference from closestLeaf(). |
|
inlinenoexcept |
A leaf's label, as SurfaceLabel() resolves it (ExprIndex::getSurfaceLabel()): the nearest label above the leaf, the leaf's own included, but a label above a chain of maps relabels the object below them.
Labels are numbered from 0 in the order their names first appear in the expression, depth first, as ExprIndex numbers them, which also holds the names. A device reads the label from the tape's pool, so per-label data (a boundary condition, a restitution coefficient) is an array indexed by it.
| [in] | a_leaf | Leaf number: LeafRef::m_leaf from closestLeaf(), or HitT::m_primitive of a hit. |
|
inlinenoexcept |
Whether a ray crosses the object's surface in [a_tMin, a_tMax].
The same as the free function intersects(). Callable on a device.
| [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 the object's surface.
The same as the free function intersects(). Callable on a device.
| [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 |
Whether a reference's leaf is a primitive of type P.
| P | Primitive type (one of the tape's types). |
| [in] | a_ref | Reference from closestLeaf(). |
|
inlinenoexcept |
The tape's arrays, with no location: what an outer pool-resident object stores.
| bool EBGeometry::Tape< T, UserPrimitives >::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 signedDistance(), on the host, for diagnostics (ExprIndex::checkLabels()). The tape's pool must be readable on the host.
| [in] | a_leaf | The leaf, numbered as ExprIndex numbers them. |
| [in] | a_point | The point, in the leaf's frame. |
| [out] | a_value | Its value. |
|
inlinenoexcept |
The primitive a reference names, by value: the shape itself, or for a pool-resident type (a mesh SDF, a BVH union, a tape) its handle, rebuilt with the tape's location, so that it resolves against the same pool (or mirror) the tape does.
| P | Primitive type; the leaf must be one (isPrimitive<P>()). |
| [in] | a_ref | Reference from closestLeaf(). |
|
inlinenoexcept |
A view of this tape resolving against another pool of its mirror chain.
The pool must be this tape's own pool or a mirror of it (see PoolLocation::rebasedOnto()). Pool-resident primitives follow the view, since they are stored as layouts.
| [in] | a_pool | Pool to resolve against. |
|
inlinenoexcept |
The region a point is in: the last operand of the Overlays whose solid holds it (later operands are on top), or the background (0). Exact in sign: every point is in exactly one region. Callable on a device.
| [in] | a_point | Point. |
|
inlinenoexcept |
Every region's function at a point (signedDistance(point, region), the same values), in one pass: calls a_visit(region, value) for each region, from the last one down to the background (0). Each operand's solid is evaluated once, twice when the regions share masks, where asking signedDistance() region by region evaluates the later solids again for each; regions with different masks are asked one by one. Callable on a device.
Region k's function is max(S_k, -min of the later solids without the masks the two share). With the same masks on every region (none, usually), every later solid drops all of them, so a running minimum of the unmasked solids, taken from the top down, serves every region: n solids, or 2n with masks, instead of n^2 / 2.
| Visit | A callable taking (uint32_t region, T value). |
| [in] | a_point | Point. |
| [in] | a_visit | What to do with each region's value. |
|
inlinenoexcept |
The object's value at a point: negative inside, positive outside, zero on the surface.
The sign is always meaningful. The magnitude is what getDistanceQuality() says: the distance to the surface (Exact), at most that distance (Bound), or nothing (NotADistance). The name is the same for every shape whatever its quality; see isShape. Callable on a device through a view onto a mirrored pool (rebasedView()).
| [in] | a_point | Query point. |
|
inlinenoexcept |
A subdomain's implicit function: half the difference of the smallest function of a region in the subdomain and the smallest of one not in it (the background included), negative exactly inside the subdomain and zero only on its surface: where one of its regions meets a region not in it, never on the contact between two of its own. A distance bound, exact near a smooth piece of surface; what a cut-cell solver cuts for the subdomain, and the function of a union of materials (a subdomain of their regions). Callable on a device.
| [in] | a_point | Point. |
| [in] | a_subdomains | The subdomains (built from this tape's regions). |
| [in] | a_subdomain | Subdomain (below a_subdomains.getNumSubdomains()). |
|
inlinenoexcept |
A region's implicit function: negative exactly inside the region, its zero contour the region's surface, interfaces with other regions included. For region k it is max(S_k, -min of the later S_j), S_j being operand j's solid; for the background, minus signedDistance(). A distance bound, exact near a smooth piece of surface of exact operands; what a cut-cell code cuts for one region. Callable on a device.
| [in] | a_point | Point. |
| [in] | a_region | Region (below getNumRegions()). |
|
inlinenoexcept |
Call a function with the primitive a reference names, as primitive.
() returns it, whatever its type.
| F | Callable taking any of the tape's primitive types (a generic lambda in host code). In a CUDA or HIP translation unit, pass a functor whose call operator is EBGEOMETRY_HOST_DEVICE: the device compiler treats a lambda's call operator as a host function here. |
| [in] | a_ref | Reference from closestLeaf(). |
| [in] | a_f | Function. |
|
staticconstexpr |
Whether the tape compiles feature F (see TapeFeature).
| F | Feature. |