Parameter At Point Issue

Hello Everyone!

I’m having a trouble when used the function “ParameterAtPoint”. I have a list of points and also a list of curves (as you can see in the picture)… using a loop I obtain the parameter of each point. But with some points the function doesn’t work, I verified that the problematic point is intersecting the curve but still have the problem.

Have you experienced this problem before? Thank you for your comments!

Firstly, you have what appears to be a pretty insane list rank (depth) so I would begin by simplifying your data structure. You could probably get away with 1D lists for both points and curves (rank 1), try flattening your lists first for a simple fix. If for whatever reason you do need to maintain this list structure then possible causes of the exception could be due to the fact you are not indexing to an equal depth or you’re indexing too deeply into the list.

If you simplyfiy your data structure then you could also pass lists for the indexes - I’m guess what you are trying to do is get items 0,0,0,4 and 2 from the curve list and items 1,1,2 and 5 from the point list. If that is the case, firstly ensure there are an equal number of index keys to prevent any data mismatching, and pass a list into the indexer brackets, i.e.:

list[ {0, 0, 0, 4, 2} ]

etc

2 Likes

Hi @Thomas_Mahon, thank you for your comment, I followed your advice, I have a deep list because I used other geometries organized within list of lists, but I flattened the list with points and curves to test the “PointAtParameter” function, and still doesn’t work. I create a new point using the coordinates of the point in the list and used the DoesIntersect function to make sure if the point was intersecting, and in both cases its true but in some points, like point_1 test, still have the same problem, I’m not finding the logic about the issue… What do you think?

Sometimes you can circumvent this kind of error using Geometry.ClosestPoint to ensure the point is on the curve. To double check accuracy after that you can use the Distance node to measure distance from original point and closest point…

Thank you Nick! the picture shows how I tried it, is that the idea?. I still have the same problem, I’m not sure if some property of the point is causing the issue or something wrong with the ParameterAtPoint function, I will keep searching…

Do you only get this problem with circles?

Until now I just have this problem in curves, they are not perfect circles, but ellipses and arcs.