• This function cuts a given self-intersecting polygon into non-self-intersecting sub polygons.

    The algorithm only works for non-self-overlapping polygons: Please note that the union set of the sub polygons themselves will not be disjunct if the input polyon overlaps with itself!

    See this illustration for details: ./demos/27-polygon-intersection-greinerhormann/splitting-polygon-types.png

    Parameters

    • vertices: Vertex[]

      The polygon as an array of vertices.

    • Optional maxDepth: number

      Number of max recursive steps (default is 10).

    Returns Vertex[][]

    A sequence of non-self-intersecting sub polygons.

    Name

    splitPolygonToNonIntersecting