コード例 #1
0
ファイル: draw_points.py プロジェクト: detorto/mdvis
from numba import jit
from numba import float64, int8

print "Initing scene"

def rotate(deg):
	
	for rot in xrange(deg):
		mlab.view(azimuth=rot)	
		print "saving to ./advid/{num:03d}.png".format(num=rot)
		mlab.savefig("./advid/{num:03d}.png".format(num=rot))


print "Reading data"
fig = mlab.figure('Viz', size=(1366,768))
#for i,f in enumerate(sys.argv[1:]):
#	i=i+74
m,g = readfile_metgas_boxes(sys.argv[1])
print "Drawing metal"
mlab.points3d(m.x, m.y, m.z, mode="point", scale_mode="none",scale_factor=m.d, colormap="black-white" ,color=(1,1,1))
print "Drawing gas"
mlab.points3d(g.x, g.y, g.z, mode="point", scale_mode="none",scale_factor=g.d, colormap="cool",color=(0.,0.,1)) 
	
#mlab.show()
#rotate(360)
	#mlab.view(0.0, 90.0, 40.432823181152344, [ 20.02327204,  20.03512955,  14.38742304])
	#mlab.view(azimuth=0,elevation=90)
#	print mlab.view()
	#mlab.savefig("./advid/{num:05d}.png".format(num=i))
	#mlab.clf()
mlab.show()
コード例 #2
0
ファイル: temp_vol_show.py プロジェクト: detorto/mdvis
import sys
sys.path.append("D:\\projects\\visual\\")
from mmdlab.datareader import readfile_metgas_boxes
from mmdlab.utils import init_mlab_scene
import glob
from mayavi import mlab
from tvtk.api import tvtk

(metal, gas) = readfile_metgas_boxes(sys.argv[1], region=[0,10000,0,10000,1000,1000000])
gas.z = gas.z - 2.11884
gscatt = mlab.pipeline.scalar_scatter(gas.x, gas.y, gas.z, gas.t)


#print "Temp gauss"
#mlab.title('Time [0{num:09d}]' .format(num=(750000+int(f[-13:-3])))).y_position=1
#mlab.title('Time [0{num:09d}]' .format(num=(int(f[-13:-3])))).y_position=1
filt = tvtk.GaussianSplatter()
filt.radius=0.01
filt.exponent_factor=-1.3
filt.scale_factor=1.760

tggauss_fog = mlab.pipeline.user_defined(gscatt, filter=filt)

print "Done"
tvol = mlab.pipeline.volume(tggauss_fog)

tvol._volume_property.shade=False
from tvtk.util.ctf import load_ctfs

#ctf.add_hsv_point(0.975528258148,0.0521448216801, 1.0, 1.0)
コード例 #3
0
ファイル: temperature_volume.py プロジェクト: detorto/mdvis
from mayavi import mlab
from tvtk.api import tvtk


init_mlab_scene((200,768))
fc = 1500
rot_per_frame = 20

files = glob.glob(sys.argv[1])
file_c = len(files)
def saved(str):
	return "Saved "+str


for f in files:
	(metal, gas) = readfile_metgas_boxes(f)
	gas.z = gas.z - 2.11884
	gscatt = mlab.pipeline.scalar_scatter(gas.x, gas.y, gas.z, gas.t)
	

	print "Temp gauss"
	mlab.title('Time [0{num:09d}]' .format(num=(750000+int(f[-13:-3])))).y_position=1
	#mlab.title('Time [0{num:09d}]' .format(num=(int(f[-13:-3])))).y_position=1
	filt = tvtk.GaussianSplatter()
	filt.radius=0.01
	filt.exponent_factor=-1.3
	filt.scale_factor=1.760

	tggauss_fog = mlab.pipeline.user_defined(gscatt, filter=filt)
	
	print "Done"