# inkex.bezier module

Bezier calculations

Gravesen, Add if the line is closed, in-place addition to array l

inkex.bezier.balf(t, args)[source]

Bezier Arc Length Function

inkex.bezier.between_point(point_a, point_b, time=0.5)[source]

Returns the point between point a and point b

inkex.bezier.bezierlength(bez, tolerance=0.001, time=1.0)[source]

Get length of bezier curve

inkex.bezier.bezierparameterize(bez)[source]

Return the bezier parameter size

inkex.bezier.bezierpointatt(bez, t)[source]

Get coords at the given time point along a bezier curve

inkex.bezier.bezierslopeatt(bez, t)[source]

Get slope at the given time point along a bezier curve

inkex.bezier.beziersplitatt(bez, t)[source]

Split bezier at given time

inkex.bezier.beziertatlength(bez, l=0.5, tolerance=0.001)[source]

Get bezier curve time at the length specified

inkex.bezier.beziertatslope(bez, d)[source]

Reverse; get time from slope along a bezier curve

inkex.bezier.bezlenapprx(sp1, sp2)[source]

Return the aproximate length between two beziers

inkex.bezier.csparea(csp)[source]

Get area in cubic sub-path

inkex.bezier.cspbezsplit(sp1, sp2, time=0.5)[source]

Split a cubic bezier at the time period

inkex.bezier.cspbezsplitatlength(sp1, sp2, length=0.5, tolerance=0.001)[source]

Split a cubic bezier at length

inkex.bezier.cspcofm(csp)[source]

Get cubic sub-path coefficient

inkex.bezier.csplength(csp)[source]

Get cubic bezier length

inkex.bezier.cspseglength(sp1, sp2, tolerance=0.001)[source]

Get cubic bezier segment length

inkex.bezier.cspsubdiv(csp, flat)[source]

Sub-divide cubic sub-paths

inkex.bezier.linebezierintersect(arg_a, bez)[source]

Where a line and bezier intersect

inkex.bezier.maxdist(bez)[source]

Get maximum distance within bezier curve

inkex.bezier.percent_point(point_a, point_b, percent=50.0)[source]

Returns between_point but takes percent instead of 0.0-1.0

inkex.bezier.pointdistance(point_a, point_b)[source]

The straight line distance between two points

inkex.bezier.root_wrapper(root_a, root_b, root_c, root_d)[source]

Get the Cubic function, moic formular of roots, simple root

inkex.bezier.simpson(start, end, maxiter, tolerance, bezier_args)[source]

Calculate the length of a bezier curve using Simpson’s algorithm: http://steve.hollasch.net/cgindex/curves/cbezarclen.html

Parameters
• start (int) – Start time (between 0 and 1)

• end (int) – End time (between start time and 1)

• maxiter (int) – Maximum number of iterations. If not a power of 2, the algorithm

• 2. (will behave like the value is set to the next power of) –

• tolerance (float) – maximum error ratio

• bezier_args (list) – arguments as computed by bezierparametrize()

Returns

the appoximate length of the bezier curve

Return type

float

inkex.bezier.subdiv(sp, flat, i=1)[source]

sub divide bezier curve

inkex.bezier.tpoint(p1, p2, t)[source]

Linearly interpolate between p1 and p2.

t = 0.0 returns p1, t = 1.0 returns p2.

Returns

Interpolated point

Return type

tuple

Parameters
• p1 – First point as sequence of two floats

• p2 – Second point as sequence of two floats

• t (float) – Number between 0.0 and 1.0