Quad

Added in version 1.0.

class Quad(*args, **kwargs)

A 4 vertex quadrilateral, as represented by four Point.

The contents of a Quad are private and should never be accessed directly.

Constructors

class Quad
classmethod alloc() Quad

Allocates a new Quad instance.

The contents of the returned instance are undefined.

Added in version 1.0.

Methods

class Quad
bounds() Rect

Computes the bounding rectangle of q and places it into r.

Added in version 1.0.

contains(p: Point) bool

Checks if the given Quad contains the given Point.

Added in version 1.0.

Parameters:

p – a Point

free() None

Frees the resources allocated by alloc()

Added in version 1.0.

get_point(index_: int) Point

Retrieves the point of a Quad at the given index.

Added in version 1.0.

Parameters:

index – the index of the point to retrieve

init(p1: Point, p2: Point, p3: Point, p4: Point) Quad

Initializes a Quad with the given points.

Added in version 1.0.

Parameters:
  • p1 – the first point of the quadrilateral

  • p2 – the second point of the quadrilateral

  • p3 – the third point of the quadrilateral

  • p4 – the fourth point of the quadrilateral

init_from_points(points: Sequence[Point]) Quad

Initializes a Quad using an array of points.

Added in version 1.2.

Parameters:

points – an array of 4 Point

init_from_rect(r: Rect) Quad

Initializes a Quad using the four corners of the given Rect.

Added in version 1.0.

Parameters:

r – a Rect

Fields

class Quad
points