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. More... | |
coord_2d | grad_sdf (const coord_2d &pt) const |
double | sdf (const coord_2d &pt) const |
Computes the normal distance. More... | |
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] ) More... | |
virtual double | sdf (const Vector< double, NDIM > &x) const=0 |
Returns the signed distance from the surface,. More... | |
Protected Attributes | |
const coord_2d | center |
the center More... | |
const coord_2d | lengths |
Half the length of each side. More... | |
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().