11 def sdf(delta_t, t, x, y, z, tx, ty, tz, block_id):
14 return np.ones_like(x)
16 return zPlane.sDF(xc, yc, zc - d * t, x, y, z)
18 def grad_sdf(delta_t, t, x, y, z, tx, ty, tz, block_id):
20 zeros = np.zeros_like(x)
21 zeros = zeros.reshape((-1,1))
22 grad_array = np.hstack([zeros, zeros, zeros])
25 return zPlane.gradSdf(xc, yc, zc - d * t, x, y, z)
27 def hess_sdf(delta_t, t, x, y, z, tx, ty, tz, block_id):
29 zeros = np.zeros_like(x)
30 zeros = zeros.reshape((-1,1))
31 hess_array = np.hstack([zeros, zeros, zeros, zeros, zeros, zeros])
35 return zPlane.hessSdf(xc, yc, zc - d * t, x, y, z)
38 def sDF(r, xc, yc, zc, x, y, z):
39 dx = np.subtract(x, xc)
40 dy = np.subtract(y, yc)
41 dz = np.subtract(z, zc)
42 a = dx**2 + dy**2 + dz**2
47 a = (x-xc)**2 + (y-yc)**2 + (z-zc)**2
50 c_val_dx = c_val_A * (x-xc)
51 c_val_dy = c_val_A * (y-yc)
52 c_val_dz = c_val_A * (z-zc)
54 c_val_dx = c_val_dx.reshape((-1,1))
55 c_val_dy = c_val_dy.reshape((-1,1))
56 c_val_dz = c_val_dz.reshape((-1,1))
57 grad_array = np.hstack([c_val_dx,c_val_dy,c_val_dz])
64 Hxx = -x**2/(x**2 + y**2 + z**2)**(3/2) + 1/np.sqrt(x**2 + y**2 + z**2)
65 Hzx = -x*z/(x**2 + y**2 + z**2)**(3/2)
66 Hxy = -x*y/(x**2 + y**2 + z**2)**(3/2)
67 Hyy = -y**2/(x**2 + y**2 + z**2)**(3/2) + 1/np.sqrt(x**2 + y**2 + z**2)
68 Hzy = -y*z/(x**2 + y**2 + z**2)**(3/2)
69 Hzz = -z**2/(x**2 + y**2 + z**2)**(3/2) + 1/np.sqrt(x**2 + y**2 + z**2)
71 Hxx = Hxx.reshape((-1,1))
72 Hzx = Hzx.reshape((-1,1))
73 Hxy = Hxy.reshape((-1,1))
74 Hyy = Hyy.reshape((-1,1))
75 Hzy = Hzy.reshape((-1,1))
76 Hzz = Hzz.reshape((-1,1))
77 hess_array = np.hstack([Hxx, Hxy, Hzx, Hyy, Hzy, Hzz])
83 def sDF(xc, yc, zc, x, y, z):
90 dx = dx.reshape((-1,1))
91 dy = dy.reshape((-1,1))
92 dz = dz.reshape((-1,1))
93 grad_array = np.hstack([dx, dy, -dz])
97 zeros = np.zeros_like(x)
98 zeros = zeros.reshape((-1,1))
100 hess_array = np.hstack([zeros, zeros, zeros, zeros, zeros, zeros])