begin_contour() and Py5Graphics.end_contour() methods to create negative shapes within shapes such as the center of the letter ‘O’.
begin_contour() and Py5Graphics.end_contour() methods to create negative shapes within shapes such as the center of the letter ‘O’. The
begin_contour() method begins recording vertices for the shape and Py5Graphics.end_contour() stops recording. The vertices that define a negative shape must “wind” in the opposite direction from the exterior shape. First draw vertices for the exterior shape in clockwise order, then for internal shapes, draw vertices counterclockwise.
These methods can only be used within a Py5Graphics.begin_shape() & Py5Graphics.end_shape() pair and transformations such as Py5Graphics.translate(), Py5Graphics.rotate(), and Py5Graphics.scale() do not work within a
begin_contour() & Py5Graphics.end_contour() pair. It is also not possible to use other shapes, such as Py5Graphics.ellipse() or Py5Graphics.rect() within.
Underlying Java method: PGraphics.beginContour
begin_contour() -> None
Updated on September 11, 2021 16:51:34pm UTC