Signed distance field for the frame of a box: its twelve edges, as bars of square cross-section.
More...
|
|
| BoxFrameSDF ()=default |
| | Default constructor. Constructs the frame of the cube [-0.5, 0.5]^3, with bars 0.1 thick.
|
| |
| | BoxFrameSDF (const Vec3T< T > &a_loCorner, const Vec3T< T > &a_hiCorner, T a_thickness) |
| | Full constructor.
|
| |
|
| BoxFrameSDF (const BoxFrameSDF &)=default |
| | Copy constructor.
|
| |
|
| BoxFrameSDF (BoxFrameSDF &&)=default |
| | Move constructor.
|
| |
| BoxFrameSDF & | operator= (const BoxFrameSDF &)=default |
| | Copy assignment.
|
| |
| BoxFrameSDF & | operator= (BoxFrameSDF &&)=default |
| | Move assignment.
|
| |
| const Vec3T< T > & | getLowCorner () const noexcept |
| | Get the lower corner of the box the frame fits.
|
| |
| const Vec3T< T > & | getHighCorner () const noexcept |
| | Get the upper corner of the box the frame fits.
|
| |
| const T & | getThickness () const noexcept |
| | Get the thickness of a bar.
|
| |
| T | signedDistance (const Vec3T< T > &a_point) const noexcept |
| | Signed distance function for the frame.
|
| |
| uint32_t | getNumParts () const noexcept |
| | How many parts the shape has (see hasParts): its twelve bars.
|
| |
| uint32_t | closestPart (const Vec3T< T > &a_point) const noexcept |
| | The part whose term decides the value at a point (see hasParts): the nearest bar, 4 a + 2 i + j for the bar along axis a (x, y, z) on the low (0) or high (1) side of the first (i) and the second (j) of the other two axes, in the order x, y, z. Where two bars meet, the one along the lower axis.
|
| |
| BoundingVolumes::AABBT< T > | computeBoundingVolume () const noexcept |
| | The shape's axis-aligned bounding box: the box the frame fits.
|
| |
template<class T>
class EBGeometry::BoxFrameSDF< T >
Signed distance field for the frame of a box: its twelve edges, as bars of square cross-section.
The frame fits the box between the two corners, and each bar is as thick as given, measured across it. The distance is exact. Outside, it is Quilez's box frame: the point is folded into one octant of the box, and the frame there is three bars meeting at a corner, the nearest of which is the distance. Inside, it is the distance to the box's outer faces or to the openings between the bars, which the nearest bar's depth undercuts where bars meet. Round its edges with Offset of a slightly smaller frame. By default the frame is that of the cube [-0.5, 0.5]^3, with bars 0.1 thick.
- Template Parameters
-
| T | Floating-point precision. |
The three bars that meet at the corner of the octant a point is in: the signed distance to the one along x, along y and along z.
Out of line on a device (the frame's solver): inlined, it would be copied into every level of every tape kernel, whatever shapes the tape holds, which makes the device compile of every tape kernel much slower. A call costs little beside its three bars.
- Parameters
-
- Returns
- The three distances.
The part whose term decides the value at a point (see hasParts): the nearest bar, 4 a + 2 i + j for the bar along axis a (x, y, z) on the low (0) or high (1) side of the first (i) and the second (j) of the other two axes, in the order x, y, z. Where two bars meet, the one along the lower axis.
- Parameters
-
- Returns
- The part.