Create RenderMeshes via rhino3dm

I use threejs and rhino3dm to display some .3dm files. Normaly i create the files inside rhino using .net and make sure the rendermeshes are present using

RhinoObject.GetRenderMeshes(all_objects, true, true)

and

FileWriteOptions writeoptions = new FileWriteOptions
                {
                    IncludeBitmapTable = false,
                    IncludeHistory = false,
                    IncludePreviewImage = false,
                    IncludeRenderMeshes = true,
                    SuppressDialogBoxes = true,
                    UpdateDocumentPath = false,
                    WriteUserData = false,
                    WriteSelectedObjectsOnly = true
                };

This is working great but now i facing the problem to render external files with no rendermeshes included.

My question is if there is any method to use “rhino3dm” to create the rendermeshes and save a patched file. Prefer in python but js would be fine too.

rhino3dm does not include Rhino’s meshing functions. If you have a way to create meshes yourself, you can add meshes to breps and extrusions.

See these very simple examples with spheres and boxes:

If you need to create render meshes for more complex objects, you’ll need to provide your own meshing, or you could use Rhino.Compute to calculate the render mesh like in this example: rhino-developer-samples/compute/js/SampleBrepMesher/index.html at 8 · mcneel/rhino-developer-samples · GitHub

thanks for the fast reply.

since this is just some kind of hobby Rhino.Compute would be much to heavy.

i will put this on hold and searching for some other stuff to play with.

1 Like