C1 Curve continuity: Difference between Grasshopper & Rhino Common

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)

Hello,

rg.Continuity.C1_continuous?
I wrote this in Python as a test. My Python code might not be very good…

Code_Demo_Re.gh (10.6 KB)

Hi @11159

Thanks! Turns out G1 works.

1 Like