Rhino.Inside - Grasshopper - Brep DirectShape vs. Import CAD command

Hi @PhilO,

First of all I would say that we are aware there is still room to improve our geometry conversion mechanisms, there are things on the list that will be implemented to make this process more straightforward.

The question is a bit tricky.
I can not answer well since we have no access to the Import CAD code you mention.
But I can share what we have found up to now.

  • I seams that Revit API follows a similar architecture as Rhino. Revit API is a .NET wrapper of the internal Revit C++ API, as RhinoCommon is the .NET wrapper of Rhino C++ API. I may be wrong with this but openNURBS.dll is C++ so I guess their 3DM importer is build on top of their internal C++ API. This would mean that there is one layer less on their implementation. For instance you can found normal-reversed surfaces on the Revit model, and as long as I know there is no public API to generate those kind of surfaces using the public .NET Revit API.
  • It seams that the geometry contained in a DirectShape and geometry contained in a Family is a bit different, I can’t tell you if those containers use different geometry kernel implementations, but it seams DirectShape is more picky. Looks like DirectShape.IsValidGeometry method ensures this additional validation step for DirectShape. In my opinion Import commands don not follow DirectShapes additional restrictions and are using Family geometry.
  • We are unable to found more detailed documentation about some aspects, like tolerances, Revit geometry kernel is using and this is key for a good conversion. For instance some geometry that is failing seams to transfer well if it is just upscaled.
  • In your sample, it seams this surface comes from a SubD, those surfaces use to have a kind of special points on the round corners at the bottom. In surfaces like that we have observed that moving those corners slightly makes the conversion work. But again the key is how much (tolerance value) should those corners be moved in order to make this work, and why.