Skip to content

BentleyOttmann: not all intersections are reported. #45

Open
@ng-dm

Description

@ng-dm

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions