mcneel / rhinocommon

RhinoCommon is the .NET SDK for Rhino5 / Grasshopper
http://wiki.mcneel.com/developer/rhinocommon
244 stars 93 forks source link

Rhino3dmIo Mesh.CreateFromBrep equivalent in C# .net? #186

Closed blackpandastudios closed 5 years ago

blackpandastudios commented 5 years ago

We are looking at reading in .3dm files in at runtime for our application, however, I am only able to convert the Meshes over as there is no Mesh.CreateFromBrep in the NuGet package for 3dmlo.

I was going to use dotPeek to see what the static methods contain and simply re-implement it, just here first to see if anyone has encountered this?

dalefugier commented 5 years ago

You are correct. Rhino3dm cannot tessellate (e.g. mesh) surfaces and polysurface. This is a known limitation.

https://developer.rhino3d.com/guides/opennurbs/what-is-opennurbs/

That said, you can get at the cached render meshes that (may be) stored on each BrepFace using BrepFace.GetMesh.

Does this help?

blackpandastudios commented 5 years ago

@dalefugier Yeah BrepFace.GetMesh() Does exactly what we want, and we can then append that onto a mesh. That seems to be translating everything but we have only run a few files through.

Snippet for anyone interested :)

image