I’d like to share a technique for creating C++ and Python bindings. This approach allows you to develop your code both locally and cross-platform. The package includes a PYPI setup with GitHub Actions configured for Linux, Windows, and macOS, making it easy to install via pip in Rhino’s ScriptEditor.
You can even create Python bindings for Fortran using this method! The best part is that data transfer can happen without any copies — from simple collections to unique pointers and classes.
Here’s a step-by-step guide to creating bindings for your own C++ library: Google Slides Guide
@eirannejad — Your ScriptEditor is awesome! It has made our work at ETH Zurich much easier. Thank you, and keep up the great work!
We have discussed this, but are not actively working on the project.
There are already a large number of nanobind based bindings written right here:
This source currently compiles with an embedded copy of opennurbs and would need to be adjusted to a different project name and link against the Rhino C++ SDK instead. Then the effort would be to add whatever Rhino specific class bindings would be needed to make the library usable.
Open or closed source doesn’t matter. We have a C++ SDK for Rhino that DLLs can use.
We can try to get this project structured for in-rhino use, but we’re all super busy right now with many other projects so it’s hard to make any promises.
For me it would be fine if it would be limited to the ScriptEditor with the SDK installed and an activated Rhino license. No compilation needed → open source only
Mac is still something we are trying to figure out. We are making a C++ SDK available for Mac in Rhino 9, but definitely don’t have all of the issues worked out yet.