bezier.split()

Syntax

split(path, t)

Description

Returns a new path with an extra point at t. Splits the path at t, which is a number between 0.0 and 1.0 and indicates the time on the path. A value of 0.5 would mean halfway down the path.

Example

bezier = ximport("bezier")
nofill()
autoclosepath(False)
 
beginpath(100, 500)
curveto(200,250, 600,600, 400,300)
path = endpath(draw=False)
 
stroke(0.5)
path = bezier.split(path, 0.25)
drawpath(path)
 
stroke(0.2)
for point in path:
    oval(point.x-4, point.y-4, 8, 8)