v0.15.0
Loading...
Searching...
No Matches
sdf_hertz_3d.Sphere Class Reference

Public Member Functions

 sDF (r, xc, yc, zc, x, y, z)
 
 gradSdf (xc, yc, zc, x, y, z)
 
 hessSdf (xc, yc, zc, x, y, z)
 
 sDF (r, xc, yc, zc, x, y, z)
 
 gradSdf (xc, yc, zc, x, y, z)
 
 hessSdf (xc, yc, zc, x, y, z)
 

Detailed Description

Definition at line 20 of file sdf_hertz_3d.py.

Member Function Documentation

◆ gradSdf() [1/2]

sdf_hertz_3d.Sphere.gradSdf ( xc,
yc,
zc,
x,
y,
z )

Definition at line 24 of file sdf_hertz_3d.py.

24 def gradSdf(xc, yc, zc, x, y, z):
25 c_val_A = 1./np.sqrt((x-xc)**2 + (y-yc)**2 + (z-zc)**2)
26 return np.hstack([(c_val_A * (x-xc)).reshape((-1,1)), (c_val_A * (y-yc)).reshape((-1,1)), (c_val_A * (z-zc)).reshape((-1,1))])
27

◆ gradSdf() [2/2]

sdf_hertz_3d.Sphere.gradSdf ( xc,
yc,
zc,
x,
y,
z )

Definition at line 24 of file sdf_hertz_3d.py.

24 def gradSdf(xc, yc, zc, x, y, z):
25 c_val_A = 1./np.sqrt((x-xc)**2 + (y-yc)**2 + (z-zc)**2)
26 return np.hstack([(c_val_A * (x-xc)).reshape((-1,1)), (c_val_A * (y-yc)).reshape((-1,1)), (c_val_A * (z-zc)).reshape((-1,1))])
27

◆ hessSdf() [1/2]

sdf_hertz_3d.Sphere.hessSdf ( xc,
yc,
zc,
x,
y,
z )

Definition at line 28 of file sdf_hertz_3d.py.

28 def hessSdf(xc, yc, zc, x, y, z):
29 x, y, z = x-xc, y-yc, z-zc
30 denom = (x**2 + y**2 + z**2)**(3/2)
31 sqrt_denom = np.sqrt(x**2 + y**2 + z**2)
32 Hxx = -x**2/denom + 1/sqrt_denom
33 Hzx = -x*z/denom
34 Hxy = -x*y/denom
35 Hyy = -y**2/denom + 1/sqrt_denom
36 Hzy = -y*z/denom
37 Hzz = -z**2/denom + 1/sqrt_denom
38 # xx, yx, zx, yy, zy, zz
39 return np.hstack([Hxx.reshape((-1,1)), Hxy.reshape((-1,1)), Hzx.reshape((-1,1)), Hyy.reshape((-1,1)), Hzy.reshape((-1,1)), Hzz.reshape((-1,1))])

◆ hessSdf() [2/2]

sdf_hertz_3d.Sphere.hessSdf ( xc,
yc,
zc,
x,
y,
z )

Definition at line 28 of file sdf_hertz_3d.py.

28 def hessSdf(xc, yc, zc, x, y, z):
29 x, y, z = x-xc, y-yc, z-zc
30 denom = (x**2 + y**2 + z**2)**(3/2)
31 sqrt_denom = np.sqrt(x**2 + y**2 + z**2)
32 Hxx = -x**2/denom + 1/sqrt_denom
33 Hzx = -x*z/denom
34 Hxy = -x*y/denom
35 Hyy = -y**2/denom + 1/sqrt_denom
36 Hzy = -y*z/denom
37 Hzz = -z**2/denom + 1/sqrt_denom
38 # xx, yx, zx, yy, zy, zz
39 return np.hstack([Hxx.reshape((-1,1)), Hxy.reshape((-1,1)), Hzx.reshape((-1,1)), Hyy.reshape((-1,1)), Hzy.reshape((-1,1)), Hzz.reshape((-1,1))])

◆ sDF() [1/2]

sdf_hertz_3d.Sphere.sDF ( r,
xc,
yc,
zc,
x,
y,
z )

Definition at line 21 of file sdf_hertz_3d.py.

21 def sDF(r, xc, yc, zc, x, y, z):
22 return np.sqrt((x - xc)**2 + (y - yc)**2 + (z - zc)**2) - r
23

◆ sDF() [2/2]

sdf_hertz_3d.Sphere.sDF ( r,
xc,
yc,
zc,
x,
y,
z )

Definition at line 21 of file sdf_hertz_3d.py.

21 def sDF(r, xc, yc, zc, x, y, z):
22 return np.sqrt((x - xc)**2 + (y - yc)**2 + (z - zc)**2) - r
23

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