@dale, @Helvetosaur
I have a large mesh with 4.4 million faces. It is a 3D model of a map created from 400 drone images. I have colored the mesh using a Python script but it takes time to generate the vertex colors before I can apply the colors using:
meshVertexColors(mesh, colors)
The results look nice:
but can be painfully slow to iterate in order to bring focus on an area of interest:
If I moved generation of the colors array to C-code I think this could be much faster, perhaps less than a second. I have read about using ctypes for interfacing to C-code from Python. My question is, can I use the method you outlined in “Creating your first C/C++ plugin for Rhino” http://developer.rhino3d.com/guides/cpp/your-first-plugin-windows/ to compile my C-code and create a C-code dll library which I can then call from Python using a ctypes interface?
I am worried about starting along the path of using your guide since it is targeted towards creation of a stand-alone C-code plugin. But this seems like overkill if all I need is the dll which I can reference in Python using:
import ctypes
# Load the shared library into c types.
libc = ctypes.CDLL("./myclib.so")
Any guidance you can provide would be much appreciated as I have not done any C-code work in the Rhino environment (or any other environment for that matter). But I have programmed in many other languages and written 100,000+ lines of code. So I am not too worried about the C-code it self but I am definitely concerned about getting the C-code complied and linked into a dll library which I can call from Python.
I also have many other map types that could benefit from using a fast C-code function so learning how to do this would be of significant benefit. My Drone Maps Python script is now 7300+ lines, works quite well and has a nice GUI:
But it is painfully slow for some operations.
I have already exploited the parallel code I lifted from Grasshopper but this provides no more than 2-4X speed up. I need more like 10-100X speedup which hopefully C-code can provide.
Regards,
Terry.