Bentley-Ottman Algorithm for Two Groups of Line Segments

The Bentley-Ottman algorithm is used to calculate the intersection of segments.

However, instead of finding intersecting points of all lines between them, I want to find intersecting points between two groups of lines. This means that for each row in the row group, AI want to know the intersection points between these lines and the rows in the group B.

Anyway, can I extend the Bentley-Ottmann algorithm for this? I already have a implemented Bentley-Ottmann algorithm ( in the CGAL library ), and I do not want to modify it. However, I really want to find ways to reuse and expand it.

Edit: any other algorithms (not necessarily based on Bentley-Ottmann) are welcome. It would be better if these algorithms were already implemented in the existing library.

+5
source share
4 answers

You can find all the intersections between all the lines in A+B, and then remove the intersections between the lines in one set. You do not greatly increase the complexity, and this allows you to use the CGAL library function unchanged with just a simple wrapper function.

+3
source

Bentley-Ottman , , , A B? , , A- B- .

; .

0

All Articles