Hello , how to check quickly if given curve is on any face of a given brep?
what comes to my mind is to check for curve face intersection but then I would have to check if original curve and the intersection result curve (if any) are equal
is there some “shortcut” way to do this checking?
thanks in advance
I don’t think that there is a real short-cut way. I would probably do some kind of sampling of points on the curve and check that these points are within tolerance on the face.
Intersecting the curve with the face will probably not work: the intersection will take a long time and the result will not be exactly equal to the curve used for intersection.
I’m investigating python function CurveBrepIntersect, because it (by definition) returns list of “intersection” curves and list of intersection points.
It seems that it returns curve if the input curve is laying on the one of brep faces (partially or completely)
underlying RhinoCommon method is
Rhino.Geometry.Intersect.Intersection.CurveBrep(curve, brep, tolerance)
There’s a super simple way to do this! Take your curve, and use “Pull” to stick a version of it onto your surface (within tolerance). Then use CrvDeviation to test the delta between your two curves. CrvDeviation will return a numerical answer as to the max deviation between your original curve and your “Pull-ed” one. Whether you consider it to be “on” your surface is just a matter of your tolerance.