9

Is there any existing Bentley-Ottmann Algorithm Implementation/library in C# or Java?

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
Sam
  • 933
  • 5
  • 14
  • 26

3 Answers3

4

Here is at least a C++ implementation (including description): http://softsurfer.com/Archive/algorithm_0108/algorithm_0108.htm

  • While technically this is a bentley-ottmann implementation, its only returning true/false. Not finding all intersection points. – ideasman42 Aug 02 '15 at 04:20
1

Here is a Java implementation of the Bentley-Ottman algorithm

Óscar López
  • 232,561
  • 37
  • 312
  • 386
  • 1
    Java link is still available here: http://web.archive.org/web/20040329071207/http://www.solyanik.com/sergey/sweep11/ – ideasman42 Jun 28 '15 at 10:20
0

The implmentation at softsurfer.com is the Shamos-Hoey algorithm to decide if there is at least one intersection. And, if one is found, it stops. The code at the reference is for testing if a polygon is simple.

  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/30795816) – Andres Gardiol Jan 14 '22 at 15:16
  • I was the author of that code, and that is my website. The website has been converted to a book, and this code is no longer available online, As for the code you are discussing, it was for the Shamos-Hoey algorithm which historically preceded the Bentley-Ottman. Shamos-Hoey was for testing if a polygon is simple, so it only returns true or false. It stops as soon as it finds one intersection. – user2924198 Jan 15 '22 at 16:36