v0.14.0
sdf_plane_3d.py
Go to the documentation of this file.
1 import math
2 import numpy as np
3 
4 d = 0.00217384 # indentation depth
5 
6 xc = 0
7 yc = 0
8 zc = 0
9 
10 def sdf(delta_t, t, x, y, z, tx, ty, tz, block_id):
11  return zPlane.sDF(xc, yc, zc - d * t, x, y, z)
12 
13 def grad_sdf(delta_t, t, x, y, z, tx, ty, tz, block_id):
14  return zPlane.gradSdf(xc, yc, zc - d * t, x, y, z)
15 
16 def hess_sdf(delta_t, t, x, y, z, tx, ty, tz, block_id):
17  return zPlane.hessSdf(xc, yc, zc - d * t, x, y, z)
18 
19 class zPlane:
20  def sDF(xc, yc, zc, x, y, z):
21  return np.subtract(zc, z)
22 
23  def gradSdf(xc, yc, zc, x, y, z):
24  dx = np.zeros_like(x).reshape((-1, 1))
25  dy = np.zeros_like(y).reshape((-1, 1))
26  dz = np.full_like(z, -1).reshape((-1, 1))
27  return np.hstack([dx, dy, dz])
28 
29  def hessSdf(xc, yc, zc, x, y, z):
30  zeros = np.zeros_like(x).reshape((-1, 1))
31  return np.hstack([zeros for _ in range(6)]) # xx, yx, zx, yy, zy, zz
sdf_plane_3d.grad_sdf
def grad_sdf(delta_t, t, x, y, z, tx, ty, tz, block_id)
Definition: sdf_plane_3d.py:13
sdf_plane_3d.zPlane
Definition: sdf_plane_3d.py:19
sdf_plane_3d.zPlane.sDF
def sDF(xc, yc, zc, x, y, z)
Definition: sdf_plane_3d.py:20
sdf_plane_3d.sdf
def sdf(delta_t, t, x, y, z, tx, ty, tz, block_id)
Definition: sdf_plane_3d.py:10
sdf_plane_3d.zPlane.hessSdf
def hessSdf(xc, yc, zc, x, y, z)
Definition: sdf_plane_3d.py:29
sdf_plane_3d.hess_sdf
def hess_sdf(delta_t, t, x, y, z, tx, ty, tz, block_id)
Definition: sdf_plane_3d.py:16
sdf_plane_3d.zPlane.gradSdf
def gradSdf(xc, yc, zc, x, y, z)
Definition: sdf_plane_3d.py:23