I want to project points to polyline the way picture shows. What is the optimal approach with rhinocommon in C#?
I found Intersection.ProjectPointsToBreps Method but I seem to have a problem implementing it. I was following logic of project point in grasshopper.
Yeah, I was thinking about that but since the grasshoper component is slow if I run this many (100+) times, I wasnt even trying that (I think I would get even slower performance).
var tol = Rhino.RhinoDoc.ActiveDoc.ModelAbsoluteTolerance;
var points = new List<Point3d>();
foreach(var pt in topChPts)
{
var line = new Line(pt, -Vector3d.ZAxis);
var x = Rhino.Geometry.Intersect.Intersection.CurveLine(botChPolyTemp.ToNurbsCurve(), line, tol, tol);
if(x.Count > 0)
points.Add(x[0].PointA);
}
So I went for what @Helvetosaur and @Mahdiyar proposed for now. I found it faster than ordinary curve curve intersect component in grasshopper. Anyways, I’ll be looking to some way of implementing more vectors to possibly make it faster. Ive been already tinkering with stuff @rawitscher-torres proposed. project point2.gh (14.3 KB)