Points at segment length along a curve

Hi All,
just started playing around with Dynamo and this is my first post on this Forum.

As per title, I was exploring some options to place some points along a curve (parabola) at a specific distance. I found a couple of approaches using the nodes: Curve.PointsAtSegmentLength and Curve.PointsAtEqualSegmentLength.
The first gives to me a symmetric values of Z coordinates (and I expected that) while the second node returns slightly different number for Z.
No idea how to to interpret this.

Thanks in advance for your help

Looks like you’ve got a floating point error that you’ll need to deal with. Pull the full value using a Point.Z node for the more complete comparison, and know that the ‘off’ amount is less than it appears.

@jacob.small thanks for you reply.
I used the Point.Z node as you suggested and the difference is a little more evident.
I’m absolutely not an expert of computing and as I said I don’t know how to consider this difference on the list of numbers.
When you says that the amount is less than it appears, are you suggest to ignore this discrepancy?
In a hypothetical scenario of insert element along a curve I would say that the first approach is more intuitive and geometrically correct/

Thanks

Can you post the method used to generate your initial curve? I’ll put something together to show what’s happening but need to be able to recreate the issue to start with. :slight_smile:

Sure. It’s literally a simple exercise approached with two different methods.

Test_AA.dyn (31.1 KB)

Thanks @jacob.small

1 Like

Tested this out, and it appears to be an issue with how the Curve.PointsAtEqualSegmentLength node works with nurbs curves. Guessing it’s a rationalization bug of some sort, but I’ve asked the development team to look into it. For now you can work with parameterizing the length of the curve as in your upper sample, or work with regular curves (lines, arcs, polycurves) which all report correctly in my testing.

1 Like

Thanks @jacob.small for the inputs.

I tested out the same what you suggested (I used an arc curve by three points) and everything works correctly, same numerical results with both methods.

The funniest thing for me was that node Curve.PointsAtEqualSegmentLength returned the wrong values only on the second half of the list of values, like it has some problems of curve’s integration after the vertex. It could be funny trying with a sin or cos curve.

Thanks again for your help :slight_smile:

The degree of accuracy actually scales to the number of points, but floating point is working to fake accuracy in the points in the early part of the dataset. Try using something like 9999 points or h9igher and you’ll likely see what I mean. Eventually it doesn’t calculate points at all in some cases.