Need a Rhino3dm package that can be used directly in Unity WASM

The following content comes from Google Translate:

We are the genuine users of Rhino (non-educational version), and now we want to make architectural design software based on RhinoCommon or Rhino3dm.

We hope that users can use our software by directly opening the browser, so the options we can directly use are:

  1. Rhino3dm.js

But because if we use this, it means that many of the basic interface functions originally provided by Rhino require us to develop from scratch, which is a lot of work. We expect it will take at least half a year.

But right now we have another choice, that is Unity WASM. Unity’s rich ecology allows us not to spend time for too many interface details.

We tried to use the .Net version and Js version of Rhino3dm. We simply used Unity to call Rhino3dm and drew a line. The Unity compilation can pass, and the release to WASM can also pass, but it fails when running with a browser.

Then we tried to study the principle of Unity il2cpp, and studied the sample code provided by Unity for writing cross-platform native plug-ins:

According to the document description, this method should be possible.

Then I studied the source code of librhino3dm_native and tried to follow the method described in the above document, but found that there were too many dependencies and too many compilation options, and finally failed.

But because you provide the WASM version of the Rhino3dm library, I still think this is feasible, but I haven’t found the right way.

But I feel that through the sample code in the link above, you should be able to quickly implement the Rhino3dm package that Unity WASM can use.

Chinese:

我们是 Rhino 的正版用户(非教育版),现在希望基于 RhinoCommon 或 Rhino3dm 做建筑设计软件。

我们希望用户可以通过直接打开浏览器的方式来使用我们的软件,因此我们直接可以用的选项有:

  1. Rhino3dm.js

但因为如果我们使用这个,就意味着很多本来由 Rhino 提供的基础界面基础功能,都需要我们从头开始开发,这是一个很大的工作量。我们预计至少需要半年时间。

但眼下我们还有另一个选择,那就是 Unity WASM,Unity 丰富的生态使得我们不用为了过多的界面细节而花费时间。

我们尝试了使用 Rhino3dm 的 .Net 版和 Js 版,简单使用 Unity 调用 Rhino3dm 画了条线,Unity编译可以通过,发布至 WASM 也可以通过,但用浏览器运行时失败。

接着我们尝试研究了 Unity il2cpp 的原理,并且研究了 Unity 提供的编写跨平台 native 插件的示例代码:

按照文档描述的,这个办法应该是可以的。

接着我又研究了 librhino3dm_native 的源码,尝试按照上面文档中描述的办法去做,但发现依赖项过多,编译选项太多,最终依然失败了。

但因为你们提供了 WASM 版的 Rhino3dm 库,所以我仍然认为这是可行的,只是我目前没找对方法。

但我感觉你们通过上面链接中的示例代码,应该可以很快实现 Unity WASM 可以使用的 Rhino3dm 包

Moved to Developer category