MADNESS 0.10.1
|
A rectangle (2 dimensions) More...
#include <sdf_shape_2D.h>
Public Member Functions | |
SDFRectangle (const coord_2d &length, const coord_2d ¢er) | |
Constructor for rectangle. | |
coord_2d | grad_sdf (const coord_2d &pt) const |
double | sdf (const coord_2d &pt) const |
Computes the normal distance. | |
Public Member Functions inherited from madness::SignedDFInterface< 2 > | |
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_2d | center |
the center | |
const coord_2d | lengths |
Half the length of each side. | |
A rectangle (2 dimensions)
This SDF naively uses contours, and should be improved for serious usage.
Constructor for rectangle.
length | The lengths of the rectangle |
center | The center of the rectangle |
Computes the gradient of the SDF.
pt | Point at which to compute the gradient |
References MADNESS_EXCEPTION.
|
inline |
|
protected |
Half the length of each side.
Referenced by sdf().