Bezier: handle curve based on bezier path
A bezier path can be constructed like this
path = BezierPath()
# start the path
path.path_begin(x, y)
# add a point with x1/y1, x2/y2 as control point
path.path_curve_to(x1, y1, x2, y2, x, y)
# repeat this multiple time... until
# path.path_curve_to(...)
# close the path
path.path_close()
# and draw !
path.draw()
You can also provide a point list, and directly create a path
points = (startx, starty,
controlx1, controly1, controlx2, controly2, pointx1, pointx2,
# ... repeat
)
path = BezierPath(path=points)
path.draw()
Bases: object
Create a line based on bezier equation, or a shape using GLU tess.
| Parameters : |
|
|---|
Create a new path from a list of control points
Draw the path on screen (filled or line)
Return the filled shape in format ((gl style, (x,y,x,y...)),...)
Return the calculated path in format (x,y,x,y...)
Start a new bezier path
Add a control point into bezier path
End the current bezier path
Reset the display list cache