PavePave
Home
Guide
API
Sandbox
  • English
  • 日本語
GitHub
Home
Guide
API
Sandbox
  • English
  • 日本語
GitHub
  • Arc

@baku89/pave v0.7.2


@baku89/pave / Arc

Arc

A collection of functions to handle arcs represented with SegmentA.

Utilities

toCenterParameterization()

toCenterParameterization(arg): object

Defined in: Arc.ts:65

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-path2d

Parameters

ParameterType
argBareSegmentA

Returns

object

NameTypeDefault value
anglesAngleRange-
centervec2-
radiivec2-
sweepbooleantrue
xAxisRotationnumber-

Other

approximateByCubicBeziers()

approximateByCubicBeziers(arc, angle): VertexC[]

Defined in: Arc.ts:146

Parameters

ParameterType
arcBareSegmentA
anglenumber

Returns

VertexC[]


bounds()

bounds(arg): Rect

Defined in: Arc.ts:229

Calculates the bound of given arc.

Parameters

ParameterTypeDescription
argBareSegmentAThe arc segment to calculate

Returns

Rect

The bound of the arc

Example


derivative()

derivative(arc, loc): vec2

Defined in: Arc.ts:389

Parameters

ParameterType
arcBareSegmentA
locSegmentLocation

Returns

vec2


divideAtTimes()

divideAtTimes(arc, times): VertexA[]

Defined in: Arc.ts:442

Parameters

ParameterType
arcBareSegmentA
timesIterable<number>

Returns

VertexA[]


ellipticArcLength()

ellipticArcLength(radii, angles): number

Defined in: Arc.ts:491

Parameters

ParameterType
radiivec2
anglesAngleRange

Returns

number


isStraight()

isStraight(arc): boolean

Defined in: Arc.ts:481

Parameters

ParameterType
arcBareSegmentA

Returns

boolean


isZero()

isZero(arg): boolean

Defined in: Arc.ts:476

Returns true if the length of arc segment is zero.

Parameters

ParameterType
argBareSegmentA

Returns

boolean


length()

length(arg): number

Defined in: Arc.ts:360

Parameters

ParameterType
argBareSegmentA

Returns

number


normal()

normal(arc, loc): vec2

Defined in: Arc.ts:407

Parameters

ParameterType
arcBareSegmentA
locSegmentLocation

Returns

vec2


of()

of(start, radii, xAxisRotation, largeArcFlag, sweepFlag, point): SegmentA

Defined in: Arc.ts:44

Parameters

ParameterType
startvec2
radiivec2
xAxisRotationnumber
largeArcFlagboolean
sweepFlagboolean
pointvec2

Returns

SegmentA


offset()

offset(arc, distance, unarcAngle): Path

Defined in: Arc.ts:516

Parameters

ParameterTypeDefault value
arcBareSegmentAundefined
distancenumberundefined
unarcAnglenumber90

Returns

Path


point()

point(arc, loc): vec2

Defined in: Arc.ts:380

Parameters

ParameterType
arcBareSegmentA
locSegmentLocation

Returns

vec2


tangent()

tangent(arc, loc): vec2

Defined in: Arc.ts:403

Parameters

ParameterType
arcBareSegmentA
locSegmentLocation

Returns

vec2


toTime()

toTime(arc, loc): number

Defined in: Arc.ts:365

Parameters

ParameterType
arcBareSegmentA
locSegmentLocation

Returns

number


transform()

transform(arc, matrix): SegmentA

Defined in: Arc.ts:274

Transforms the given arc segment with the given matrix.

Parameters

ParameterType
arcBareSegmentA
matrixmat2d

Returns

SegmentA

See

https://gist.github.com/timo22345/9413158#file-flatten-js-L443-L547


trim()

trim(arc, start, end): SegmentA

Defined in: Arc.ts:411

Parameters

ParameterType
arcBareSegmentA
startSegmentLocation
endSegmentLocation

Returns

SegmentA

Edit this page