I wanted to write this filter because I wanted to import objects I defined in Maple into POV-Ray, a free rendering tool available on a wide variety of platforms. I found the m2p program, written by Bjørn Vaggen Konestabo at the University of Oslo, which writes .pov files from GRID and MESH type PLOT3D objects. Unfortunately, I could not get this to work properly on my platform -- due to my own laziness, really. At the same time, though, I had found out about about a POV-Ray modeller called Moray, which could import user-defined objects formatted in the .udo format. Unfortunately, I couldn't figure this format out at the time, either. It did include, however, a utility called 3dWin, which could convert from a number of formats, including the .dxf format, into a number of other formats, including .udo. I thought it might be interesting to have a utility that would write .dxf files from PLOT3D structures, so that I could import it both into POV-Ray and a CAD program, like AutoCAD. Perhaps a civil engineer would like to use a Möbius strip as a decorative element, or one could design self-looping audio tape, so you wouldn't have to flip the cassette when it's done.

Now, the m2p program works and the .udo format seems quite simple to understand. Was my effort in vain? No, I don't think so. It seems to me that the .dxf format is more general, and is accepted as a farily standard 3-D object description format, so many people, not just those in the POV-Ray community, will hopefully be able to take advantage of it. I also was able to (after having some rather bad experiences with the POLYLINE strcture) incorporate the POLYGONS type PLOT3D object, which alone would definitely be worth the trouble of writing the script. The POLYGONS type enables one to use the the geom3d package in Maple to generate some very interesting objects.

The process I use, then, to render the Maple objects, is as follows:
1. Create the object in Maple and give the plot a name.
2. Use plot2dxf to create a .dxf file describing the object.
3. Use 3dWin to convert the .dxf into a .udo file.
4. Include the .udo file in my POV-Ray source, or use Moray to do it for me.

Note that if you are a user of some other rendering package, 3dWin can convert the .dxf into a number of other formats, including 3D Studio, so you might be able to use this utility and plot2dxf to import an object into your package. I recommend, though, that you try POV-Ray if you haven't done so before. The results are quite spectacular, and I guarantee you'll like the price.

I'm a physicist, not a computer scientist, so the code may not be very efficient, and there are some more problems I would like to tackle. If you have any ideas as to how the code could be improved, or other features you would like to see in a future release, please let me know and I'll be happy to hear whatever you have to say.

Christopher Prince
12 June 1998


This page and the plot2dxf routine is the property of and © 1998 by Christopher Prince.
This page was last updated 03.05 12-Jun-98.