Class representing a planar set - a generic container with ability to keep and retrieve shapes and perform spatial queries. Planar set is an extension of Set container, so it supports Set properties and methods

Hierarchy

  • Set
    • PlanarSet

Constructors

  • Create new instance of PlanarSet Each object should have a box property

    Returns PlanarSet

Properties

[toStringTag]: string

IntervalTree

size: number

the number of (unique) elements in Set.

[species]: SetConstructor

Methods

  • Iterates over values in the set.

    Returns IterableIterator<any>

  • Add new shape to planar set and to its spatial index.
    If shape already exist, it will not be added again. This happens with no error, it is possible to use size property to check if a shape was actually added.
    Method returns planar set object updated and may be chained

    Parameters

    • entry:
          | Shape<any>
          | Edge
          | Face
          | {
              key: Box;
              value: Shape<any> | Edge | Face;
          }

      shape to be added, should have valid box property

      Another option to transfer as an object {key: Box, value: AnyShape}

    Returns PlanarSet

  • Clear planar set

    Returns void

  • Delete shape from planar set. Returns true if shape was actually deleted, false otherwise

    Parameters

    • entry:
          | Shape<any>
          | Edge
          | Face
          | {
              key: Box;
              value: Shape<any> | Edge | Face;
          }

      shape to be deleted

    Returns boolean

  • Type Parameters

    • U

    Parameters

    • other: ReadonlySetLike<U>

    Returns Set<any>

    a new Set containing all the elements in this Set which are not also in the argument.

  • Returns an iterable of [v,v] pairs for every value v in the set.

    Returns IterableIterator<[any, any]>

  • Executes a provided function once per each value in the Set object, in insertion order.

    Parameters

    • callbackfn: ((value: any, value2: any, set: Set<any>) => void)
        • (value, value2, set): void
        • Parameters

          • value: any
          • value2: any
          • set: Set<any>

          Returns void

    • OptionalthisArg: any

    Returns void

  • Parameters

    • value: any

    Returns boolean

    a boolean indicating whether an element with the specified value exists in the Set or not.

  • Point location test. Returns array of shapes which contains given point

    Parameters

    Returns (Shape<any> | Edge | Face)[]

  • Type Parameters

    • U

    Parameters

    • other: ReadonlySetLike<U>

    Returns Set<any>

    a new Set containing all the elements which are both in this Set and in the argument.

  • Parameters

    • other: ReadonlySetLike<unknown>

    Returns boolean

    a boolean indicating whether this Set has no elements in common with the argument.

  • Parameters

    • other: ReadonlySetLike<unknown>

    Returns boolean

    a boolean indicating whether all the elements in this Set are also in the argument.

  • Parameters

    • other: ReadonlySetLike<unknown>

    Returns boolean

    a boolean indicating whether all the elements in the argument are also in this Set.

  • Despite its name, returns an iterable of the values in the set.

    Returns IterableIterator<any>

  • 2d range search in planar set.
    Returns array of all shapes in planar set which bounding box is intersected with query box

    Parameters

    • box: Box

      query box

    Returns (Shape<any> | Edge | Face)[]

  • Type Parameters

    • U

    Parameters

    • other: ReadonlySetLike<U>

    Returns Set<any>

    a new Set containing all the elements which are in either this Set or in the argument, but not in both.

  • Type Parameters

    • U

    Parameters

    • other: ReadonlySetLike<U>

    Returns Set<any>

    a new Set containing all the elements in this Set and also all the elements in the argument.

  • Returns an iterable of values in the set.

    Returns IterableIterator<any>