convertConicToQuads

fun convertConicToQuads(p0: Point, p1: Point, p2: Point, w: Float, pow2: Int): Array<Point>

Approximates conic with quad array. Conic is constructed from start Point p0, control Point p1, end Point p2, and weight w.

Quad array is stored in pts; this storage is supplied by caller.

Maximum quad count is 2 to the pow2.

Every third point in array shares last Point of previous quad and first Point of next quad. Maximum pts storage size is given by: (1 + 2 * (1 << pow2)).</p>

Returns quad count used the approximation, which may be smaller than the number requested.

conic weight determines the amount of influence conic control point has on the curve.

w less than one represents an elliptical section. w greater than one represents a hyperbolic section. w equal to one represents a parabolic section.

Two quad curves are sufficient to approximate an elliptical conic with a sweep of up to 90 degrees; in this case, set pow2 to one.

Return

number of quad curves written to pts

Parameters

p0

conic start Point

p1

conic control Point

p2

conic end Point

w

conic weight

pow2

quad count, as power of two, normally 0 to 5 (1 to 32 quad curves)