![]() |
PeriDyno 1.0.0
|
#include <DistanceField3D.h>
Public Types | |
typedef TDataType::Real | Real |
typedef TDataType::Coord | Coord |
Public Member Functions | |
DistanceField3D () | |
DistanceField3D (std::string filename) | |
~DistanceField3D () | |
Should not release data here, call release() explicitly. | |
void | release () |
Release m_distance Should be explicitly called before destruction to avoid GPU memory leak. | |
void | translate (const Coord &t) |
Translate the distance field with a displacement. | |
void | scale (const Real s) |
Scale the distance field. | |
GPU_FUNC void | getDistance (const Coord &p, Real &d, Coord &normal) |
Query the signed distance for p. | |
DYN_FUNC uint | nx () |
DYN_FUNC uint | ny () |
DYN_FUNC uint | nz () |
void | loadSDF (std::string filename, bool inverted=false) |
load signed distance field from a file | |
void | loadBox (Coord &lo, Coord &hi, bool inverted=false) |
load signed distance field from a Box (lo, hi) | |
void | loadCylinder (Coord ¢er, Real radius, Real height, int axis, bool inverted=false) |
void | loadSphere (Coord ¢er, Real radius, bool inverted=false) |
void | setSpace (const Coord p0, const Coord p1, Real h) |
Coord | lowerBound () |
Coord | upperBound () |
void | assign (DistanceField3D< TDataType > &sdf) |
DArray3D< Real > & | distances () |
void | setDistance (CArray3D< Real > distance) |
Real | getGridSpacing () |
void | invertSDF () |
Invert the signed distance field. | |
Private Member Functions | |
GPU_FUNC Real | lerp (Real a, Real b, Real alpha) const |
Private Attributes | |
Coord | mOrigin |
Lower left corner. | |
Real | mH |
grid spacing | |
bool | mInverted = false |
DArray3D< Real > | mDistances |
Storing the signed distance field as a 3D array. | |
Definition at line 22 of file DistanceField3D.h.
typedef TDataType::Coord dyno::DistanceField3D< TDataType >::Coord |
Definition at line 25 of file DistanceField3D.h.
typedef TDataType::Real dyno::DistanceField3D< TDataType >::Real |
Definition at line 24 of file DistanceField3D.h.
dyno::DistanceField3D< TDataType >::DistanceField3D | ( | ) |
dyno::DistanceField3D< TDataType >::DistanceField3D | ( | std::string | filename | ) |
dyno::DistanceField3D< TDataType >::~DistanceField3D | ( | ) |
Should not release data here, call release() explicitly.
|
inline |
|
inline |
Definition at line 105 of file DistanceField3D.h.
GPU_FUNC void dyno::DistanceField3D< TDataType >::getDistance | ( | const Coord & | p, |
Real & | d, | ||
Coord & | normal ) |
Query the signed distance for p.
p | position |
d | return the signed distance at position p |
normal | return the normal at position p |
Definition at line 146 of file DistanceField3D.h.
|
inline |
Definition at line 111 of file DistanceField3D.h.
void dyno::DistanceField3D< TDataType >::invertSDF | ( | ) |
Invert the signed distance field.
|
inlineprivate |
Definition at line 120 of file DistanceField3D.h.
void dyno::DistanceField3D< TDataType >::loadBox | ( | Coord & | lo, |
Coord & | hi, | ||
bool | inverted = false ) |
load signed distance field from a Box (lo, hi)
inverted | indicated whether the signed distance field should be positive in outside. default: +[—]+ |
void dyno::DistanceField3D< TDataType >::loadCylinder | ( | Coord & | center, |
Real | radius, | ||
Real | height, | ||
int | axis, | ||
bool | inverted = false ) |
void dyno::DistanceField3D< TDataType >::loadSDF | ( | std::string | filename, |
bool | inverted = false ) |
load signed distance field from a file
filename | |
inverted | indicated whether the signed distance field should be inverted after initialization |
void dyno::DistanceField3D< TDataType >::loadSphere | ( | Coord & | center, |
Real | radius, | ||
bool | inverted = false ) |
|
inline |
Definition at line 93 of file DistanceField3D.h.
|
inline |
Definition at line 65 of file DistanceField3D.h.
|
inline |
Definition at line 67 of file DistanceField3D.h.
|
inline |
Definition at line 69 of file DistanceField3D.h.
void dyno::DistanceField3D< TDataType >::release | ( | ) |
Release m_distance Should be explicitly called before destruction to avoid GPU memory leak.
void dyno::DistanceField3D< TDataType >::scale | ( | const Real | s | ) |
Scale the distance field.
s | scaling factor |
|
inline |
void dyno::DistanceField3D< TDataType >::setSpace | ( | const Coord | p0, |
const Coord | p1, | ||
Real | h ) |
void dyno::DistanceField3D< TDataType >::translate | ( | const Coord & | t | ) |
Translate the distance field with a displacement.
t | displacement |
|
inline |
Definition at line 95 of file DistanceField3D.h.
|
private |
Storing the signed distance field as a 3D array.
Definition at line 142 of file DistanceField3D.h.
|
private |
grid spacing
Definition at line 134 of file DistanceField3D.h.
|
private |
Definition at line 136 of file DistanceField3D.h.
|
private |
Lower left corner.
Definition at line 128 of file DistanceField3D.h.