Table Of Contents

Previous topic

pdfviewer

Next topic

buttonpanel

This Page

phoenix_title bezier

function_summary Functions Summary

calculate_bezier Calculate a bezier curve from 4 control points and return a
compute_points Input 4 control points as wxRealPoints and convert to vec2d instances.

Functions



calculate_bezier(p, steps = 30)

Calculate a bezier curve from 4 control points and return a list of the resulting points. Depends on the 2d vector class from http://www.pygame.org/wiki/2DVectorClass

2007 Victor Blomqvist Released to the Public Domain The function uses the forward differencing algorithm described at http://www.niksula.cs.hut.fi/~hkankaan/Homepages/bezierfast.html



compute_points(controlpoints, nsteps=30)

Input 4 control points as wxRealPoints and convert to vec2d instances. compute the nsteps points on the resulting curve and return them as a list of wxPoints