The first version was focused on getting all of the mechanics of loading rhino3dm.js in place and converting some important types like BREPs, Meshes, Extrusions, Points, Point Clouds, Curves, Dots, and Lights. Blocks are also supported, but do not take advantage of instancing (yet). There is also basic material support.
In the next version there should be support for more complete materials, textures, and a revision of the object conversion.
The easiest way to try this is to point your browser at the three.js editor and go to File->Import and select a Rhino file. If the Rhino file has no lights, I recommend you add a Directional Light in the three.js editor (Add->Directional Light).
However - I would recommend to change the demo a little bit: The points of the point cloud / control points appear as (ugly) black squares. It would most likely look better if those were displayed as little spheres instead (and not black, but maybe yellow, blue, red, grey for example).
Is there some documentation or can you point me to the code where I can find what types of curves should already supported?
EDIT @Luis I fount this code , but I’m not sure if I an make sense of it.
Further test makes it appear as if the curves are not rendered.
I exploded 1 curve as a test, and that does show up, bot I found that some curve object are selectable but not visible. Maybe due to the 100 point limit?
for some reason, I am not getting the Breps. Any thoughts?
I simply made 3 files, one with a standard box (extrusion), one where I transformed the box into a mesh, and one with one polysurface and one surface inside.
I was trying to create the files too fast, so I actually have not switched to the shaded mode. I have another important question. If I add Custom User Data to my Rhino Objects, could I get that data somehow to three.js over the 3dmloader? If it is possible, would I have to expand/customize the 3dmloader? And if yes, where would that code go?
@mkarimi What else would be useful to capture? The warning says most of what we know: the object type is an Extrusion, and that there is no mesh associated with it. This means it was either created in Rhino, but never got a render mesh, or it was created by some other scripted method which didn’t bother to generate a render mesh. This warning is thrown here: three.js/3DMLoader.js at dev · mrdoob/three.js · GitHub
I understand that @fraguada . I think the warning message are clear too. I was just proposing to add an onWarn() function to 3DMLoader.parse() to make retrieving these warnings easier. .parse ( buffer : ArrayBuffer, onLoad : Function, onProgress : Function, onError : Function , onWarn : Function)
The reason I’m asking this is that I like to show these warnings on the UI and without such a utility I have to hijack the console.warn() to retrieve these warnings.
Hi @fraguada I am getting the error you mention due to missing render meshes…
THREE.3DMLoader: ObjectType_Brep has no associated mesh geometry.
Here is the salient code for how the breps are created…
public static Brep StepToBrep(byte file)
// import the step file to a new 3dm document
RhinoDoc doc = RhinoDoc.CreateHeadless(null);
// extract breps
var rhinoObjs = doc.Objects.FindByObjectType(ObjectType.Brep);
var breps = new List<Brep>();
foreach (var item in rhinoObjs)
var brep = (Brep)item.Geometry;
brep.EnsurePrivateCopy(); // decouples the brep from the document object which otherwise can cause it to fail to serialize to json
// return breps
Do you know if it is possible to obtain render meshes for them given this code is running in a Compute instance?