'draw' package
VTK interface
Introduction
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. It is part of the Maxima draw package. The code presented in this site was tested with VTK 6.3, and it is not compatible with 5.* versions.
In Windows, since version 5.38 (thanks to Wolfgang Dautermann), the installer contains VTK and you are ready to use VTK from Maxima.
In Linux systems, you have to install these two packages:
# apt-get install vtk6 python-vtk6
In Mac systems, since version 5.40 (thanks to Tomio Arisaka), there is an installer with VTK precompiled. If you install this package and get problems, please read these messages from the Maxima mailing list:
message1,
message2, and
message3.
Graphic objects
Click on the items below to see examples of graphic objects plotted with the VTK libraries.
Programming graphics
The objects listed above are the basic elements to build more complex scenes.
Global options
Global options are those which are related to the whole plot. They can be written anywhere in the scene description.
- axis_3d. Removes all the axes in 3D scenes. Example:
(1,
2,
3,
4)
- background_color. Sets the background color. Some examples:
(1,
2,
3,
4,
5,
6,
7,
8,
9)
- columns. Number of columns in multiplots. Examples:
(1,
2,
3)
- dimensions. Sets the dimensions of the plot in format [width, height]. Some examples:
(1,
2,
3,
4,
5,
6,
7)
- file_name. Name of the file, used together with option terminal. Example:
(1,
2)
- grid. Used to draw grid lines on the plane. Some examples:
(1,
2,
3,
4)
- key_pos. Allocates the legend. Some examples:
(1)
- logx, logy. Indicates which axes must be transformed in logarithmic scales. Some examples:
(1)
- proportional_axes. Sets axes to be proportional. Some examples:
(1)
- terminal. By default, the output terminal is the screen. Other terminals are:
PNG (1),
JPG (1),
TIF, PNM,
EPS (1),
VRML (1,
2),
OBJ,
PLY (1),
and STL (1).
- view. Positions the viewer in 3D scenes. Example:
(1)
- xlabel, ylabel, zlabel. Sets axes labels. Some examples:
(1,
2,
3)
- xrange, yrange, zrange. Sets the ranges of the axes. Some examples:
(1,
2,
3,
4,
5,
6)
Local options
Local options are those which affect the appearance of individual graphic objects. They must be declared before the objects in the scene description.
- capping. Declares if circles must be drawn at the extrems of a tube. Example:
(1,
2,
3,
4,
5)
- color. Sets the plotting color. Some examples:
(1,
2,
3,
4
5,
6,
7,
8,
9)
- enhanced3d. In 3D scenes, defines a colored pattern to project on a surface. Examples:
(1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13)
- filled_func. Indicates whether a 2d function must be filled or not. Default is not (false). Example:
(1)
- fill_color. Sets the color to fill an area. Example:
(1)
- font_size. Sets font size. Examples:
(1,
2)
- head_angle. Attribute for vectors. Examples:
(1,
2,
3)
- head_length. Attribute for vectors. Examples:
(1,
2,
3)
- isolines. Plots contours on surfaces. Examples:
(1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13)
- isolines_levels. Sets contours levels. Examples:
(1,
2,
3,
4)
- key. Defines the label of an object to be written in the legend. Some example:
(1,
2,
3,
4)
- line_type. Sets the type of lines. Some examples:
(1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12)
- line_width. Sets the width of lines. Some examples:
(1,
2,
3,
4,
5,
6,
7)
- nticks. Declares the number of points to be calculated for plotting curves. Examples:
(1,
2,
3)
- opacity. Sets the opacity level for transparent surfaces. Examples:
(1,
2,
3,
4,
5,
6,
7,
8)
- palette. In 3D scenes, selects the palette. Examples:
(1,
2,
3,
4,
5,
6,
7,
8,
9,
10)
- point_size. Size of discrete points. Examples:
(1,
2,
3,
4)
- point_type. Type of discrete points. Examples:
(1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12)
- points_joined. Type of segments joining discrete points. Examples:
(1,
2,
3,
4,
5,
6,
7,
8,
9,
10)
- transform. Allows to perform geometric transformations. Examples:
(1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12)
- unit_vectors. Plots vectors of length one. Example:
(1)
- wired_surface. Plot wires on surface. Examples:
(1,
2,
3,
4)
- x_voxel, y_voxel, z_voxel. Defines the resolution for implicit surfaces. Examples:
(1,
2)
- xu_grid, yv_grid. Defines the resolution for plotting surfaces. Examples:
(1,
2,
3,
4)
© 2011-2016, TecnoStats