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:
#!/bin/bash
#install most dependencies
sudo apt-get install -y python-ming python-cairo python-scipy
#install Polygon (python bindings)
wget http://download.dezentral.de/soft/Python/Polygon/Polygon-1.17.tar.gz
gzip -dc Polygon-1.17.tar.gz | tar xf -
rm Polygon-1.17.tar.gz
cd Polygon-1.17
python setup.py build
sudo python setup.py install
cd ..
rm -rf Polygon-1.17
#go to home blender dir
HOMEDIR=$HOME/.blender/scripts/
cd $HOMEDIR
#remove previous pantograph
rm pantograph*
rm progressImage.png
#install pantograph (progress image)
wget http://home.earthlink.net/~severnclay/pantograph_0.5.zip
unzip -o -j pantograph_0.5.zip progressImage.png -d ~/.blender/scripts
rm pantograph_0.5.zip
#install pantograph (bleeding edge)
wget http://home.earthlink.net/~severnclay/pantograph_bleedingEdge.zip
unzip -o -j pantograph_bleedingEdge.zip -d ~/.blender/scripts
rm pantograph_bleedingEdge.zip
#set homedir in config
cat pantographConfig.py | sed -e "s%/home/sclay/Work/Projects/pantograph/%$HOMEDIR%" > pantographConfig.py

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

Post a Comment

Filter by topic: spe, python, ubuntu