MADNESS  0.10.1
Public Member Functions | Protected Attributes | List of all members
madness::SDFCylinder Class Reference

A cylinder (3 dimensions) More...

#include <sdf_shape_3D.h>

Inheritance diagram for madness::SDFCylinder:
Inheritance graph
[legend]
Collaboration diagram for madness::SDFCylinder:
Collaboration graph
[legend]

Public Member Functions

 SDFCylinder (const double radius, const double length, const coord_3d &axpt, const coord_3d &axis)
 Constructor for cylinder. More...
 
coord_3d grad_sdf (const coord_3d &pt) const
 
double sdf (const coord_3d &pt) const
 Computes the normal distance. More...
 
- Public Member Functions inherited from madness::SignedDFInterface< 3 >
virtual ~SignedDFInterface ()
 
virtual Vector< double, NDIMgrad_sdf (const Vector< double, NDIM > &x) const=0
 Returns the gradient of the signed distance from the surface (i.e., dsdf(x)/dx[i] ) More...
 
virtual double sdf (const Vector< double, NDIM > &x) const=0
 Returns the signed distance from the surface,. More...
 

Protected Attributes

double a
 half the length of the cylinder More...
 
coord_3d axis
 the axial direction of the cylinder More...
 
coord_3d center
 the central axial point of the cylinder (distance a from both ends) More...
 
double radius
 the radius of the cylinder More...
 

Detailed Description

A cylinder (3 dimensions)

Constructor & Destructor Documentation

◆ SDFCylinder()

madness::SDFCylinder::SDFCylinder ( const double  radius,
const double  length,
const coord_3d axpt,
const coord_3d axis 
)
inline

Constructor for cylinder.

Parameters
radiusThe radius of the cylinder
lengthThe length of the cylinder
axptThe central axial point of the cylinder (equidistant from both ends)
axisThe axial direction of the cylinder

Member Function Documentation

◆ grad_sdf()

coord_3d madness::SDFCylinder::grad_sdf ( const coord_3d pt) const
inline

Computes the gradient of the SDF.

Parameters
ptPoint at which to compute the gradient
Returns
the gradient

References MADNESS_EXCEPTION.

◆ sdf()

double madness::SDFCylinder::sdf ( const coord_3d pt) const
inline

Computes the normal distance.

This SDF naively uses contours, and should be improved before serious usage.

Parameters
ptPoint at which to compute the distance from the surface
Returns
The signed distance from the surface

References a, axis, center, dist(), max, and radius.

Member Data Documentation

◆ a

double madness::SDFCylinder::a
protected

half the length of the cylinder

Referenced by sdf().

◆ axis

coord_3d madness::SDFCylinder::axis
protected

the axial direction of the cylinder

Referenced by sdf().

◆ center

coord_3d madness::SDFCylinder::center
protected

the central axial point of the cylinder (distance a from both ends)

Referenced by sdf().

◆ radius

double madness::SDFCylinder::radius
protected

the radius of the cylinder

Referenced by sdf().


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