MADNESS 0.10.1
madness::SDFCylinder Class Reference

A cylinder (3 dimensions). More...

#include <sdf_shape_3D.h>

Inheritance diagram for madness::SDFCylinder:
Collaboration diagram for madness::SDFCylinder:

Public Member Functions

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

Protected Attributes

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

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

References a, axis, center, length, and radius.

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(), and radius.

Member Data Documentation

◆ a

double madness::SDFCylinder::a
protected

half the length of the cylinder

Referenced by SDFCylinder(), and sdf().

◆ axis

coord_3d madness::SDFCylinder::axis
protected

the axial direction of the cylinder

Referenced by SDFCylinder(), and sdf().

◆ center

coord_3d madness::SDFCylinder::center
protected

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

Referenced by SDFCylinder(), and sdf().

◆ radius

double madness::SDFCylinder::radius
protected

the radius of the cylinder

Referenced by SDFCylinder(), and sdf().


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