Beamer on MikTeX

Need xcolor and pgf for the new beamer to run. MikTeX kept failing on pgf install. Led to discovery of problem with MikTeX 2.6 and LZMA compressed package archive files. Had to update just the miktex-bin, then update the rest to get the latest package manager. Remember, don’t have package manager and updater running at… Read More Beamer on MikTeX

MikTeX on vista

MikTeX works fine on vista, except on occasion if I don’t run package manager as root I get a com surrogate error. I just start package manager as root (run as administrator) to get around this problem.

Odd error with mlab and lighting – TVTK

Is there a time delay to the lighting manager being instantiated when a figure is set up? In ipython the following lines work fine fig = mlab.figure(browser=False)fig.renwin.light_manager.lights[0].move_to(0,-45) But this doesn’t fig = mlab.figure(browser=False);fig.renwin.light_manager.lights[0].move_to(0,-45) In the noninteractive mode (i.e. running a script as opposed to typing in commands in the shell) even the first version does… Read More Odd error with mlab and lighting – TVTK

Figure properties – TVTK

fig.renwin.off_screen_rendering = True #allows you to minimize the window and keep drawing/saving to file Lightingfig.renwin.light_manager.lights.light_mode = ‘vtk’ or ‘raymond’.lights[0].move_to(0,-45) light[0] seems to be the important one. azimuth , elevation, with 0 elevation being right over head The rendering properties (size etc.) are controlled fromfig.renwin.render_window .aa_frames = .size = array([width, height]) OR.set_size(width, height) fig.renwin.show_axes = True… Read More Figure properties – TVTK

Some important properties – TVTK

(For how to access object properties see this post) …fig = mlab.figure(browser = False)…s = mlab.Surf(x,y,z)… s.actors[0].property. .representation = ‘w’ wireframe ‘s’ surface .opacity = 0…1.interpolation = ‘flat’ ‘gouraud’ ‘phong’ .ambient = 0…1 #uniform (direction independent) lighting on surface.color = [r,g,b].specular = 0…1.specular_color = [r,g,b].specular_power =0…1

view manipulation – TVTK

You have to manipulate the camera which is aenthought.​pyface.​tvtk.​decorated_scene.​DecoratedScene object if fig is a figure window handle returned from mlab.figure() rotate scene by .. rotate scene by .. zoom in/outfig.renwin.reset_zoom()fig.renwin.isometric_view() remember to call fig.renwin.render() to see the changes

Setting surface rendering properties – TVTK

From a hint here import scipyx = scipy.arange(-7., 7.05, 0.1)y = scipy.arange(-5., 5.05, 0.1)[X,Y] = scipy.meshgrid(x,y)Z = 3.0*scipy.sin(X*Y+1e-4)/(X*Y+1e-4)from import mlabfig = mlab.figure(browser = False)s = mlab.Surf(X, Y, Z)fig.add(s)act = fig.objects[1].actors[0] #object[1] is the surface, it has one actor, which turns out to be a = ‘w’ #make it a = ‘s’ #turn… Read More Setting surface rendering properties – TVTK

Getting mlab/ivtk/mayavi to work

Download and run Enthought Enstaller.It pulls of various things from Enthought’s website and installs them in the site-pacages etc. Crucially it will put enstaller.exe under \python25\Scripts Run enstaller.exe In the GUI tab to repositories and check Mavavi, VTK, enthought.traits, enthought.tvtk, wxPython click install packages change ipython to run with wthread commandline option (ipython -wthread) follow… Read More Getting mlab/ivtk/mayavi to work