Well, shoot, I’ve been struggling with this for hours, but it looks like all I had to do was duplicate the first point and add to the end of the list of points. I’ll mark this as the solution unless there’s a better way.
#! python 2
import Rhino.Geometry as rg
import rhinoscriptsyntax as rs
import scriptcontext as sc
import math
points = []
radius = 5
total_points = 20
for i in range(total_points):
angle = (2 * math.pi * i) / total_points
x = radius * math.cos(angle)
y = radius * math.sin(angle)
z = 0.0
point = rg.Point3d(x, y, z)
points.append(point)
sc.doc.Objects.AddPoint(point)
# oh, you have to add the first point onto the end of the points list!!!
points.append(rg.Point3d(points[0]))
curve = rg.Curve.CreateInterpolatedCurve(points, 3, rg.CurveKnotStyle.Uniform)
print('is closable?', curve.IsClosable(0.001))
success = curve.MakeClosed(0.001)
print('success', success)
sc.doc.Objects.AddCurve(curve)
I’ve discovered that if you want the curve seam to be smooth, you need to make the curve be periodic. This was not apparent while I was working with circles but became very noticeable when I tried it out on ovals.