PhysicsBasedAnimationToolkit 0.0.10
Cross-platform C++20 library of algorithms and data structures commonly used in computer graphics research on physically-based simulation.
Loading...
Searching...
No Matches
pbat::geometry::sdf Namespace Reference

Namespace for signed distance functions (SDFs) and related operations. More...

Classes

struct  Bend
 Bend operation around the z axis. More...
 
struct  BinaryNode
 Base struct for all binary nodes. More...
 
struct  Box
 Axis-aligned box centered in \( (0,0,0) \) with half extents \( \text{he} \in \mathbb{R}^3 \). More...
 
struct  BoxFrame
 Box frame with half extents \( \text{he} \in \mathbb{R}^3 \) and thickness \( t \). More...
 
struct  Bump
 Wave-like bumpiness operation along the axes. More...
 
struct  CappedCylinder
 Capped cylinder shape with endpoints \( a, b \in \mathbb{R}^3 \) and radius \( r \). More...
 
struct  CappedTorus
 Capped torus centered in \( (0,0,0) \) with parameters sc, ra, rb. More...
 
struct  Capsule
 Capsule shape with endpoints \( a, b \in \mathbb{R}^3 \) and radius \( r \). More...
 
struct  Composite
 Composite signed distance function represented as a forest of SDFs. More...
 
struct  Cone
 Cone shape. More...
 
struct  CutHollowSphere
 Cut hollow sphere shape with radius \( r \), cut height \( h \) and thickness \( t \). More...
 
struct  Difference
 Difference operation. More...
 
struct  Elongate
 Elongation operation along the axes. More...
 
struct  ExclusiveOr
 Exclusive or operation. More...
 
struct  Forest
 CPU storage for a forest (of SDFs). More...
 
struct  HexagonalPrism
 Hexagonal prism shape. More...
 
struct  InfiniteCone
 Infinite cone shape. More...
 
struct  InfiniteCylinder
 Infinite cylinder. More...
 
struct  Intersection
 Intersection operation. More...
 
struct  Link
 Link shape as elongated torus with elongation length \( le \) and minor+major radius \(t = (r,R) \). More...
 
struct  Octahedron
 Octahedron shape. More...
 
struct  Onion
 Onion operation (i.e. carving interior) More...
 
struct  Plane
 Plane shape with normal \( n=(0,0,1) \) and point on the plane \( o=(0,0,0) \). More...
 
struct  Primitive
 Base struct for all primitive shapes. More...
 
struct  Pyramid
 Pyramid shape. More...
 
struct  Quadrilateral
 Quadrilateral shape with vertices \( a, b, c, d \in \mathbb{R}^3 \). More...
 
struct  Repeat
 Grid-like repetition operation along the axes. More...
 
struct  RotationalRepeat
 Circular repetition operation around axe. More...
 
struct  Round
 Rounding operation (i.e. positive offset surface) More...
 
struct  RoundedCylinder
 Rounded cylinder shape with height \( h \), radius \( \text{ra} \) and rounding radius \( \text{rb} \). More...
 
struct  Scale
 Uniform scaling operation. More...
 
struct  SmoothDifference
 Smooth difference operation. More...
 
struct  SmoothIntersection
 Smooth intersection operation. More...
 
struct  SmoothUnion
 Smooth union operation. More...
 
struct  Sphere
 Sphere centered in \( (0,0,0) \) with radius \( R \). More...
 
struct  Symmetrize
 Symmetrization operation along the x axis. More...
 
struct  Torus
 Torus centered in \( (0,0,0) \) with minor+major radius \( t = (r,R) \). More...
 
struct  Transform
 A 3D rigid transform. More...
 
struct  Triangle
 Triangle shape. More...
 
struct  Twist
 Twist operation around the y axis. More...
 
struct  UnaryNode
 Base struct for all unary nodes. More...
 
struct  Union
 Union operation. More...
 
struct  VerticalCappedCone
 Capped cone shape with height \( h \) and minor+major radius \( r^1, r^2 \). More...
 
struct  VerticalCappedCylinder
 Vertical capped cylinder shape with height \( h \) and radius \( r \). More...
 
struct  VerticalCapsule
 Capsule shape with height \( h \) and radius \( r \). More...
 
struct  VerticalRoundCone
 Vertical round cone shape with height \( h \), radii \( \text{r}^1, \text{r}^2 \) at endpoints. More...
 

Typedefs

template<common::CArithmetic TScalar>
using Node
 Variant type representing a node in the composite SDF forest.
 
template<common::CArithmetic TScalar>
using Vec2 = math::linalg::mini::SVector<TScalar, 2>
 2D vector type
 
template<common::CArithmetic TScalar>
using Vec3 = math::linalg::mini::SVector<TScalar, 3>
 3D vector type
 
template<common::CArithmetic TScalar>
using Vec4 = math::linalg::mini::SVector<TScalar, 4>
 4D vector type
 
template<common::CArithmetic TScalar>
using Mat2 = math::linalg::mini::SMatrix<TScalar, 2, 2>
 2x2 matrix type
 
template<common::CArithmetic TScalar>
using Mat3 = math::linalg::mini::SMatrix<TScalar, 3, 3>
 3x3 matrix type
 
template<common::CArithmetic TScalar>
using Zero2 = math::linalg::mini::Zeros<TScalar, 2, 1>
 2D zero vector type
 
template<common::CArithmetic TScalar>
using Zero3 = math::linalg::mini::Zeros<TScalar, 3, 1>
 3D zero vector type
 

Enumerations

enum class  ECompositeStatus { Valid , InvalidForest , UnexpectedNodeType }
 Status of the composite SDF. More...
 

Functions

auto FindRootsAndParents (std::span< std::pair< int, int > const > children) -> std::pair< std::vector< int >, std::vector< int > >
 Find the roots and parents of a composite SDF forest given its children.
 
template<common::CArithmetic TScalar>
TScalar sign (TScalar x)
 Sign function, i.e. \( \text{sign}(x) = +1 \text{ if } x > 0, -1 \text{ if } x < 0, 0 \text{ if } x = 0 \).
 

Detailed Description

Namespace for signed distance functions (SDFs) and related operations.

Enumeration Type Documentation

◆ ECompositeStatus

Status of the composite SDF.

Enumerator
Valid 

The composite SDF can be evaluated.

InvalidForest 

The SDF forest topology is invalid (wrong children/ancestor relations)

UnexpectedNodeType 

An unexpected node type was encountered.

Function Documentation

◆ FindRootsAndParents()

PBAT_API auto pbat::geometry::sdf::FindRootsAndParents ( std::span< std::pair< int, int > const > children) -> std::pair< std::vector< int >, std::vector< int > >

Find the roots and parents of a composite SDF forest given its children.

Parameters
children|# nodes| children pairs (ci, cj) of each node, such that c* < 0 if no child
Returns
(roots, parents) where roots is a vector of root node indices in the forest and parents is a vector of parent node indices, such that parents[n] = -1 if n is a root

◆ sign()

template<common::CArithmetic TScalar>
TScalar pbat::geometry::sdf::sign ( TScalar x)

Sign function, i.e. \( \text{sign}(x) = +1 \text{ if } x > 0, -1 \text{ if } x < 0, 0 \text{ if } x = 0 \).

Template Parameters
TScalarScalar type
Parameters
xInput value
Returns
Sign of x