algorithmic modeling for Rhino
This effort demonstrates a tricky detail that your diagram also missed. See the four short "rays" that don't touch anything? They happen because the lines they intersect with have been chopped off by intersecting other lines, so these four never actually touch any other lines. This suggests to me an iterative process (Anemone loop) that tests and cuts one pair of lines at a time, though it would be difficult to know where to start, which pairs to check first.
Mmm you are indeed right Joseph, Those are actually the "first" intersections on the curve...
Maybe the thing is not to trim the line, but to cull the non wanted points. Then the lines can be reconstructed with these intersection points. But again, how would one cull the list of points so that only the correct ones remain?