OpenNURBS for C# / Unity?

Hello,

We are working on a Unity based collaboration engine that allows small and large teams to review, comment and iterate on 3D Models in realtime. Features include: adding comments in 3d Space, switch to the camera view of another user, adding tags/descriptions to model parts, and other collaboration features.

The 3D Models are downloaded/streamed from a server right into Unity. So far we have been using very primitive data structures that required some converting, especially if you wanted to review a Rhino Model.

As a next step we’d love to be able to allow users to simply upload Rhino models. Has anyone had any experience with RhinoCommon / openNURBS and Unity? Is there any easy way to make this possible? We’d love to keep our app Web-Player compatible, and I that will require us to compile openNURBS ourselves in Unity as C#.

Any tips or experiences are appreciated,
Thank you.

1 Like

Nope, but I’ve played with unity and love rhino so any development on getting them to play nice sounds awesome. Keep us updated!

This will be a monumental effort, as openNURBS is written in C++. :wink:

But, using our Rhino3dmIO Toolkit, along with openNURBS, you will be able to read (and write) 3DM files in a C# application.

Does this help?

1 Like

Thanks for the help.

I’ve managed to do some basic things in Unity with Rhino3dmIO. Loading a file via "Rhino.FileIO.File3dm.Read()"
Works flawlessly, however, as soon as I try to create a “Rhino.Geometry.Mesh” Object, I get this error in the Unity Debug console:

Unhandled Exception: System.TypeLoadException: Could not load type 'Rhino.Geometry.Mesh' from assembly 'Rhino3dmIO, Version=5.1.30000.12, Culture=neutral, PublicKeyToken=null'. at (wrapper managed-to-native) System.MonoType:GetMethodsByName (string,System.Reflection.BindingFlags,bool,System.Type) ...

(error message goes on forever).

I have placed rhino3dmio_native.dll and Rhino3dmIO.dll in the Unity Plugin directories. Am I missing something?
I have tried compiling the dlls as both .NET 3.5 and 4.0 within VS2013, both producing the same error in Unity. I’ve been trying to find out what could cause this, but I am rather lost because my knowledge on .NET and how to make it work with Unity is pretty limited.
Any ideas why this would happen when using Rhino.Geometry but not with Rhino.FileIO?

You get this doing this?

Rhino.Geometry.Mesh mesh = new Rhino.Geometry.Mesh()

Is your opennurbs DLL also in the correct location?

I know I’m a bit late, but any progress on this? I would be happy to help

Hi Jed,

We’re going to need a bit more details. What is not working for you? Do you have sample code you can share that demonstrates a problem you might be having?

– Dale

Hey Dale,

I was just wondering how the Unity / Rhino connetion project was going, I was hoping to piggy back off of someone else’s success rather than do it all myself.

Thanks though!

  • Jed

@Jed, I’m confused as to what project you are referring to? I don’t know anyone here (at McNeel) working on any kind of Unity/Rhino connection…

I’m talking about this thread, located here: OpenNURBS for C# / Unity?

@Jed you might want to ping @jomar, as this is his project…

@jomar Has any progress been made with this?

Super interesting topic.

@jomar do you have any updates to share?