import rhinoinside
rhinoinside.load()
import System
import Rhino
x = [0.00,0.00,2.00 ]
y = [0.00,2.00,2.00 ]
w = [1.00,1.00,1.00 ]
pointCount = 3
degree = 1
numAllKnots = pointCount + degree - 1
numExtKnots = degree
numIntKnots = numAllKnots - 2 * degree
if degree >= pointCount:
raise ValueError('curveDegree must be less than numberControlPoints')
nc = Rhino.Geometry.NurbsCurve(dimension = 2, rational = True, order = degree + 1, pointCount = pointCount)
nc.Knots.CreateUniformKnots(1/(numIntKnots+1))
for i in range(nc.Points.Count):
nc.Points.SetPoint(index = i, x = x[i], y = y[i], z = 0.0)
nc.Points.SetWeight(index = i, weight = w[i])
pts0 = Rhino.Collections.Point3dList(initialCapcity = 3)
ref = nc.PointAt(nc.Domain.Max)
pts0.Add(ref.X, ref.Y, 0.0)
pts0.Add(ref.X, 0.0, 0.0)
pts0.Add(0.0, 0.0, 0.0)
pl0 = Rhino.Geometry.PolylineCurve(pts0)
otherList = Rhino.Collections.CurveList(initialCapacity = 2)
otherList.Add(nc)
otherList.Add(pl0)
joinedCurve = Rhino.Geometry.Curve.JoinCurves(otherList, tolerance = 1E-6, preserveDirection = False)
print(joinedCurve)
print(joinedCurve[0])
Here is a MWE. The problem arises before this, but only becomes visible when calculating the AreaMassProperties, as a NoneType is returned when joining and is also processed further without any problems. Only when an attempt is made to query the area is it noticed that it does not exist.
I also tried joining PolyCurves, Polylines, Line, CurveLines. Everything works out as it is supposed to do, but only for the NURBS degree = 1.
Find attached the process of closing the NURBS curve.
