Is there a way to access the MakeNonPeriodic command from Rhino inside grasshopper, in particular inside a c# component ? Besides baking the curve, invoking the rhino command and then getting the curve back?
Thanks!
Is there a way to access the MakeNonPeriodic command from Rhino inside grasshopper, in particular inside a c# component ? Besides baking the curve, invoking the rhino command and then getting the curve back?
Thanks!
I think this might be what MakeNonPeriodic does?
if (curve.IsPeriodic)
{
NurbsCurve nurbsCurve = curve.ToNurbsCurve();
nurbsCurve.Knots.InsertKnot(nurbsCurve.Domain.T0, nurbsCurve.Degree);
nurbsCurve.Knots.InsertKnot(nurbsCurve.Domain.T1, nurbsCurve.Degree);
curve = nurbsCurve;
}
Nope, it’s easier:
NurbsCurve nurbsCurve = curve.ToNurbsCurve();
if (nurbsCurve.IsPeriodic)
nurbsCurve.Knots.ClampEnd(CurveEnd.Both);
Perfect, thanks.
Just add !! You output nothing
A = nurbsCurve;
private void RunScript(Curve curve, ref object A)
{
NurbsCurve nurbsCurve = curve.ToNurbsCurve();
if (nurbsCurve.IsPeriodic)
nurbsCurve.Knots.ClampEnd(CurveEnd.Both);
A = nurbsCurve;
}
You’re the best!