parameters: (x1,x2,x3,x4,res,return_params = False)
return_statement: return path
docstring: Discretizes a bezier curve into a list of points.  If return_params
      is True, a pair (points,params) is returned where params are the exact
      parameter values for which each point was generated.  Otherwise, just
      the points are returned.
docstring_summary: Discretizes a bezier curve into a list of points.  If return_params
      is True, a pair (points,params) is returned where params are the exact
      parameter values for which each point was generated.  Otherwise, just
      the points are returned.
docstring_tokens: Discretizes a bezier curve into a list of points . If return_params is True a pair ( points params ) is returned where params are the exact parameter values for which each point was generated . Otherwise just the points are returned .
function: def bezier_discretize(x1,x2,x3,x4,res,return_params = False):
      """Discretizes a bezier curve into a list of points.  If return_params
      is True, a pair (points,params) is returned where params are the exact
      parameter values for which each point was generated.  Otherwise, just
      the points are returned."""
      stack = [(x1,x2,x3,x4)]
      path = [x1]
      if return_params:
          params = [0.0]
          param_stack = [(0.0,1.0)]
      while len(stack) > 0:
          c = stack[-1]
          stack.pop(-1)
          if return_params:
              a,b = param_stack[-1]
              param_stack.pop(-1)
              if bezier_length_bound(*c) > res:
                  half1,half2 = bezier_subdivide(*c)
                  stack.append(half2)
                  stack.append(half1)
                  m=(a+b)*0.5
                  param_stack.append((m,b))
                  param_stack.append((a,m))
              else:
                  assert path[-1] == c[0]
                  assert params[-1] == a
                  path += c[1:]
                  params.append(b)
          else:
              if bezier_length_bound(*c) > res:
                  half1,half2 = bezier_subdivide(*c)
                  stack.append(half2)
                  stack.append(half1)
              else:
                  assert path[-1] == c[0]
                  path += c[1:]
      if return_params:
          return path,params
      return path
function_tokens: def bezier_discretize ( x1 , x2 , x3 , x4 , res , return_params = False ) : stack = [ ( x1 , x2 , x3 , x4 ) ] path = [ x1 ] if return_params : params = [ 0.0 ] param_stack = [ ( 0.0 , 1.0 ) ] while len ( stack ) > 0 : c = stack [ - 1 ] stack . pop ( - 1 ) if return_params : a , b = param_stack [ - 1 ] param_stack . pop ( - 1 ) if bezier_length_bound ( * c ) > res : half1 , half2 = bezier_subdivide ( * c ) stack . append ( half2 ) stack . append ( half1 ) m = ( a + b ) * 0.5 param_stack . append ( ( m , b ) ) param_stack . append ( ( a , m ) ) else : assert path [ - 1 ] == c [ 0 ] assert params [ - 1 ] == a path += c [ 1 : ] params . append ( b ) else : if bezier_length_bound ( * c ) > res : half1 , half2 = bezier_subdivide ( * c ) stack . append ( half2 ) stack . append ( half1 ) else : assert path [ - 1 ] == c [ 0 ] path += c [ 1 : ] if return_params : return path , params return path