Sunday, March 8, 2009

Vector rendering with Blender in Ubuntu

PantoGraph is a prototype for a vector rendering engine, developed in python by Severn Clay Studio. This can be nice for architectural presentations. It is still beta, which means it gets quite slow for heavy drawings.

It features two engines under the hood:
  • cairo for svg, pdf and png output
  • ming for animated flash output (.swf)
Current features :
  • Hidden- line rendering
  • Solid colors (with- and without alpha) only
  • The ability to use simple closed, convex volumes to do a boolean “cut-away”
  • Control over lineweight and color for:
    • Silhouette
    • Crease
    • Mesh
    • Hidden lines
    • Curves

  • A simple GUI that allows the saving of pens and pen settings

It can be loaded as a python script from Blender. Don't bother with the installation instructions on the Pantograph homepage (like fiddling with your PYTHONPATH), as I wrote the following install script which takes care of everything (at least in Ubuntu Intrepid). Open a new text file with the name 'install_pantograph' and copy the following content inside:
#install most dependencies
sudo apt-get install -y python-ming python-cairo python-scipy
#install Polygon (python bindings)
gzip -dc Polygon-1.17.tar.gz | tar xf -
rm Polygon-1.17.tar.gz
cd Polygon-1.17
python build
sudo python install
cd ..
rm -rf Polygon-1.17
#go to home blender dir
#remove previous pantograph
rm pantograph*
rm progressImage.png
#install pantograph (progress image)
unzip -o -j progressImage.png -d ~/.blender/scripts
#install pantograph (bleeding edge)
unzip -o -j -d ~/.blender/scripts
#set homedir in config
cat | sed -e "s%/home/sclay/Work/Projects/pantograph/%$HOMEDIR%" >

Make the script executable, with right click (properties>permissions) in the file browser or from the terminal:
$ chmod +x install_pantograph
And run the script in the terminal as you will need to give your password to install the dependencies.
$ ./install_pantograph
After that you can access the pantograph renderer from the script window in Blender. First try it out with the default cube scene, before you let it crunch your heavy drawings.

If you want follow the progress of the render, you can better disable compiz and start Blender from a terminal, where the progress will be shown:
$ metacity --replace
$ blender -w
For feedback you can contact the developer at the blenderartists forum.

No comments:

Post a Comment

Filter by topic: spe, python, ubuntu