Cage opened this issue on Dec 20, 2006 · 1232 posts
Spanki posted Tue, 11 March 2008 at 11:41 PM
I was interested in the source as some example of the pipe and data-passing mechanism. My answer to most of your questions above is - I don't know :) (which is why I was looking for some example code).
Having said that, I'm pretty comfortable saying that using a separate .exe for just (individual) point-in-tri tests would be a waste of time and effort. The overhead involved in calling it thousands or tens of thousands (or even hundreds of thousands) of times would out-weigh any benefit of having it compiled. It's possible that even doing (just) that with a .dll would be a waste of time.
To get any real benefit, you want to do all the looping through the tables in C as well. I hadn't looked closely at your shrink-wrap code, but I'm sure it's doing something similar to the linecast_loop().
As for using strings/files - I'm not crazy about that idea. It's a lot of data to be converting to strings and/or creating files for. Ideally, there'd be some way to pass a pointer to the array to the C code, which could then do whatever it needed to do to access that array of values.
Maybe ADP has some suggestions/thoughts/sample code?
My trouble is that I'm not familiar enough with Python and/or the Python<->dll mechanism and don't have lots of free time to go investigating it. If you want to do some leg-work tracking down some links to info and/or sample source code showing how this is done, I can spend some time looking at it.
Cinema4D Plugins (Home of Riptide, Riptide Pro, Undertow, Morph Mill, KyamaSlide and I/Ogre plugins) Poser products Freelance Modelling, Poser Rigging, UV-mapping work for hire.