jakke-graphics-ts
    Preparing search index...

    Function getBoundingBox2d

    • Calculates the 2D axis-aligned bounding box for a set of vertices.

      Accepts an array of Vertex2d or Vertex3d objects and computes the minimum and maximum x and y coordinates, returning them as the corners of the bounding box.

      Parameters

      • pts: (Vertex2d | Vertex3d)[]

        An array of vertices, each being either Vertex2d or Vertex3d.

      Returns { max: Vertex2d; min: Vertex2d }

      An object containing min and max properties, each a Vertex2d representing the lower-left and upper-right corners of the bounding box, respectively.