EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
Public Attributes | Static Public Attributes | List of all members
EBGeometry::PrimitiveRef< T > Struct Template Reference

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...

#include <EBGeometry_PrimitiveRef.hpp>

Public Attributes

uint32_t m_leaf = None
 The leaf: its number in expression order, depth first, each occurrence counted.
 
uint32_t m_type = None
 The index of the primitive's type in the tape's type list (the built-in types, then UserPrimitives).
 
uint32_t m_index = None
 The primitive's index within that type's array.
 
Vec3T< T > m_localPoint = Vec3T<T>::zeros()
 The point in the primitive's own frame (after the composition's maps), at which it can be queried itself: its signed distance, closest face or normal.
 

Static Public Attributes

static constexpr uint32_t None = 0xFFFFFFFFU
 No leaf (an empty composition).
 

Detailed Description

template<class T>
struct EBGeometry::PrimitiveRef< T >

The deciding leaf of a composition at a point: the primitive whose surface the composed value comes from there, as Tape::closestPrimitive() reports it.

A union or intersection takes the leaf of the operand whose value it takes; a smooth one the more extreme operand's; a blur its center tap's, a mollification its heaviest tap's; a complement, offset, annulus, map, elongation or repetition its operand's. For Difference(box, sphere), a point near the carved cavity gets the sphere and a point near the box's outside gets the box. This is the leaf that decides the value, not the geometrically nearest primitive, which could be one the composition removed. A nested composite (a fused composition, which is one shape with one surface; a tape listed as a primitive; a BVH union) is one leaf.

The tape that made the reference returns the primitive itself: isPrimitive<P>(ref), primitive<P>(ref) (by value: the shape, or a pool-resident one's handle rebuilt with the tape's location) and visitPrimitive(ref, f).

Template Parameters
TFloating-point precision.

The documentation for this struct was generated from the following file: