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::Torus< TScalar > Struct Template Reference

Torus centered in \( (0,0,0) \) with minor+major radius \( t = (r,R) \). More...

#include <Primitive.h>

Inheritance diagram for pbat::geometry::sdf::Torus< TScalar >:
pbat::geometry::sdf::Primitive

Public Types

using ScalarType = TScalar
 Scalar type.
 

Public Member Functions

 Torus ()=default
 Default constructor.
 
 Torus (Vec2< ScalarType > const &t_)
 Construct a new Torus object.
 
PBAT_HOST_DEVICE ScalarType Eval (Vec3< ScalarType > const &p) const
 Evaluate the signed distance function at a point.
 

Public Attributes

Vec2< ScalarTypet {TScalar(1), TScalar(0.5)}
 t[0]: minor radius, t[1]: major radius
 

Detailed Description

template<common::CArithmetic TScalar>
struct pbat::geometry::sdf::Torus< TScalar >

Torus centered in \( (0,0,0) \) with minor+major radius \( t = (r,R) \).

Template Parameters
TScalarScalar type

Constructor & Destructor Documentation

◆ Torus()

template<common::CArithmetic TScalar>
pbat::geometry::sdf::Torus< TScalar >::Torus ( Vec2< ScalarType > const & t_)
inlineexplicit

Construct a new Torus object.

Parameters
t_Minor and major radius of the torus

Member Function Documentation

◆ Eval()

template<common::CArithmetic TScalar>
PBAT_HOST_DEVICE ScalarType pbat::geometry::sdf::Torus< TScalar >::Eval ( Vec3< ScalarType > const & p) const
inline

Evaluate the signed distance function at a point.

Parameters
pPoint in 3D space
Returns
Signed distance to the torus (negative inside, positive outside)

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