MADNESS  version 0.9
Public Member Functions | Protected Attributes | List of all members
madness::SDFCone Class Reference

A cone (3 dimensions) More...

#include <sdf_shape_3D.h>

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

Public Member Functions

 SDFCone (const double c, const coord_3d &apex, const coord_3d &direc)
 Constructor for cone. More...
 
double sdf (const coord_3d &pt) const
 Computes the normal distance. More...
 
coord_3d grad_sdf (const coord_3d &pt) const
 Computes the gradient of the SDF. More...
 
- Public Member Functions inherited from madness::SignedDFInterface< 3 >
virtual double sdf (const Vector< double, NDIM > &x) const =0
 Returns the signed distance from the surface,. More...
 
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 ~SignedDFInterface ()
 

Protected Attributes

const coord_3d apex
 The apex. More...
 
const double c
 The radius. More...
 
const coord_3d dir
 The direction of the axis, from the apex INSIDE. More...
 

Detailed Description

A cone (3 dimensions)

The cone is defined by

\[ \sqrt{x^2 + y^2} - c * z = 0 \]

where $ z $ is along the cone's axis.

Constructor & Destructor Documentation

madness::SDFCone::SDFCone ( const double  c,
const coord_3d apex,
const coord_3d direc 
)
inline

Constructor for cone.

Parameters
cParameter $ c $ in the definition of the cone
apexApex of cone
direcOriented axis of the cone

Member Function Documentation

coord_3d madness::SDFCone::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.

double madness::SDFCone::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 sqrt().

Member Data Documentation

const coord_3d madness::SDFCone::apex
protected

The apex.

const double madness::SDFCone::c
protected

The radius.

const coord_3d madness::SDFCone::dir
protected

The direction of the axis, from the apex INSIDE.


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