kanzure/python-brlcad — pull request #19 by ncsaba (2014-02-12 15:19:23+00:00)
Title: added arbitrary boolean tree support for writing regions/combinations;

Hi Bryan,

Another fairly big patch - but it adds quite some news:

* combinations/regions are possible now to be created and saved as arbitrary trees;

* all mk_{shape} wrapper methods have now named parameters with default values, for easy creation of default primitive;

* the framework for primitive wrappers can now: load primitives from the DB file; create fresh new primitive from parameters; save the primitive to the DB (regardless if it was loaded/newly created);

For now only ARB8 and Combination are implemented, but that was enough for a proof of concept. The rest comes next; I'm also quite sure there bugs in there, so lots of more work is needed !

Again the biggest challenge was to figure out memory being freed by BRL-CAD for parameters given to the library functions - all that needs to be also allocated in BRL-CAD code, that's why some copying around is done.

I added also a unit test test_wdb.py, which will replace with time the one in test directory, and then I will delete that directory altogether. For now I still keep that one to quickly visually check that my changes didn't break anything which already worked (I fire up mged for that and display all.r).

Cheers,
Csaba