GeoSharPlus: Cross-Platform C#↔C++ Geometry Bridge for Rhino/Grasshopper

Hey Rhino community! :waving_hand:

I’d like to introduce GeoSharPlus as a cross-platform alternative to RhinoCommon for handling general geometry types (points, meshes, arrays) when you need high-performance C++ processing in your Grasshopper plugins.

The Problem

RhinoCommon is great for NURBS, but when working with basic geometry types and needing C++ performance libraries (like libigl), the data exchange becomes a bottleneck. Plus, cross-platform support can be tricky.

The Solution

GeoSharPlus uses FlatBuffers for zero-copy serialization, making C# ↔ C++ geometry exchange blazingly fast and truly cross-platform (Windows & macOS).

Quick Example

// Convert Rhino geometry to efficient binary format
var points = GetInputPoints(); // List<Point3d>
byte[] buffer = GSP.Wrapper.ToPointArrayBuffer(points);

// Process in C++ (advanced algorithms, libigl, etc.)
GSP.NativeBridge.ProcessGeometry(buffer, buffer.Length, out IntPtr result, out int size);

// Get results back as Rhino geometry - zero parsing overhead!
var processed = GSP.Wrapper.FromPointArrayBuffer(GetResultBuffer(result, size));

Real Usage

Already powering:

  • BeingAliveLanguage - A Grasshopper plugin to create computational diagrams for living systems
  • IG-Mesh - An one-stop solution for mesh processing in Grasshopper (for Rhino

Why Use This?
:white_check_mark: Cross-platform - Same code, Windows & macOS
:white_check_mark: Zero-copy - No serialization penalties
:white_check_mark: No need for RhinoCommon (get rid of all platform-dependency and SDK)
:white_check_mark: C++ ecosystem - Access powerful geometry libraries
:white_check_mark: Open source - MIT license, full documentation

Perfect for plugin developers who need high-performance geometry processing without platform limitations!

GitHub: GitHub - xarthurx/GeoSharPlus: A Cross-Platform template for passing geometries around C++ / C# mixed code.

2 Likes

Pretty cool (and a big fan of BAL, so glad this is involved there as well)

I have been pondering on the idea of meshing in the Raylib C library for a similar purpose in the past couple of weeks, will try to fiddle with this, and thanks a lot for sharing!

1 Like

Thanks!

Actually one of the main drive for developing this is because of BAL –

To my surprise, there’re so many students using macOS… and RhinoCommon currently doesn’t support macOS (not to say my experience with Rhino C++ SDK on Windows is also not good…)

Please try it out and submit issues if you need help.

1 Like

Thus is an untrue statement. Care to clarify?

What isn’t good?

Thanks,

– Dale

Thus is an untrue statement. Care to clarify?

My bad, I always mis-remember RhinoCommon as a C++ package. I wanted to refer to the issue that C++ sdk is not supported on macOS. See more discussion here:

What isn’t good?

Quite some through out the years:

(The logged 3-year-old issue is still open)

If you want more, I can provide more.

But as an end-user, I feels I spent much more time in digging into the use of the API and ask here in the forum for using the SDK, rather than just read a clearly written and maintained documents for all the usages and examples.

It definitely help me in solving some issues throughout the time, but I finally decided to get rid of it in my pipeline, because time is expensive.

And from my own experience, it seems McNeel is also not actively maintain and updating the SDK based on user feedback (for instance, check the logged issue you did 3 years ago).

You seems also have no interest in joining into the modern C++ package management system (vcpkg, git submodule etc.), and need the user to manually install additional packages. Neither is it easy to automate the task with GitHub Actions.

I understand as a CAD software company, you have valid reason to make these decisions. And I’m not among the majority here and perhaps am one of the few that really doing something that needs the performance of C++ . But clearly the developers are not treated as a very important role in your ecosystem.

If you want to collect more feedback and improve the product, I’m happy to help.