Triangle

class Triangle(p1, p2, p3)

An object representing a triangle with 3 vertices.

Parameters
  • p1 – a tuple (x, y) with the 1st coordinate in world space

  • p2 – a tuple (x, y) with the 2nd coordinate in world space

  • p3 – a tuple (x, y) with the 3rd coordinate in world space

Raises

TypeError – p1, p2, and p3 must be (x, y) tuples of numbers

set_color(*args) None

Sets the fill color of the object

Parameters

*args – a color or 4 colors corresponding to each vertex

Raises

TypeError – arguments must be colors

Return type

None

set_transparency(*args: float) None

Sets the transparency of the object

Parameters

*args (float) – a float or 3 floats corresponding to each vertex

Raises
  • TypeError – arguments must be floats

  • ValueError – transparency must be between 0 and 1

Return type

None