Py5Shape.curve_detail()

Sets the resolution at which a Py5Shape object’s curves display.

Examples

example picture for curve_detail()
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
def setup():
    py5.size(100, 100, py5.P2D)
    py5.shape(draw_curves(30, 2, "#FF0000"))
    py5.shape(draw_curves(70, 20, "#0000FF"))


def draw_curves(y, detail, color):
    s = py5.create_shape()
    s.begin_shape()
    s.no_fill()
    s.stroke(color)
    s.curve_detail(detail)
    s.curve_vertex(0, y)
    s.curve_vertex(10, y-10)
    s.curve_vertex(20, y)
    s.curve_vertex(50, y+20)
    s.curve_vertex(80, y)
    s.curve_vertex(90, y+10)
    s.curve_vertex(100, y)
    s.end_shape()
    return s

Description

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

Drawing 2D curves requires using the P2D renderer and drawing 3D curves requires using the P3D renderer. When drawing directly with Py5Shape objects, 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.curveDetail

Syntax

curve_detail(detail: int, /) -> None

Parameters

  • detail: int - resolution of the curves

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