I’ve done some successful experiments using the GH component MeshCurveIntersection with the plan to implement the idea with RhinoCommon, but it seems that this functionality isn’t directly available in in RhinoCommon 5.
Is there any (other) command name that does the same thing?
MeshPolyline is slightly more useful if you’re dealing with curves. First convert your curve to a polyline using the required accuracy, then perform the intersection.
Thank you for the tips David. For now it suffice to use a straight line as a “probing ray” (I will convert the Face Normal which I already have, into a straight Line). Perhaps Line is also a bit faster but I don’t know that for sure yet.
It’s also faster. After some testing I found that MeshCurve is ~25% faster than MeshLine.
But how do I convert a Line to Curve in the simplest manner? I (re)use a Line in a loop by modifying the endpoints (based on Face Normals and their center points). Can the endpoints of a Curve also be modified or must a PolylineCurve always be created anew ?
line.[ToNurbsCurve()](http://developer.rhino3d.com/api/RhinoCommonWin/html/M_Rhino_Geometry_Line_ToNurbsCurve.htm)
and new [LineCurve(line)](http://developer.rhino3d.com/api/RhinoCommonWin/html/M_Rhino_Geometry_LineCurve__ctor_1.htm)
Can the endpoints of a Curve also be modified or must a PolylineCurve always be created anew ?
If you use LineCurve, you can set the inner line: LineCurve.Line
Update: Unfortunately the type LineCurve is not supported by Rhino.Geometry.Intersect.Intersection.MeshPolyline(...)
@menno, Using a “Ray” is a bit different since its extent, or length, isn’t limited. In my case I need full control of the length, or the far end of the curve, depending on the direction I probe. A ray will intersect with objects far away from the space I want to test. Otherwise MeshRay is an option as well, yes.
The parameter along the ray for the intersection point. I.e. the parameter you supply to the PointAt() method to get the point along the ray. It’ll be the start-point + parameter * direction-vector. So when t=0.0 it gives you the ray start point, t=1.0 gives you the point at the tip of the direction vector, t=2.0 gives you a point twice as far away again, etc. etc. It’s very much the same for finite and infinite lines.