CurveThroughPt != AddInterpCurve

I have a set of points, which approximates a (non-closed) curve in space.
When I use the CurveThroughPt the result is very nice!
But when I attempt to do the same from the Python editor with AddInterpCurve the output curve becomes closed.

How do I handle this? Right now I have to use “command(”_CurveThrougPt")" in Python, but this is not very fast.

As far as I know, the points will be interpolated in the order that they are in your list. First, check to see that the first point is not somehow duplicated, if the first and last points in the list are the same, the curve will close. Also, looks like if the knotstyle input parameter is 3, 4 or 5, the output curve will be periodic, thus also closed…

Edit - looks like the above is wrong, the knotstyle parameter will not actually automatically close the curve either…

If nothing else, post a file with the points if that’s possible.

–Mitch

Ok. Here is the file with the points and the two results.

The code is given by:

`import rhinoscriptsyntax as rs

def run():
points = rs.GetObjects()
rs.AddInterpCurve(points)
return

if name == “main”:
run()
`

points.3dm (289.9 KB)

Every point in your file is duplicated 21 times…

1 Like

Thanks! This explains it.