Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "index"

Index

Functions

Const sutherlandHodgeman

  • sutherlandHodgeman(pts: ReadonlyVec[], bounds: ReadonlyVec[], bc?: ReadonlyVec, eps?: number): (ArrayLike<number> & Iterable<number>)[]
  • Extended version of Sutherland-Hodgeman convex polygon clipping supporting any convex boundary polygon (not only rects). Returns new array of clipped vertices.

    https://en.wikipedia.org/wiki/Sutherland%E2%80%93Hodgman_algorithm

    Parameters

    • pts: ReadonlyVec[]

      subject poly vertices

    • bounds: ReadonlyVec[]

      clipping boundary vertices

    • Optional bc: ReadonlyVec

      pre-computed boundary centroid

    • Default value eps: number = EPS

      edge classification tolerance

    Returns (ArrayLike<number> & Iterable<number>)[]

Generated using TypeDoc