Skip to content
Branch: master
Find file Copy path
Find file Copy path
1 contributor

Users who have contributed to this file

83 lines (57 sloc) 3.58 KB


rhino3dm.js is a javascript library with associated web assembly (rhino3dm.wasm) that is OpenNURBS plus additional C++ to javascript bindings compiled to web assembly. The library based on OpenNURBS with a RhinoCommon style. The libraries will run on on all major browsers as well as node.js.



Rhino3dm.js requires two files rhino3dm.wasm and rhino3dm.js. It is easiest to simply reference the latest build directly from our servers:

  <!-- stuff -->
    <script type="text/javascript" src=""></script>
      // NOTE: the rhino3dm library is compiled with the MODULARIZE
      // option to avoid collisions with other web assemblies
      // here's one way of using it...
      rhino3dm.then((Module) => {
        sphere = new Module.Sphere([1,2,3], 12)
        // more stuff
      // even more stuff
    <!-- you get the idea -->

Download the files

If it would be better to download a static build locally, download the latest build of the two files:

Place these in the same folder. The rhino3dm.js references the rhino3d.wasm.

Note: A list of builds is available on our Circleci project. You can replace latest with dujour/BUILD_NUMBER if you know what you're looking for!


rhino3dm.js is available on npm; try npm install rhino3dm.

$ node
> rhino3dm = require('rhino3dm')() // note the trailing "()"
> sphere = new rhino3dm.Sphere([1,2,3,], 12)

It takes a moment to load the ~5 MB wasm file – this happens asycnhronously. Unlike interactive usage, when scripting with rhino3dm you can use the fact that the rhino3dm() function returns a Promise.

# script.js
rhino3dm = require('rhino3dm')

rhino3dm().then((rhino) => {
  sphere = new rhino.Sphere([1,2,3,], 12)

API Docs

The latest rhino3dm.js API Documentation


There a few samples are available in the Github Repo Samples folder

An advanced sample creates a 3dm file viewer in a web browser. The html+javascript to create the viewer is around 300 lines (including comments) and runs on all browsers including mobile devices.

rhino3dm.js is used to read a 3dm file and create an instance of a File3dm class in the browser’s memory. It then walks through the objects in the model and calls to create meshes and isocurves for the polysurface. These meshes and isocurves are then added to a three.js scene for display.

Here's another example of rhino3dm.js, this time running in one of Observable's live notebooks. Dive right in an tweak the code!

Build from source

If the pre-compiled libraries above do not work in your situation, you can compile the libraries from their source. For detailed instructions go to rhino3dm.js and rhino3dm.wasm

You can’t perform that action at this time.