Hello!

How can I get a point at a certain length along the curve?

I am using â€śRhino 5 for Windows C++ SDKâ€ť.

Iâ€™ve just realized that I do it wrong (Set domain [0.0; length] and just get point by domain).

The only solution I found for now is to use â€śRhinoDivideCurve()â€ť and get first point as a result.

Are there easier way?

Thanks in advance!

Here is something I quickly typed up:

```
ON_3dPoint GetArcLengthPointOnCurve(
const ON_Curve& curve,
double length
)
{
ON_3dPoint rc = ON_UNSET_POINT;
double crv_length = 0.0;
if (curve.GetLength(&crv_length) && crv_length >= length)
{
double s;
if (length == 0.0)
s = 0.0;
else if (length == crv_length)
s = 1.0;
else
s = length / crv_length;
double t = 0.0;
if (curve.GetNormalizedArcLengthPoint(s, &t))
rc = curve.PointAt(t);
}
return rc;
}
```

Does this help?

â€“ Dale

1 Like

It worked!

Thanks a lot!