# Add point quirky for each point on polyline

hy guys

i want to create points with specific distance for each point of polyline
see picture for explaination
thank you
best regard

Try the Curve.PointAtChordLength node. That should be fine in this case since it looks like you arenâ€™t dealing with arc segments.

2 Likes

Zachri is correct, Curve.PointAtCurveLength is probably the way to go. Note it will only really work in one direction because it only works on curves not polycurves and needs to know which curve to follow. So your list of offsets may need to be inverted? Iâ€™m not sure. Perhaps there is an equivalent command for polycurves that could be used to follow both directions properly.

1 Like

Ah yes, I forgot that one doesnâ€™t work with polycurves. It might be better to do the math and figure out the parameters for where the red points should be, then use Curve.PointAtParameter. Something like this:

1. Get the parameters of the blue points using Curve.ParameterAtPoint
2. Calculate the parameters for the red points, which would be:
(parameter at blue point) - (offset distance to red point / total curve length)
3. Use Curve.PointAtParameter
1 Like

Hmmm, seems to work but I donâ€™t understand why. What is â€śParameterâ€ť even referring to? Why is â€śCurve.ParameterAtPointâ€ť returning a list of just â€ś1â€ť? Guessing itâ€™s just a decimal representation of a percentage of length along the curve?

Also, I still canâ€™t seem to get the points to offset in the other direction properly.

1 Like

Yep. The start parameter is 0 and the end parameter is 1.

1 Like

Okay cool. Thanks. I think I understand now. So if we want the vertices to go the other way we can just use a curve.reverse node. This has a bool toggle that lets you chose which direction the newly placed vertex goes. It will also rejoin the new curves, create a joined polycurve and make a new polyline in C3D.

Hope this helps at all @dr.hybride , not sure if itâ€™s the best way to go about this but seems to work for this case.

2 Likes

I wouldnâ€™t recommend using parameters in civil context, as the geometry tends to result in more than the occasional nurbs curve, which by definition has a non-uniform spacing of the parameters which define the curve (nurbs stands for Non Uniform Rational B Spline).

The only consistent points for curve parameterization in the context of Dynamo are the start and end point; and in other applications those need not be consistent either. In most applications the spacing of the parameters between the ends two need not be consistently spaced. This community conversation from awhile back may shed some more light on the subject: 08 - Computational Geometry: Model / Physical typesâ€‹ with Dynamo - YouTube

As an alternative you can try one of these:
PointsAtEqualSegmentLength: Dynamo Dictionary

Find a start point to begin your point sequence and try this: Dynamo Dictionary

Build a range of lengths and then use Curve.PointAtSegmentLength: Dynamo Dictionary

2 Likes

@jacob.small

Something like this? The leveling is a bit tough on this, I was trying to make it work for multiple polylines but I donâ€™t think it will with all the list restructuring. Itâ€™s a bit messy!