Py5Shape.bezier_detail()

Sets a Py5Shape object’s resolution at which Beziers display.

Examples

example picture for bezier_detail()
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
def setup():
    py5.size(100, 100, py5.P2D)
    s1 = make_curve(5)
    s2 = make_curve(20)
    py5.shape(s1)
    py5.shape(s2, 40, 0)


def make_curve(detail):
    s = py5.create_shape()
    s.begin_shape()
    s.no_fill()
    s.vertex(10, 20)
    s.bezier_detail(detail)
    s.bezier_vertex(60, 0, 60, 75, 10, 75)
    s.end_shape()
    return s

Description

Sets a Py5Shape object’s resolution at which Beziers display. The default value is 20.

Drawing 2D bezier curves requires using the P2D renderer and drawing 3D bezier curves requires using the P3D renderer. When drawing directly with Py5Shape objects, bezier curves do not work at all using the default renderer.

This method can only be used within a Py5Shape.begin_shape() and Py5Shape.end_shape() pair.

Underlying Java method: PShape.bezierDetail

Syntax

bezier_detail(detail: int, /) -> None

Parameters

  • detail: int - resolution of the curves

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