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

@baku89/pave v0.7.1


@baku89/pave / Arc

Arc

A collection of functions to handle arcs represented with SegmentA.

Utilities

toCenterParameterization()

toCenterParameterization(arg): object

Defined in: Arc.ts:28

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
argSimpleSegmentA

Returns

object

NameTypeDefault value
anglesAngleRange-
centervec2-
radiivec2-
sweepbooleantrue
xAxisRotationnumber-

Other

approximateByCubicBeziers()

approximateByCubicBeziers(arc, angle): VertexC[]

Defined in: Arc.ts:113

Parameters

ParameterType
arcSimpleSegmentA
anglenumber

Returns

VertexC[]


bounds()

bounds(arg): Rect

Defined in: Arc.ts:196

Calculates the bound of given arc.

Parameters

ParameterType
argSimpleSegmentA

Returns

Rect

The bound of the arc

Example


derivative()

derivative(arc, loc): vec2

Defined in: Arc.ts:366

Parameters

ParameterType
arcSimpleSegmentA
locSegmentLocation

Returns

vec2


divideAtTimes()

divideAtTimes(arc, times): VertexA[]

Defined in: Arc.ts:415

Parameters

ParameterType
arcSimpleSegmentA
timesIterable<number>

Returns

VertexA[]


ellipticArcLength()

ellipticArcLength(radii, angles): number

Defined in: Arc.ts:464

Parameters

ParameterType
radiivec2
anglesAngleRange

Returns

number


isStraight()

isStraight(arc): boolean

Defined in: Arc.ts:454

Parameters

ParameterType
arcSimpleSegmentA

Returns

boolean


isZero()

isZero(arg): boolean

Defined in: Arc.ts:449

Returns true if the length of arc segment is zero.

Parameters

ParameterType
argSimpleSegmentA

Returns

boolean


length()

length(arg): number

Defined in: Arc.ts:337

Parameters

ParameterType
argSimpleSegmentA

Returns

number


normal()

normal(arc, loc): vec2

Defined in: Arc.ts:381

Parameters

ParameterType
arcSimpleSegmentA
locSegmentLocation

Returns

vec2


offset()

offset(arc, distance, unarcAngle): Path

Defined in: Arc.ts:498

Parameters

ParameterTypeDefault value
arcSimpleSegmentAundefined
distancenumberundefined
unarcAnglenumber90

Returns

Path


point()

point(arc, loc): vec2

Defined in: Arc.ts:357

Parameters

ParameterType
arcSimpleSegmentA
locSegmentLocation

Returns

vec2


tangent()

tangent(arc, loc): vec2

Defined in: Arc.ts:377

Parameters

ParameterType
arcSimpleSegmentA
locSegmentLocation

Returns

vec2


toTime()

toTime(arc, loc): number

Defined in: Arc.ts:342

Parameters

ParameterType
arcSimpleSegmentA
locSegmentLocation

Returns

number


transform()

transform(arc, matrix): SegmentA

Defined in: Arc.ts:252

Transforms the given arc segment with the given matrix.

Parameters

ParameterType
arcSimpleSegmentA
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:385

Parameters

ParameterType
arcSimpleSegmentA
startSegmentLocation
endSegmentLocation

Returns

SegmentA

Edit this page