MADNESS 0.10.1
madness::SDFBox Class Reference

A box (3 dimensions). More...

#include <sdf_shape_3D.h>

Inheritance diagram for madness::SDFBox:
Collaboration diagram for madness::SDFBox:

Public Member Functions

 SDFBox (const coord_3d &length, const coord_3d &center)
 Constructor for box.
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

const coord_3d center
 the center of the box
const coord_3d lengths
 Half the length of each side of the box.

Detailed Description

A box (3 dimensions).

Note
LIMIT – the 3 primary axes must be x, y, and z

Constructor & Destructor Documentation

◆ SDFBox()

madness::SDFBox::SDFBox ( const coord_3d & length,
const coord_3d & center )
inline

Constructor for box.

Parameters
lengthThe lengths of the box
centerThe center of the box

References center, length, and lengths.

Referenced by madness::SDFCube::SDFCube().

Member Function Documentation

◆ grad_sdf()

coord_3d madness::SDFBox::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::SDFBox::sdf ( const coord_3d & pt) const
inline

Computes the normal distance.

This SDF naively uses contours, and should be improved before serious usage. If far from the corners, the SDF is easy (similar to a plane), and is essentially what's implemented.

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

References center, diff(), lengths, and max.

Member Data Documentation

◆ center

const coord_3d madness::SDFBox::center
protected

the center of the box

Referenced by SDFBox(), madness::SDFCube::SDFCube(), and sdf().

◆ lengths

const coord_3d madness::SDFBox::lengths
protected

Half the length of each side of the box.

Referenced by SDFBox(), and sdf().


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