Polycurve point at chord length

I am trying to divide a polycurve using the Curve.PointAtChordLength but it doesn’t work. I just get ‘parameter at chord length Not Implemented’.

I have also tried ‘Curve.ParameterAtChordLength’ (even though I don’t know the parameter) and that too doesn’t work with polycurves. The only command that seems to work with polycurves as opposed to curves is Curve.PointAtParameter but I don’t know the parameter, I need distance.

As a work around I have even tried to manually work out the point and then to use Curve.SplitByPoints but this explodes the polycurve and returns just one curve before splitting it.

Previous posts have discussed how to do a subdivision on a polycurve using parameters but I need a single points at a fixed chord distance. Any suggestions?



That’s going to be tricky, probably a bug - even converting to nurbs isn’t implemented (reported on github here )

Here are your options:

Simple solution:

  1. Create a point at the start parameter using the Curve.PointAtParameter method
  2. Create a circle with a radius the same as the length you need
  3. Intersect it with your polycurve to generate the point

Complicated solution (if your only curve is made of nurbs curves, arcs, etc)
In this situation the circle intersection could easily intersect twice or more generating more points than needed which in turn creates the problem of establishing which one is needed. Since we know its the point which is ‘first’ traveling along the length of the line, the following should work:

  1. Follow steps 1 and 3 above
  2. Create ‘sample’ points along the length of the curve closely spaced
  3. (requires coding) Create a loop and iterate through the list of sample points testing the distance to the intersection points
  4. The intersection point needed is the one closest to the sample point with the lowest index number

The above suggestion isn’t bullet proof - for example if your polycurve overlaps where there is an intersection, or of the spacing of the sample points is too great, the test above could return unpredicable/incorrect results. If however thats unlikely, it should work

Hi Paul,

Did you try “Curve.PointAtSegmentLength”?

Hi Thomas
I’ve tried your simple solution as shown in the above image but the problem is then trying to split the curve as previously mentioned.

Hi Kalkul

Yes ‘Curve.PointAtSegmentLength’ works but I need chord length, not length. Any other suggestions?

You need to convert polycurves in to curves. Curve.PointAtChordLength works fine.

I know that this works with curves but my question was if it was possible to work with polycurves. Are you saying the ONLY way to do this is to explode the polycurve and then use Curve.PointAtChordLength?

@Paul_Wintour How about approximating the geometry of the polycurve as a nurbs curve?

1 Like

@Vikram_Subbaiah this won’t work because the polycurve contains lines and arcs. Surely there must be a Dynamo command that allows you to create a point on a polycurve…

Can only suggest another work around.

1 Like

@Paul_Wintour if you’re only getting one curve when you split then your only option left is to reconstruct it (not to be confused with ‘rebuilding with tolerance’). This isn’t trivial as you’ll need to establish any curves that preceded the one being split, and join them back together again to return a new polycurve - once again, will require a bit of coding.

"curves is Curve.PointAtParameter but I don’t know the parameter, I need distance"

if I understand correctly calculate the parameter: parameters = distance / length polylinea
you can then use the node