Bind C++ and Python

Hi,

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.

It’s been successfully tested with several well-known C++ geometry libraries, including:

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:
:link: 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!

11 Likes

I feel privileged for being a small part of this slide :innocent:

Incredible work! Thanks for sharing!

2 Likes