PolyCurve Rebuild

Hi,

I have a problem with rebuilding a Polycurve. It has degree 1 and I would like to interpolate it with a degree 3 curve.
But when I rebuild the curve with the same spancount (which is about 2500) it always reduces it to a degree 3 curve with less than 1000. :frowning: What am I doing wrong.

Here is the code and fileCRV.3dm (690.5 KB): I like RhinoCommon :smile: THANKS

###############

import Rhino
import System
import copy
import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino.Geometry as rg
import Rhino.Input as ri
import Rhino.DocObjects as rd
import time
import math
import random

rc, crv = ri.RhinoGet.GetOneObject(“Select Curve”, False, Rhino.DocObjects.ObjectType.Curve)
“”"
if rc <> Rhino.Commands.Result.Success or crv == None:
return rc

“”"
obj = crv.Object()
getcrv = obj.Geometry

crv = rg.PolyCurve.ToNurbsCurve(getcrv)
spancount = crv.SpanCount
crvnew = rg.NurbsCurve.Rebuild(crv,spancount,3,True)

sc.doc.Objects.AddCurve(crvnew)

#############

Yep, @alain looks like this is either a bug or deliberate limitation of RhinoCommon method Curve.Rebuild(). I tested this in Grasshopper as well - seeing as it is based on RhinoCommon - and got the same results, can’t rebuild curves with more than 1000 points. @dale It also appears that vb Rhinoscript method has the same problem.

Only workaround I see for the moment is to actually script the Rhino Rebuild command, which doesn’t seem to be subject to this limitation.

–Mitch

@Helvetosaur

Thanks. So to get rid of it is to build a new curve based on the points of the original curve.
I will try to find a solution.

The later. The internal curve rebuild function is capped at 1000 points.

– Dale

Hmm, the native Rhino command does not seem to have this cap…

Yes I know…