Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BentleyOttmann: not all intersections are reported. #45

Open
ng-dm opened this issue Jun 3, 2024 · 0 comments
Open

BentleyOttmann: not all intersections are reported. #45

ng-dm opened this issue Jun 3, 2024 · 0 comments

Comments

@ng-dm
Copy link

ng-dm commented Jun 3, 2024

Hi, the Bentley-Ottmann algorithm implementation seems to fail to detect all intersection points.

var lines = new List<Line>()
{
    new Line(new Point(0.307769600445297, 0.496908523373729), new Point(0.752325133305194, 0.247345594804429)),
    new Line(new Point(0.59643911784349, 0.212231021938953), new Point(0.936056684207198, 0.558365820701404)),
    new Line(new Point(0.362570754886871, 0.145859633640321), new Point(0.837961102294718, 0.571770970510212)),
    new Line(new Point(0.415960443865489, 0.216604132306112), new Point(0.746803699409032, 0.5559045125525)),
};
BentleyOttmann bentleyOttmann = new BentleyOttmann(7);
var count = bentleyOttmann.FindIntersections(lines).Count;
Console.WriteLine(count); // only 2 instead of 3

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant