Esempio n. 1
0
warped.alpha(0.4).color("lg").pointSize(10)
allarr = Arrows(apos.points(), warped.points())

set1 = [apos, warped, src, trs, arr, __doc__]
plt1 = show([set1, allarr], N=2, bg='bb')  # returns the Plotter class

################################################# RBF
from scipy.interpolate import Rbf

x, y, z = sources[:, 0], sources[:, 1], sources[:, 2]
dx, dy, dz = deltas[:, 0], deltas[:, 1], deltas[:, 2]

itrx = Rbf(x, y, z, dx)  # Radial Basis Function interpolator:
itry = Rbf(x, y, z, dy)  #  interoplate the deltas in each separate
itrz = Rbf(x, y, z, dz)  #  cartesian dimension

positions_x = itrx(xr, yr, zr) + xr
positions_y = itry(xr, yr, zr) + yr
positions_z = itrz(xr, yr, zr) + zr
positions_rbf = np.vstack([positions_x, positions_y, positions_z])

warped_rbf = Points(positions_rbf, r=2).alpha(0.4).color("lg").pointSize(10)
allarr_rbf = Arrows(apos.points(), warped_rbf.points())

arr = Arrows(sources, sources + deltas)

plt2 = Plotter(N=2, pos=(200, 300), bg='bb')
plt2.camera = plt1.camera  # share the same camera with previous Plotter
plt2.show(apos, warped_rbf, src, trs, arr, "Radial Basis Function", at=0)
plt2.show(allarr_rbf, at=1, interactive=1).close()
plt1.close()
Esempio n. 2
0
allarr = Arrows(apos.points(), warped.points())

set1 = [apos, warped, src, trs, arr, __doc__]
vp = show([set1, allarr], N=2, bg='bb')  # returns the Plotter class


################################################# RBF
from scipy.interpolate import Rbf

x, y, z = sources[:, 0], sources[:, 1], sources[:, 2]
dx, dy, dz = deltas[:, 0], deltas[:, 1], deltas[:, 2]

itrx = Rbf(x, y, z, dx)  # Radial Basis Function interpolator:
itry = Rbf(x, y, z, dy)  #  interoplate the deltas in each separate
itrz = Rbf(x, y, z, dz)  #  cartesian dimension

positions_x = itrx(xr, yr, zr) + xr
positions_y = itry(xr, yr, zr) + yr
positions_z = itrz(xr, yr, zr) + zr
positions_rbf = np.vstack([positions_x, positions_y, positions_z])

warped_rbf = Points(positions_rbf, r=2).alpha(0.4).color("lg").pointSize(10)
allarr_rbf = Arrows(apos.points(), warped_rbf.points())

arr = Arrows(sources, sources + deltas)

vp2 = Plotter(N=2, pos=(200, 300), bg='bb')
vp2.camera = vp.camera  # share the same camera with previous Plotter
vp2.show(apos, warped_rbf, src, trs, arr, "Radial Basis Function", at=0)
vp2.show(allarr_rbf, at=1, interactive=1)