コード例 #1
0
ファイル: Ellipsoid.py プロジェクト: zy20091082/diffusion
 def __init__(self, center=np.array([0.0, 0.0, 0.0]), a=1.5, b=0.75, whichaxis='x'):
     self.center = center
     self.a = a
     self.b = b
     # shift to origin, rotate about axis
     SurfOfRevolution.__init__(self, Ellipse, whichaxis, 1, np.array([0.0, 0.0, 0.0]), a, b)
     # shift back
     self.bounding_box = self.bounding_box + self.center
コード例 #2
0
ファイル: Ellipsoid.py プロジェクト: zy20091082/diffusion
 def parametric_grid(self, rez=64):
     xx, yy, zz = SurfOfRevolution.parametric_grid(self,rez)
     xx = xx + self.center[0]
     yy = yy + self.center[1]
     zz = zz + self.center[2]
     return xx, yy, zz
コード例 #3
0
ファイル: Ellipsoid.py プロジェクト: zy20091082/diffusion
 def closest_point(self, xx):
     cpxx, dist, _, _ = SurfOfRevolution.closest_point(self, xx-self.center)
     return cpxx, dist, np.zeros(xx.ndim), {}