quadratic_vertex()#

Specifies vertex coordinates for quadratic Bezier curves.

Examples#

example picture for quadratic_vertex()
1def setup():
2    py5.no_fill()
3    py5.stroke_weight(4)
4    py5.begin_shape()
5    py5.vertex(20, 20)
6    py5.quadratic_vertex(80, 20, 50, 50)
7    py5.end_shape()
example picture for quadratic_vertex()
1def setup():
2    py5.no_fill()
3    py5.stroke_weight(4)
4    py5.begin_shape()
5    py5.vertex(20, 20)
6    py5.quadratic_vertex(80, 20, 50, 50)
7    py5.quadratic_vertex(20, 80, 80, 80)
8    py5.vertex(80, 60)
9    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 Processing 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 November 12, 2021 11:30:58am UTC