@baku89/pave - v0.4.1 / Arc

Namespace: Arc

A collection of functions to handle arcs represented with SegmentA.

Utilities

toCenterParameterization

toCenterParameterization(arg): Object

Converts the Arc command to a center parameterization that can be used in Context2D.ellipse(). https://observablehq.com/@awhitty/svg-2-elliptical-arc-to-canvas-path2dopen in new window

Parameters

NameType
argSimpleSegmentA

Returns

Object

NameType
anglesAngleRange
centervec2
radiivec2
sweepboolean
xAxisRotationnumber

Defined in

Arc.ts:27open in new window

Other

approximateByCubicBeziers

approximateByCubicBeziers(arc, angle): VertexC[]

Parameters

NameType
arcSimpleSegmentA
anglenumber

Returns

VertexC[]

Defined in

Arc.ts:112open in new window


bounds

bounds(arg): Rect

Calculates the bound of given arc.

Parameters

NameType
argSimpleSegmentA

Returns

Rect

The bound of the arc

Example

Defined in

Arc.ts:195open in new window


derivative

derivative(arc, loc): vec2

Parameters

NameType
arcSimpleSegmentA
locSegmentLocation

Returns

vec2

Defined in

Arc.ts:365open in new window


divideAtTimes

divideAtTimes(arc, times): VertexA[]

Parameters

NameType
arcSimpleSegmentA
timesIterable<number>

Returns

VertexA[]

Defined in

Arc.ts:414open in new window


ellipticArcLength

ellipticArcLength(radii, angles): number

Parameters

NameType
radiivec2
anglesAngleRange

Returns

number

Defined in

Arc.ts:463open in new window


isStraight

isStraight(arc): boolean

Parameters

NameType
arcSimpleSegmentA

Returns

boolean

Defined in

Arc.ts:453open in new window


isZero

isZero(arg): boolean

Returns true if the length of arc segment is zero.

Parameters

NameType
argSimpleSegmentA

Returns

boolean

Defined in

Arc.ts:448open in new window


length

length(arg): number

Parameters

NameType
argSimpleSegmentA

Returns

number

Defined in

Arc.ts:336open in new window


normal

normal(arc, loc): vec2

Parameters

NameType
arcSimpleSegmentA
locSegmentLocation

Returns

vec2

Defined in

Arc.ts:380open in new window


offset

offset(arc, distance, unarcAngle?): Path

Parameters

NameTypeDefault value
arcSimpleSegmentAundefined
distancenumberundefined
unarcAnglenumber90

Returns

Path

Defined in

Arc.ts:497open in new window


point

point(arc, loc): vec2

Parameters

NameType
arcSimpleSegmentA
locSegmentLocation

Returns

vec2

Defined in

Arc.ts:356open in new window


tangent

tangent(arc, loc): vec2

Parameters

NameType
arcSimpleSegmentA
locSegmentLocation

Returns

vec2

Defined in

Arc.ts:376open in new window


toTime

toTime(arc, loc): number

Parameters

NameType
arcSimpleSegmentA
locSegmentLocation

Returns

number

Defined in

Arc.ts:341open in new window


transform

transform(arc, matrix): SegmentA

Transforms the given arc segment with the given matrix.

Parameters

NameType
arcSimpleSegmentA
matrixmat2d

Returns

SegmentA

See

https://gist.github.com/timo22345/9413158#file-flatten-js-L443-L547open in new window

Defined in

Arc.ts:251open in new window


trim

trim(arc, start, end): SegmentA

Parameters

NameType
arcSimpleSegmentA
startSegmentLocation
endSegmentLocation

Returns

SegmentA

Defined in

Arc.ts:384open in new window