Back to main page

A Maxima-VTK interface

This is a proof of concept for a Maxima-VTK interface.

Gnuplot and VTK are very different and I am trying to use the same syntax, the same graphics objects, and the same options. Despite my efforts, sometimes it is very difficult, or even impossible, to maintain 100% syntax compatibility. The main reason for developing this package is to make better graphics in 3D with Maxima, since Gnuplot is not a good program for this task.

This web site is presently the only source of information available for this (experimental) VTK interface.

Setting up VTK

This interface is part of the Maxima draw package. The code presented in this site was tested with VTK 6.3, and is not compatible with 5.* versions.

In Windows, since version 5.38, the installer contains VTK and you are ready to use VTK from Maxima.

In Debian Jessie, you have to install these two packages:

# apt-get vtk6 tcl-vtk6

Note that the VTK version in the Debian repositories is 6.1, not 6.3. Some examples (mainly 2d charts) in this site will not work with that version.

In Ubuntu systems tcl-vtk6 is broken. You need to compile VTK with TCL support yourself. Also, you can try the Windows installer via wine. Let's hope that problems will be fixed in next Ubuntu releases.

I don't have information on Mac systems and other Linux distros.

Drawing with VTK

Once you have opened a Maxima session, load package draw and then set global variable draw_renderer to vtk:

load("draw") $
draw_renderer : vtk $

The default value of draw_renderer is gnuplot. If you do not change this value, draw will call always the Gnuplot renderer.

Note that you need Maxima 5.38 in order to run these examples. (Not yet released at the time of writing these notes.)

Graphics in two dimensions are only partially supported. If you need to build complex 2D scenes, try Gnuplot, which is the default renderer in Maxima.


What's new

by Mario Rodríguez Riotorto