def split_bezier_intersecting_with_closedpath(bezier, inside_closedpath, tolerence=0.01):
 bz = BezierSegment(bezier)
 bezier_point_at_t = bz.point_at_t
 (t0, t1) = find_bezier_t_intersecting_with_closedpath(bezier_point_at_t, inside_closedpath, tolerence=tolerence)
 (_left, _right) = split_de_casteljau(bezier, ((t0 + t1) / 2.0))
 return (_left, _right)

def split_bezier_intersecting_with_closedpath ( bezier , inside_closedpath , tolerence = 0.01 ) : bz = BezierSegment ( bezier ) bezier_point_at_t = bz . point_at_t ( t0 , t1 ) = find_bezier_t_intersecting_with_closedpath ( bezier_point_at_t , inside_closedpath , tolerence = tolerence ) ( _left , _right ) = split_de_casteljau ( bezier , ( ( t0 + t1 ) / 2.0 ) ) return ( _left , _right )
bezier : control points of the bezier segment inside_closedpath : a function which returns true if the point is inside the path .