Volumes Of Fun
http://www.volumesoffun.com/phpBB3/

python bindings
http://www.volumesoffun.com/phpBB3/viewtopic.php?f=14&t=693
Page 3 of 3

Author:  David Williams [ Mon Feb 06, 2017 11:57 pm ]
Post subject:  Re: python bindings

So as I understand it, you are now interested in fixing the Python bindings on the develop version of PolyVox, whereas previously you were using an older (master?) version of PolyVox where the bindings already partly worked?

If so then I would roughly try things in this order:

  • Comment out most of the SWIG code, leaving something simple (such as Vector) for testing.
  • Fix up the various paths from where I have moved folders around.
  • Get a RawVolume working with only int or float types (forget about Large/Paging/SimpleVolume for now).
  • Next come the surface extractors. These might be tricky - as usual the problem will be the template parameters and the fact that these are used to control the behaviour of the algorithm. Sadly I really don't know enough about SWIG to help much here.


At this point the develop bindings should work as well as the ones from your older version. Now you can start to think about adding MaterialDensityPair88 and perhaps the other volume types. These may be more tricky!

I should point out that there is an alternative approach which you might want to consider. Instead of fixing the SWIG/Python bindings you could write a set of simple C functions to wrap the PolyVox functionality which you need, and then you could expose these directly to Python. It would be less flexible but tailored to you use-case. Or perhaps a hybrid approach, these C wrappers might be useful for the surface extractors. Let me know if you want more information on how you might do this.

Regarding BitBucket, the pull request, etc - unfortunately PolyVox is no longer under active development as I've moved on to Cubiquity 2 as a spiritual successor. I'm happy to give advice on this forum but won't be doing any development myself. If you can get the bindings working then I may be able to merge the fixed version back in, but the actually development wil need to happen on your fork.

Author:  kalwalt [ Fri Feb 17, 2017 10:25 am ]
Post subject:  Re: python bindings

Quote:
So as I understand it, you are now interested in fixing the Python bindings on the develop version of PolyVox, whereas previously you were using an older (master?) version of PolyVox where the bindings already partly worked?

Yes!

Quote:
If so then I would roughly try things in this order:

Comment out most of the SWIG code, leaving something simple (such as Vector) for testing.
Fix up the various paths from where I have moved folders around.
Get a RawVolume working with only int or float types (forget about Large/Paging/SimpleVolume for now).
Next come the surface extractors. These might be tricky - as usual the problem will be the template parameters and the fact that these are used to control the behaviour of the algorithm. Sadly I really don't know enough about SWIG to help much here.


this is what i'm doing, I stopped to the Surface extractor template classes... i think it is the crucial point.

Quote:
I should point out that there is an alternative approach which you might want to consider. Instead of fixing the SWIG/Python bindings you could write a set of simple C functions to wrap the PolyVox functionality which you need, and then you could expose these directly to Python. It would be less flexible but tailored to you use-case. Or perhaps a hybrid approach, these C wrappers might be useful for the surface extractors. Let me know if you want more information on how you might do this.


Could be an option B, i red in the Python docs something about (also blender use a lot C wrappers). First i will try with the SWIG approach, in case i fail i will seriuosly consider the B option.
Thank's for the help David, i will keep you informed,
Walter

Page 3 of 3 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/