Collinear lines indices

Hi forum! I am trying to find a way to group colinear lines from the same list. I was trying to use component from heteroptera, but it gives me incorrect results. The goal is to move aside colinear and intersecting (not just intersecting) curves from the same region, so i need to find pairs(it always will be pairs) and to move only one curve from pair.
collinear.gh (18.8 KB)


heteroptera mistake:


it finds all colinear curves, not only intersecting ones, even though the flag is set to overlapping only.
image
plus i would like to avoid using plug-ins.
Thank you in advance!

I think this is what you’re after.

collinear_re01.gh (20.9 KB)

-Kevin

1 Like

Hi Kevin! Thank you a lot, i’ve never seen such approach for removing indicies from 2 trees. Modified the script a bit and it does the job now. Thank you!

Each of the collinear intersections produces 2 identical sets of indices. This is one method that came to mind for culling the duplicates.

-Kevin

1 Like