Filter parallel lines

please if you could help me with algorithm…

  • I need to first be able to filter all the lines that are parallel… there will logically be some parallel to the x axis and others parallel to the y axis.
  • then I need to group them by means of a distance filter in the case of the drawing, it would be 0.06 … groups of two or three lines should result …
  • filtered and grouped by distance I should keep the one with the longest length.
    lineas paralelas.3dm (216.4 KB)

Start with this. Note the expression on the DProd (Dot Product) output.

HV _2023Feb21a
HV (5.8 KB)

Curves are internalized, no need for Rhino file.