Intersection of curves showing unusual results

Hi,

This is the executed code,

intersection_result = rg.Intersect.Intersection.CurveLine(bldg_curves[0], line, tol, tol)
intersection_points = [event.PointA for event in intersection_result]
print intersection_points
for point in intersection_points:
      intpts.append(point)

and I have received the results, but not as expected. Below is the green line intersecting with the building outline curve only at one point, and the intersection results am getting all the green point shown in the image.

Am I doing anything wrong? Please advise.
Thanks in advance.
Vijesh

See attached

PolylineLine_Ccx_V1.gh (11.1 KB)

BTW: If ccxPts are more than 1 AND you want the prox one … just OrderBy the collection by Distance VS the LineCurve start pt.

1 Like

Hello
You have done nothing wrong but you must read the documentation
https://developer.rhino3d.com/api/rhinocommon/rhino.geometry.intersect.intersection/curveline

Line here is infinite,
if you want just inside value, parameter must be in [0 1]

Or use
CurveIntersections CurveCurve( bldg_curves[0], line.ToNurbsCurve(), tolerance, overlapTolerance )

2 Likes