Hi! I have created some brep by the method of CreateTrimmedPlane. And I have many 3Dpoints. How can I get the projection of certain point to certain Brep? and another question is because of the brep has a edge, how can I know whether there is a projection of certain point to this brep. Is there some fucntion that can return a true or false to show it?
These are my points and Surface.I just want the point’s projection in the z derection.
The rhino3dm
module is pretty much only for 3dm file reading and writing, It does not contain geometry operations (beyond the very basic things like curve length, point on curve and such)
You’ll have to write your own algorithm for projecting points to a surface.
You can use the ClosestPoint() function of the Brep class from RhinoCommon API. Note that in python it will work slightly differently than the documentation as to the inputs and outputs, but if you use Rhino’s script editor, you should get a pop-up showing what it expects and what it outputs (it will output a tuple, the first value of which will be the True/False value letting you know if it happened at all)
https://developer.rhino3d.com/api/rhinocommon/rhino.geometry.brep/closestpoint
You can also use the BrepClosestPoint() function in the rhinoscriptsyntax package.
https://developer.rhino3d.com/api/RhinoScriptSyntax/#surface-BrepClosestPoint
I tend to use the rhinoscriptsyntax stuff if I want the results added directly to the document. I tend to use the RhinoCommon stuff if I need to make a lot of intermediate objects I don’t want the user to see, as it generally only creates the objects, and you have to specifically choose to add them to the document.
Note that rhino3dm module is used (typically) outside of Rhino, so no access to RhinoCommon. The rhino3dm module is used for instance in the import_3dm add-on for Blender to import 3dm files into Blender. There is no access to the RhinoCommon functionality at that time.
My bad. I did not know that.
Thank you,I may try in other ways.
Thank you, I’ll try some algorithm ways.