Close curve control point add

The control points when I run with _PointsOn and when added by script are different. How are they similar?

import rhinoscriptsyntax as rs
def controlpoints():
msg=“Select objects”
objs=rs.GetObjects(msg,4,preselect=True)
if not objs: return
rs.AddPoints(rs.CurvePoints(objs))
controlpoints()

when you are wondering why a is different from b
you should provide both a and b result.


Here are the results

OK, after few times of review on your description, I got it.

Your “Add Points” tag is really confusing.

What you wanted to ask is that native rhino command “PointsOn” and rhinoscript function “rs.CurvePoints” showed different result white the later one had additional mid control points in all of these straight lines.

The problem lies in CurvePoints not AddPoints, AddPoints just showed the points to you, and what makes these additional mid points is CurvePoints()

As you can see in this simple example, the red lines are straight lines which are 1 degree 2 control points. The yellow 2 are not straight, 2 degree 3 points maybe.

When you join them in Rhino, they formed a closed poly-curve which can allow its sub curve have different degree. (1 and 2 here)

But when you use some nurbs function like CurvePoints, The input must be one single nurbs curve,. So the input curve was first automatically turned into 1 single nurbs curve with the highest degree. Here 1 degree 2 points straight line turned into 2 degree 3 points straight line.
After the input curve is converted into a nurbs curve, the CurvePoint is used to extract control points.

1 Like

I understand. Thanks very much