PavePave
Home
Guide
API
Sandbox
  • English
  • 日本語
GitHub
Home
Guide
API
Sandbox
  • English
  • 日本語
GitHub
  • @baku89/pave v0.7.2

@baku89/pave v0.7.2


@baku89/pave v0.7.2

Modules

  • Arc
  • CubicBezier
  • Curve
  • Distort
  • Iter
  • Line
  • Path
  • Segment

Other

CurveGroup

CurveGroup: number | number[] | Set<number> | (curve, index) => boolean

Defined in: CurveGroup.ts:4


CurveLocation

CurveLocation: UnitCurveLocation | OffsetCurveLocation | TimeCurveLocation

Defined in: Location.ts:16

Represents a location on a single curve


OffsetCurveLocation

OffsetCurveLocation: OffsetSegmentLocation & CurveLocationIndices

Defined in: Location.ts:30


OffsetPathLocation

OffsetPathLocation: OffsetSegmentLocation & PathLocationIndices

Defined in: Location.ts:51


OffsetSegmentLocation

OffsetSegmentLocation: object

Defined in: Location.ts:10

Type declaration

NameType
offsetnumber

PathLocation

PathLocation: UnitPathLocation | OffsetPathLocation | TimePathLocation

Defined in: Location.ts:45

Represents a location on a path


SegmentLocation

SegmentLocation: UnitSegmentLocation | OffsetSegmentLocation | TimeSegmentLocation

Defined in: Location.ts:4

Represents a location on a single segment


TimeCurveLocation

TimeCurveLocation: TimeSegmentLocation & CurveLocationIndices

Defined in: Location.ts:31


TimePathLocation

TimePathLocation: TimeSegmentLocation & PathLocationIndices

Defined in: Location.ts:52


TimeSegmentLocation

TimeSegmentLocation: object

Defined in: Location.ts:11

Type declaration

NameType
timenumber

UnitCurveLocation

UnitCurveLocation: number | object & CurveLocationIndices

Defined in: Location.ts:29


UnitPathLocation

UnitPathLocation: number | object & PathLocationIndices

Defined in: Location.ts:50


UnitSegmentLocation

UnitSegmentLocation: number | { unit: number; }

Defined in: Location.ts:9

Types

AngleRange

AngleRange: readonly [number, number]

Defined in: Arc.ts:31

The angle range to check. startAngle is always in the range of [-π, π], and the endAngle is relative angle considering the rotation direction, with start angle as a reference.


BareSegmentA

BareSegmentA: Omit<SegmentA, "command">

Defined in: Arc.ts:37

Almost equivalent to SegmentA, but the redundant command field can be omitted. Used for the argument of Arc functions.


BareSegmentC

BareSegmentC: Omit<SegmentC, "command">

Defined in: CubicBezier.ts:23

Almost equivalent to SegmentC, but the redundant command field can be omitted. Used for the argument of CubicBezier functions.


BareSegmentL

BareSegmentL: Omit<SegmentL, "command">

Defined in: Line.ts:13

Almost equivalent to SegmentL, but the redundant command field can be omitted. Used for the argument of Line functions.


CommandArgsA

CommandArgsA: readonly [vec2, number, boolean, boolean]

Defined in: path/types.ts:15

Arguments for arc (A) command

See

https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths#arcs


CommandArgsC

CommandArgsC: readonly [vec2, vec2]

Defined in: path/types.ts:8

Arguments for cubic Bézier curve (C) command.

See

https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths#curve_commands


Curve<V>

Curve<V>: object

Defined in: Curve.ts:15

A single open or closed stroke represented as an array of vertices. All of the points are represented as tuple [x: number, y: number] and the commands are represented in absolute form.

Values are immutable: do not mutate vertices or their elements in place. Curve helpers may memoize by reference.

Type Parameters

Type ParameterDefault type
V extends VertexVertex

Type declaration

NameType
closedboolean
verticesV[]

CurveA

CurveA: Curve<VertexA>

Defined in: Curve.ts:27


CurveC

CurveC: Curve<VertexC>

Defined in: Curve.ts:24


CurveL

CurveL: Curve<VertexL>

Defined in: Curve.ts:21


CurveLocationIndices

CurveLocationIndices: object

Defined in: Location.ts:25

Optional segment index when locating on a Curve.

Type declaration

NameType
segmentIndex?number

PartialBy<T, K>

PartialBy<T, K>: Omit<T, K> & Partial<Pick<T, K>>

Defined in: utils.ts:41

Makes the given keys of T optional.

Type Parameters

Type Parameter
T
K extends keyof T

Path<V>

Path<V>: object

Defined in: Path.ts:20

A path that consists of multiple curves.

Values are immutable: do not mutate curves, nested curves, or vertices in place. Path helpers may memoize by reference.

Type Parameters

Type ParameterDefault type
V extends VertexVertex

Type declaration

NameType
curvesCurve<V>[]

PathA

PathA: Path<VertexA>

Defined in: Path.ts:43

A path that only consists of arc (A) commands.

See

https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths#curve_commands


PathC

PathC: Path<VertexC>

Defined in: Path.ts:36

A path that only consists of cubic Bézier curve (C) commands.

See

https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths#curve_commands


PathL

PathL: Path<VertexL>

Defined in: Path.ts:29

A path that only consists of line (L) commands, which is a simple polygon or polyline.

See

https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths#Line_commands


PathLocationIndices

PathLocationIndices: object

Defined in: Location.ts:37

Optional curve and segment indices when locating on a Path.

Type declaration

NameType
curveIndex?number
segmentIndex?number

Segment<V>

Segment<V>: V extends VertexL ? SegmentL : V extends VertexC ? SegmentC : V extends VertexA ? SegmentA : SegmentL | SegmentC | SegmentA

Defined in: Segment.ts:15

A segment of a path, which consists of a starting point, end point, and an interpolation command.

Type Parameters

Type ParameterDefault type
V extends VertexVertex

SegmentA

SegmentA: VertexA & object

Defined in: Segment.ts:30

Type declaration

NameType
startvec2

SegmentC

SegmentC: VertexC & object

Defined in: Segment.ts:27

Type declaration

NameType
startvec2

SegmentL

SegmentL: VertexL & object

Defined in: Segment.ts:24

Type declaration

NameType
startvec2

SVGCommand

SVGCommand: "M" | "L" | "H" | "V" | "Q" | "T" | "C" | "S" | "A" | "Z" | "m" | "l" | "h" | "v" | "q" | "t" | "c" | "s" | "a" | "z" | vec2 | boolean | number

Defined in: path/types.ts:76

A token or numeric argument in a sequence passed to Path.fromSVG.


UnarcPath

UnarcPath: Path<VertexL | VertexC>

Defined in: Path.ts:49

A path that does not contain any VertexA. It can be obtained by Path.unarc, while approximating arcs to cubic Bézier curves. In some non-affine transformations such as Path.distort and Path.offset, all arcs are internally converted to this type of path.


Vertex

Vertex: VertexL | VertexC | VertexA

Defined in: path/types.ts:38

A vertex of a path. It consists of a end point and an interpolation command from the previous vertex, which is either a line (L) command, a cubic Bézier curve (C) command, or an arc (A) command.


VertexA

VertexA: object

Defined in: path/types.ts:66

A vertex representing an arc (A) command.

Type declaration

NameType
argsCommandArgsA
command"A"
pointvec2

See

https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths#arcs


VertexC

VertexC: object

Defined in: path/types.ts:55

A vertex representing a cubic Bézier curve (C) command.

Type declaration

NameType
argsCommandArgsC
command"C"
pointvec2

VertexL

VertexL: object

Defined in: path/types.ts:45

A vertex representing a line (L) command.

Type declaration

NameType
args?undefined
command"L"
pointvec2

See

https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths#Line_commands

Edit this page