Hi,
I am trying to use the Intersection.CurveCurve method to find the intersections between 6 different curves, in c# and cannot figure out for the life of me how to get it to do the command for all the curves at once, instead of me trying to find them for each pair of curves. I have my 6 curves stored as a list “fpath”, and tried inputting them into the script, but get an error about # of arguments.
Here is my code:
{
List xpoints = new List();
List xoverlap = new List();
double tolerance = 0.001;
Rhino.Geometry.Intersect.CurveIntersections xe =
Rhino.Geometry.Intersect.Intersection.CurveCurve(a1, a2, tolerance, tolerance);
foreach (Rhino.Geometry.Intersect.IntersectionEvent x in xe)
{
if (x.IsPoint)
{
xpoints.Add(x.PointA); //intersection points as seen on first curve
xpoints.Add(x.PointB); //intersection points on other curves
}
else
{ //x is not a point but an overlap
xoverlap.Add(new Line(x.PointA, x.PointA2));
xoverlap.Add(new Line(x.PointB, x.PointB2));
}
}
A = xpoints;
B = xoverlap;
}
And here is my previous code in which I make the paths and store as a list:
//make curves through the points
Curve a1 = NurbsCurve.CreateInterpolatedCurve(pp1, 3, CurveKnotStyle.UniformPeriodic);
Curve a2 = NurbsCurve.CreateInterpolatedCurve(pp2, 3, CurveKnotStyle.UniformPeriodic);
Curve a3 = NurbsCurve.CreateInterpolatedCurve(pp3, 3, CurveKnotStyle.UniformPeriodic);
Curve a4 = NurbsCurve.CreateInterpolatedCurve(pp4, 3, CurveKnotStyle.UniformPeriodic);
Curve a5 = NurbsCurve.CreateInterpolatedCurve(pp5, 3, CurveKnotStyle.UniformPeriodic);
Curve a6 = NurbsCurve.CreateInterpolatedCurve(pp6, 3, CurveKnotStyle.UniformPeriodic);
//put those into a list for easy output
List < Curve > fpath = new List<Curve>{a1,a2,a3,a4,a5,a6};
//..........
//outputs
A = Ents;
B = paths;
C = a3;
D = fpath;
I have them outputted to D, fpath. I thought I could input D into another c# component, as fpath’s as well (with the hint curves) and just reference that in this portion of the code:
Rhino.Geometry.Intersect.Intersection.CurveCurve(fpath, tolerance, tolerance);
But it does not work. Any help would be much appreciated, I am very new to coding!
Attached are the files, if that helps. Curves-script.gh (11.8 KB)