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

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

◆ SDFCone()

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

◆ grad_sdf()

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.

◆ sdf()

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 apex, c, diff(), and dir.

Member Data Documentation

◆ apex

const coord_3d madness::SDFCone::apex
protected

The apex.

Referenced by sdf().

◆ c

const double madness::SDFCone::c
protected

The radius.

Referenced by sdf().

◆ dir

const coord_3d madness::SDFCone::dir
protected

The direction of the axis, from the apex INSIDE.

Referenced by sdf().


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