Pantograph 0.5 is out.

Its been an exhausting month - my son was born on October 7, and everything takes longer when you’re trying to bounce a baby with one hand and type with your right hand!
I’m moving to a slightly different system - putting out a pretty stable release and keeping a less-stable bleeding-edge version as well (basically, the version I’m using). YMMV. So, without further ado:

Pantograph 0.5 changeLog

  • the GUI has been thoroughly replaced by a Blender user-interface. Its a little spare, but its growing on me and the experience is much smoother running it from Blender. pyGTK is no longer required.
  • The clipping has been re-written - with the hopes of dealing with the memory hole for larger meshes.
  • There’s now a “raster fill” option - you can use a rendered version of the scene (a PNG file, to be exact) as a clipped fill - you get sharp linework but also soft shading, textures, shadows. You could take this into Inkscape and poTrace your way back to resolution independence.
  • There’s now a proper frustum cull - things outside of the camera view are clipped and not rendered.
  • Things now work with Blender 2.48 (GTK was causing a seg fault).

Known Bugs:

  • The Blender GUI doesn’t yet work properly in Windows - to get changes in buttons to register, you have to raise another window and then go back to Blender. Works fine in Linux. Upstream bug?
  • There’s a mysterious, unrepeatable seg fault that happens every once in a while, though I’ve only noticed it in Linux.
  • SWF output is broken. No, its just not hooked up yet - I’ve been developing on a 64-bit system, and Ming is only 32-bit… if people are clamoring for this, it might happen sooner.

Download here.

Happy Halloween,
RS

hi rocketship, thank you very much, great script!
Setting dependencies was difficult, because blender immediately closed (if not import cairo then sys.exit(1)), no chance to read error messages on the console. Finally successful installation on winXP.

I have started some tests here

/uploads/default/original/3X/1/e/1efb1ca0a46694cdbf6ab9a67206e64ec04c67f5.pngd=1225326971
no crashes, but slow: 650 polys in 2minut, and some vector errors

I am going to implement similar functionality (2d perspective view with hidden line mode) to the new DXF-Exporter script. Your script seems to be optimal solution for this purpose, unfortunately there were problems to get Pantograph 0.4 working and the non-GPL ‘General Polygon Clipping Library’ dependency makes it problematic for blender.

Four weeks ago started an alternative “Vector Render” project in python, inclusive 2d polygon clipping module. It is pretty advanced now. If you are interested, look at Blender Projects: Vector Renderer
What a chance you write a (GPL) clipping library in the next future?
migius

rocketship! congratulation to be a father!

hi all,
here a short story about installation on winXP

  1. Python 2.5.2 was installed already.

  2. Because of cairo.dll we need current GTK Library. I’ve got Gimp 2.4.6 and added gimp’s path “blabla\bin” to systemvariable PATH

  3. install pycairo-1.2.6-1.win32-py2.5.exe Without cairo Blender closes immediately.

  4. install Polygon-1.17.win32-py2.5.exe

4b. optional for Shockwave Flash Animation (SWF) you need mingc-0.0.3a.win32-py2.5.exe

  1. windows restart!

  2. copy files from Pantograph0.5-Zip-File in Blender Scripts Folder. (* you can try newer version from here )

  3. edit pantographLib.py script and change the line: (* for newer version do it in pantographConfig.py)

HOMEDIR = “C:/blabla/Blender/.blender/scripts/”

  1. start Blender, get scene with camera, start script from Scriptwindow->Render->Pantograph

hope this helps
make some tests and post results here or here
migius

Migius,

Thanks for the testing!

Yes, its still pretty slow - I think its reaching the limits of Python-speed - the BSP sorting and 2d clipping are computationally pretty intensive, no matter how much you optimize it.

I’d love to get involved in the Vector Renderer project - what language are you working in? What sort of hidden-line removal are you planning to use? What is the basic pipeline you envision?

Are you sure that the GPC license is incompatible with GPL? Because it is a less-restrictive license, it seems like it wouldn’t impose any restrictions on the Blender codebase, though I guess the restriction from commercial use could be a problem. Re-writing the clipping module is something I’ve thought about, especially because the vector renderer wouldn’t need all the functionality of GPC, and wouldn’t need to be quite as robust. Plus, if the project were closely tied to Blender it could re-use some of the Blender math functions and such.

The 2d clipping is important, and I think the place where a lot of other renderers are lacking (VRM, GL2PS). Without it, your vector file is too large and difficult to work with afterwards (too many triangles!)

Best,
RS

rocketship.
Vector Renderer project started because your Pantograph project seemed to be stopped. :stuck_out_tongue:

Are you sure that the GPC license is incompatible with GPL? Because it is a less-restrictive license, it seems like it wouldn’t impose any restrictions on the Blender codebase, though I guess the restriction from commercial use could be a problem.
exactly

I have activated SWF support in your script. To get from here.
It works well, but the mingc lib crashes Blender just by writing final file to disk. Strange.
Had it ever worked for you?

migius

edit: mingc lib produces correct swf file with leer scene, so probably my modification is a culprit :slight_smile:

Migius,

Swf export was working - I just wasn’t sure I had hooked it up in the new GUI. I’ve been tracking changes into the swf module, so it should be close to working - as I said, I don’t have python-ming installed on my main development machine, so I haven’t tested it.

Pantograph hadn’t stopped, but life got in the way for a while… plus, I dislike writing user-interfaces enough to be able to put it off for a long time :wink:

I’ll take a look at your modifications for swf - it may be something quite simple.

RS

SWF animation doesn’t work yet, so i have redirect output to serial PNG -> animGIF (thanks gimp)
looks nice:

http://4d-vectors.de/blend01/org/anim003.gif

Entirely in python. Some parts will be eventually rewritten to C later.
Alxarch is working on a polygon clipping module (finished afaik). Look at sorcecode for more details. Now we need better sorting algo, probably your BSPTree could be useful.
I’dnt like to reinvent all this from scratch.
My part so long is connectivity to blender scene: camera/viewpoint frustum, material-linestyle mapping, preparation for DXF format and UI.

Re-writing the clipping module is something I’ve thought about, especially because the vector renderer wouldn’t need all the functionality of GPC, and wouldn’t need to be quite as robust. Plus, if the project were closely tied to Blender it could re-use some of the Blender math functions and such.
you are absolutely right.
I hope we could use the same core for export in different vector formats: DXF, HPGL, SVG (<- in my favorite)

just will send you PM
migius

I updated the “bleeding edge” version. Clipping is slightly improved (but still not perfect.)

very cool, thank you for sharing your hard work

not a bugfix but hack on script, produces imperfect swf file, but script/blender crashes no more:
http://4d-vectors.de/blend01/org/anim003.swf

“Bleeding-edge” is updated again:
-no longer does sys.exit(1) when Cairo is not present
-swf output may be fixed (?) but ming still crashes Ubuntu 64
-config settings are now in pantographConfig.py, to make it easier to update without re-setting your home dir.

RS

another try with the old swf code from 0.4 produces a better looking swf file, but 4x bigger and ignores dashed lines: (why?)
http://4d-vectors.de/blend01/org/anim004.swf

thank you, will try again

your last version still crashes blender
in line 2941 there is an unresolved call “self.shapes”, but nowhere initialization for it in drawing class

if no mingc works on your machine it will be difficult to track this function.
look at pantographLib04.py, which generates above “better” swf
in http://projects.blender.org/plugins/scmsvn/viewcvs.php/Pantograph/?root=vectorrender

Migius,

As I said before, ming has no provision for different line types :frowning:

drawing.shapes gets initialized in pantograph.py - make sure you re-load it before you try it! (its in line 670 of pantgraph.py).

I’m digging out my old laptop, so I should be able to test it today.

RS

Hmmm…still seg faulting. Let me look at it some more.

I made some changes to the swf export module since 0.4 - mainly trying to reduce file size, though also some changes in the data structure that holds the line-type data. Unfortunately, directly dropping in the old module is going to be a little hard.

RS

Rocketship, thank you for continuing this project ! :slight_smile:

after testing: the thing that crashes blender regularly at the moment of writing swf file is the usage of movie.remove(MyShape) command in your 0.5 code.
What a sense of this code? Could you point me to your swf sources/documentation?

migius

Ok, it works! Swf export is fixed in bleeding edge - I was trying to do something a bit too fancy.

test

cheers,
RS

\o/, perfect! your last version generate small swf files again, bravo!
as proof: http://4d-vectors.de/blend01/org/anim005.swf

something strange though:
the frame interval increases to the end of video sequence.
I have seen this strange effect in myself hacked 0.5 version too.
It is to see in your http://home.earthlink.net/~severnclay/filename.swf too.
what could it be?
download again my last (replaced) example to see it better