Hi there, was just trying to get the length of a bezier curve inside a VB.net GH component. I convert it first to NurbsCurve but it always returns 0. If I output the curve and use the built in GH curve length component it works fine. Here’s the code I’m using, am I doing something wrong? Thank you!
Dim pt(3) As Point3d
pt(0) = New Point3d(0, 0, 0)
pt(1) = New Point3d(1, 0, 0)
pt(2) = New Point3d(1, 2, 0)
pt(3) = New Point3d(2, 2, 0)
Dim bez As New beziercurve(pt)
Dim crv As Nurbscurve = Nothing
crv = bez.ToNurbsCurve
Print(crv.GetLength())
A = crv
That looks like a bug to me. If I call bez.ToNurbsCurve().ToNurbsCurve() the length is not zero. One call (bez.ToNurbsCurve()) and the curve has zero length.
Do what? Can you describe in more detail what you want to do or what problem you are trying to solve? Feel free to provide sample models or GH files if that helps describe your problem.