Straigh section through Points on Lines

So I have a bunch of lines that are slightly rotated and I was wondering if there is way to tell if there is a straight line through a point on all the lines.

The only way I could figure out how to set it up was to use Galapagos. Where I picked a point on the first line, had a slider one last line. Then using Galapagos to find where that sliding line intersects the most original lines.

I was wondering if there was an easier or better way to accomplish the same thing.

Straight Section Lines.3dm (51.7 KB)
Straight Section Test.gh (12.0 KB)

Not a definitive solution, just some thoughts.

Your method with galapagos can be improved.
Your method uses curve-curve intersection, and then uses the amount of intersections as fitness… but often intersection doesn’t happen at all, so the euristic part is “blind”.

See this:


Use 2 sliders, and use curve proximity to find the distances. The fitness is the sum of all the distances, that needs to be as low as possible (“minimize” in galapagos).


Then, you asked a test to determine IF there is a straight line through all the lines.
Well, that depends of tolerance.
0 tolerance? (line have to touch all the lines?) It’s a straight “no”.
Or, if you want to accept some tolerance, see this:


Finding the plane where the lines rotate, and the deviation is 0. Nice! Simple situation.
The distance of each line from the plane is increasing constantly. Nice! Even simpler situation.
Lastly, checking the variation of the direction of the curves. Small. Angle from a line to the next is almost constant.

But this is only to determine IF, and is up to your tolerances to tell if yes or no.

Straight Section Test_re.gh (14.9 KB)


Then, I’ve tried some other method, other than galapagos… even by manually rotating the view…
Problem: your straight sections have “infinite” possible solutions of a crossing line touching them all, given some tolerance.
It seems like your lines come from a construction made from a loft-like function.
This is also why galapagos don’t find quickly the solution.