OpenNurbs SDK Mesh Conversion

I’m looking at the OpenNurbs SDK for Rhino6, and I was wondering if there was any examples showing how to convert breps, surfaces, etc… to a triangular mesh? Without using OpenGL?

Basically, I just want to convert everything in a .3dm file to a mesh, without much hassle, using the SDK.




Export as mesh

Hi @samurle,

If you are using the Rhino C++ SDK, then you might consider using the RhinoMeshObjects function.

You can also use ON_Brep::CreateMesh. The function above calls this.

There are couple examples of it’s using in the Rhino developer samples repo on GitHub

– Dale

My mistake, I’m using the OpenNurbs SDK for Rhino 6.

Are there any examples that show mesh conversion as a stand-alone app?

I see some conversion routines in opennurbs_gl.cpp, but that’s dependent on OpenGL.

Hi @samurle,

Standalone openNURBS will not create meshes from surfaces or polysurfaces.

However, if the model is saved with render meshes, then you can read them.

– Dale

Thank you very much, will try it.

One quick question. How are render meshes generated? Are they automatically generated on .3dm export from Rhino?

For example, I’ve exported a simple extrusion object to .3dm file, however m_mesh_cache.Mesh() is returning NULL. The extrusion object does exist though.

I also tested a simple brep object. GetMesh() returns NULL, but m_F.Count() does return a valid value.

In general, render meshes are created when you set a viewport to Shaded or Rendered display.

Even with this, you can purge a 3dm file by using the SaveSmall command.

– Dale