Extend many Curves to intersection with other curves by one click

Is there a way to extend automatically curves to the intersections with other very closed curves. I have a lot of curves whose end is very closed to the other curve that I can’t see without zooming in. I would like to extend only the curves whose end is very close with other curves (with a distance < 2mm for example). Or at least, make appear the endpoints that are very closed to other lines.

Thank you in advance

Hi -

There is no native command in Rhino to do this, no, but it should be scriptable.
A quick test with the following input:
image

The attached Grasshopper definition has a hard-coded tolerance of 5 units but that can easily be changed into a smaller number. The definition is prepared to be run with the GrasshopperPlayer command and you just have to select all curves. In this case, limited to 100 curves but that can also be changed.
ExtendLines-GHPlayer.gh (19.2 KB)
-wim

2 Likes

Hi Win, It works fine, Thanks a lot for your help. Best regards

I would like to modify your script to show the places where there is an end node of a line which is very close to the other line. I used the condition (x>z) and (x≤y) so as not to show distances greater than z and less than z=0.0 (which corresponds to the intersections of the lines). But it’s surprising that the “Eval” function gives “True” for the distance 0.0, it means that {(0.0>0.0) and (x≤y)} is true. if I take z=0.000001, it works, that means that the value 0.0 or two nodes considered coincident in rhino hase a distance greater than 0.?
Do you have any ideas for this problem? Attached are the rhino and grasshopper files.
Thank you for your help


ExtendLines-check_shortempty.3dm (62.7 KB)
ExtendLines-check_shortempty.gh (18.0 KB)

Hi -

I haven’t taken a closer look at your files but it sounds like the following thread would be worthwhile to read:

-wim

1 Like

Thank you very much for the information, I understand now this problem.