NodeBox

Create visual output with Python programming code
Home Download Reference Tutorial Library Gallery About

cornu.drawpath()

Syntax

drawpath(coordinates, close=False, tweaks=20, points=False)

Description

Draws a cornu path from a list of (x,y)-tuples. The x and y coordinates range between 0.0 and 1.0, describing a point's position relative to the drawing area's size(). When the close parameter is set to True, draws a closed path. The number of tweaks makes the curve more elegant, but slows down the command as well. When points is true, draws the curve's control points to the screen.

Example

size(700,700)

cornu = ximport("cornu")

path = [(0.1,0.1), 
        (0.15,0.35), 
        (0.4, 0.2), 
        (0.6, 0.6), 
        (0.4, 0.4)]

nofill()
stroke(0)
cornu.drawpath(path, tweaks=100, points=True)