I have a polycurve with multiple segments, with Grasshopper Discontinuity tool, I can get 4 segments with C1 continuity, which is exactly what I want.
But in python, I tried with crv.GetNextDiscontinuity and C1 continuous , it find 9 segments instead. I also tried C1 locus continuous but still the same. What is the way to get 4 segments?
import Rhino.Geometry as rg
if crv:
#---//Set the constants//---
crv_new = crv.Duplicate()
crv.Domain = rg.Interval(0, 1)
t0 = 0
t1 = 1
#---//Iterate with next discontinuity method//---
count = 0
t = t0
Pts = []
while t < t1 and t >= 0:
[bool_re, param] = crv.GetNextDiscontinuity(rg.Continuity.C1_locus_continuous, t, t1)
if bool_re:
pt = crv.PointAt(param)
Pts.append(pt)
t = param
count += 1
if count == 20:
break
Here is my file
Code_Demo.gh (5.7 KB)


