I want to use the rhino3dm.js library to create a Rhino file from a Three.js scene.
It works for BREPS, Points and Polylines (to NurbCurves with degree 1)
But it fails when I want to create a Planar Surface from a closed Polyline (no create() on Surface Class)
And I also can’t figure out how to change the doc units (to meter) like I am used to from Rhino Common
Hello Niklas,
There is no method for creating a Planar surface from a closed polyline in rhino3dm. These kinds of operations are only found in Rhino, accessible via RhinoCommon.
And is there any plan to extend rhino3dm?
We would like to offer the user to export his Three.js model to Rhino Geometry (more than just meshes) to continue modeling in Rhino
But maybe it is also just not possible to provide all the Rhino functionality in rhino3dm
rhino3dm is an open source, royalty free, and free to use library for reading, writing, and creating Rhino 3dm geometry and data. It is based on our open source project openNURBS. Most things that involve creating NURBS geometry like surfaces and breps is only available via Rhino with a suitable license.
Not all things in openNURBS are yet wrapped in rhino3dm, but we are working on it.
Three.js mostly works on Meshes, so creating NURBS from the data you get from Three.js is not trivial. If you have an example of geometry in Three.js you want to convert to Rhino geometry as NURBS, please share it here. Primitives might be straightforward to do (spheres and boxes).
If you need Rhino functions that are not in rhino3dm, you could look at Rhino.Compute.