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

Capped cylinder shape with endpoints \( a, b \in \mathbb{R}^3 \) and radius \( r \). More...

#include <Primitive.h>

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

Public Types

using ScalarType = TScalar
 Scalar type.
 

Public Member Functions

 CappedCylinder ()=default
 Default constructor.
 
 CappedCylinder (Vec3< ScalarType > const &a_, Vec3< ScalarType > const &b_, ScalarType r_)
 Construct a new Capped Cylinder object.
 
PBAT_HOST_DEVICE ScalarType Eval (Vec3< ScalarType > const &p) const
 Evaluate the signed distance function at a point.
 

Public Attributes

Vec3< ScalarTypea {TScalar(-1), TScalar(0), TScalar(0)}
 Endpoint a of the capped cylinder.
 
Vec3< ScalarTypeb {TScalar(1), TScalar(0), TScalar(0)}
 Endpoint b of the capped cylinder.
 
ScalarType r {TScalar(0.2)}
 Radius of the capped cylinder.
 

Detailed Description

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

Capped cylinder shape with endpoints \( a, b \in \mathbb{R}^3 \) and radius \( r \).

Template Parameters
TScalarScalar type

Constructor & Destructor Documentation

◆ CappedCylinder()

template<common::CArithmetic TScalar>
pbat::geometry::sdf::CappedCylinder< TScalar >::CappedCylinder ( Vec3< ScalarType > const & a_,
Vec3< ScalarType > const & b_,
ScalarType r_ )
inlineexplicit

Construct a new Capped Cylinder object.

Parameters
a_Endpoint a of the capped cylinder
b_Endpoint b of the capped cylinder
r_Radius of the capped cylinder

Member Function Documentation

◆ Eval()

template<common::CArithmetic TScalar>
PBAT_HOST_DEVICE ScalarType pbat::geometry::sdf::CappedCylinder< 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 capped cylinder (negative inside, positive outside)

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