Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(6)  |  Call(4)  |  Derive(0)  |  Import(2)

        def flatten_cubic_bezier(p1,p2,c1,c2, max_divisions=None, max_flatness=0.1):
	out = []

	if not __is_flat(max_divisions, max_flatness, __bezier_flatness(p1,p2,c1,c2)):
		a,m,p,n,c = subdivide_cubic_bezier(p1,p2,c1,c2,0.5)

		md_rec = max_divisions - 1 if max_divisions else None

		out.extend(flatten_cubic_bezier(p1,p,a,m, md_rec, max_flatness))
		out.append(p)
		out.extend(flatten_cubic_bezier(p,p2,n,c, md_rec, max_flatness))

	return out
        


src/p/y/py2d-0.1/py2d/SVG.py   py2d(Download)
from collections import deque
from py2d.Math import Polygon, Vector, Transform
from py2d.Bezier import flatten_cubic_bezier, flatten_quadratic_bezier
 
def convert_svg(f, transform=Transform.unit(), bezier_max_divisions=None, bezier_max_flatness=0.1):
						b += relative_pos
 
					bez = flatten_cubic_bezier(relative_pos, b, c1, c2, bezier_max_divisions, bezier_max_flatness)
 
					last_control = c2
						b += relative_pos
 
					bez = flatten_cubic_bezier(relative_pos, b, c1, c2, bezier_max_divisions, bezier_max_flatness)
 
					last_control = c2

src/p/y/Py2D-HEAD/py2d/SVG.py   Py2D(Download)
from collections import deque
from py2d.Math import Polygon, Vector, Transform
from py2d.Bezier import flatten_cubic_bezier, flatten_quadratic_bezier
 
def convert_svg(f, transform=Transform.unit(), bezier_max_divisions=None, bezier_max_flatness=0.1):
						b += relative_pos
 
					bez = flatten_cubic_bezier(relative_pos, b, c1, c2, bezier_max_divisions, bezier_max_flatness)
 
					last_control = c2
						b += relative_pos
 
					bez = flatten_cubic_bezier(relative_pos, b, c1, c2, bezier_max_divisions, bezier_max_flatness)
 
					last_control = c2