quadratic_vertex()

Specifies vertex coordinates for quadratic Bezier curves.

Examples

example picture for quadratic_vertex()
1
2
3
4
5
6
7
def setup():
    py5.no_fill()
    py5.stroke_weight(4)
    py5.begin_shape()
    py5.vertex(20, 20)
    py5.quadratic_vertex(80, 20, 50, 50)
    py5.end_shape()
example picture for quadratic_vertex()
1
2
3
4
5
6
7
8
9
def setup():
    py5.no_fill()
    py5.stroke_weight(4)
    py5.begin_shape()
    py5.vertex(20, 20)
    py5.quadratic_vertex(80, 20, 50, 50)
    py5.quadratic_vertex(20, 80, 80, 80)
    py5.vertex(80, 60)
    py5.end_shape()

Description

Specifies vertex coordinates for quadratic Bezier curves. Each call to quadratic_vertex() defines the position of one control point and one anchor point of a Bezier curve, adding a new segment to a line or shape. The first time quadratic_vertex() is used within a begin_shape() call, it must be prefaced with a call to vertex() to set the first anchor point. This method must be used between begin_shape() and end_shape() and only when there is no MODE parameter specified to begin_shape(). Using the 3D version requires rendering with P3D.

Underlying Java method: quadraticVertex

Syntax

quadratic_vertex(cx: float, cy: float, cz: float, x3: float, y3: float, z3: float, /) -> None
quadratic_vertex(cx: float, cy: float, x3: float, y3: float, /) -> None

Parameters

  • cx: float - the x-coordinate of the control point

  • cy: float - the y-coordinate of the control point

  • cz: float - the z-coordinate of the control point

  • x3: float - the x-coordinate of the anchor point

  • y3: float - the y-coordinate of the anchor point

  • z3: float - the z-coordinate of the anchor point

Updated on September 11, 2021 16:51:34pm UTC