I have an external application that i want to find the closest point between 2 breps. Specifically, 2 surfaces defined by polylines.
As such, I’m using the Rhino3dmIO.Desktop library to leverage the opennurbs geometry library. It looks like the Brep.ClosestPoint method is not available in that library unlike the RhinoCommon library where this method is available.
Does anyone have any suggestions or directions for how to perform the same check (closest point check) using the Rhino3dmIO.Desktop sdk?
As the name suggests, the Rhino3dmIO library is only for I/O of 3dm files. It also gives you a rich data structure for geometry, but no advanced geometric functions like Brep.ClosestPoint. These are only available within a running Rhino process (*).
For your specific application, surfaces defined by polylines, it may be possible to use more primitive geometry functions depending on the shape of the surfaces. For example, if the BReps are planar, you can compute the closest distance of all vertices of one BRep to the plane of the other BRep to find the closest point.
(*) there are other ways, but they all require a valid license. For example Compute.Rhino3d and Rhino Inside
Thanks. However, this is where i’m getting somewhat confusd. If we click through any of the links on that page (that is listed as “Classes and namespaces available from Rhino3dmIO”), we are taken to the RhinoCommon API docs which is the full set of Rhino functions but not the limited set exposed in Rhino3dmIO.
How can we know what functions are and are not included in Rhino3dmIO?
This is where i need to tap out, I have no idea really why it is set up as it is. I agree that it is not possible from the documentation to see what is available to Rhino3dmIO and what is not. I do suppose that your Visual Studio Intellisense will tell you.
Otherwise, if you need closest point calculations and you want to use RhinoCommon, then you’ll need to be running (as a plug-in or Grasshopper component) in Rhino.
We do have a rhino zoo license but want to do a small standalone app which takes care of these geometrical operations. I guess we’ll look into Rhino Compute next.
This is our fault and is something that we need to improve documentation on. Menno’s answer of using intellisense and the object browser with Rhino3dmIO is the best option you have at the moment for seeing what is available in Rhino3dmIO. Looking at OpenNURBS may be helpful, but may also cause confusion as there are many dissimilarities between the two toolkits.
Rhino3dmIO uses the RhinoCommon source code and is compiled with a preprocessor define that strips out the functions which are only available when running inside of Rhino (like Brep.ClosestPoint). If a function is available in Rhino3dmIO, then you can refer to the RhinoCommon documentation for that same function.