kanzure/python-brlcad — pull request #13 by ncsaba (2014-01-27 20:37:51+00:00)
Title: Added python syntax sugar around libwdb (partial)

Hi Bryan,

I started working on python wrappers for ease of use.

For now the easiest and fastest to get some good results is to wrap libwdb and create some geometry files... have a look at test_wdb.py :-)

For the windows port - for now I gave up on making it work well, librt doesn't want to work either with cygwin nor with mingw. The path problems are solved, but there is some fundamental problem somewhere in ctypesgencore which I just don't have the motivation to debug to it's end.

Regarding libwdb wrapping - I added most of the low hanging fruits, all the rest is pretty complex stuff without proper documentation in the wdb.h file. The mk_arbn function caused me the most headaches, it is freeing the array it gets as parameter... not very nice. Without copying it via bu_malloc (see the code) it dumps core because of double freeing the memory.

In any case I like the resulting python code a lot better than writing TCL ;-)

Cheers,
Csaba