@baku89/pave - v0.4.1 / Path

Namespace: Path

Functions for manipulating paths represented as Path.

Classes

Interfaces

Primitives

arc

arc(center, radius, startAngle, endAngle, options?): Path

Creates an arc path.

Parameters

NameTypeDescription
centervec2The center of the arc
radiusnumberThe radius of the arc
startAnglenumberThe start angle in radians
endAnglenumberThe end angle in radians
optionsArcOptions-

Returns

Path

The newly created path

Example

Defined in

Path.ts:527open in new window


arcByPoints

arcByPoints(start, through, end): Path

Creates an arc path from the given three points. If the points are collinear, it will create a straight line path.

Parameters

NameTypeDescription
startvec2The start point
throughvec2The point that the arc passes through
endvec2The end point

Returns

Path

The newly created path

Defined in

Path.ts:572open in new window


arcByPointsAngle

arcByPointsAngle(start, end, angle): Path<Vertex>

Creates an arc path from two points and an angle.

Parameters

NameTypeDescription
startvec2The start point
endvec2The end point
anglenumberThe angle of arc in degrees. If the angle is positive, the arc will be drawn in the sweep direction (clockwise in Y-down coordinate system).

Returns

Path<Vertex>

The newly created path

Defined in

Path.ts:678open in new window


arcByPointsTangent

arcByPointsTangent(start, startTangent, end): Path

Creates an arc path from start point, start tangent, and end point.

Parameters

NameTypeDescription
startvec2The start point
startTangentvec2The tangent at the start point
endvec2The end point

Returns

Path

A newly created open arc path

Defined in

Path.ts:643open in new window


circle

circle(center, radius): Path

Creates a circle path from the given center and radius.

Parameters

NameTypeDescription
centervec2The center of the circle
radiusnumberThe radius of the circle

Returns

Path

The newly created path

Example

Defined in

Path.ts:292open in new window


circleFromPoints

circleFromPoints(p1, p2?, p3?, «destructured»?): Path

Creates a circle path which passes through the given points.

Parameters

NameTypeDescription
p1vec2The first point
p2?null | vec2The second point
p3?null | vec2The third point
«destructured»CircleFromPointsOptions-

Returns

Path

The circle path, whose first point matches to p1. After duplicating points are removed, if there are only one point, creates a circle with zero radius. For two points, creates a circle from the two points as the diameter. Otherwise, creates a circle that passes through the three points.

Example

Defined in

Path.ts:370open in new window


cubicBezier

cubicBezier(start, control1, control2, point): Path

Creates a path consisting of a single C command.

Parameters

NameTypeDescription
startvec2The start point
control1vec2The first control point
control2vec2The second control point
pointvec2The end point

Returns

Path

The newly created path

Defined in

Path.ts:925open in new window


dot

dot(point): PathL

Creates a “dot“ path, which consists of only a M command to the specified point followed by Z command. This will be rendered only if the lineCap of the drawing context is set to 'round' or 'square'.

Parameters

NameTypeDescription
pointvec2The center point of the dot

Returns

PathL

The newly created paths

Example

Defined in

Path.ts:792open in new window


ellipse

ellipse(center, radius): Path

Creates an ellipse path from the given center and radius.

Parameters

NameTypeDescription
centervec2The center of the ellipse
radiusvec2The radius of the ellipse

Returns

Path

The newly created path

Example

Defined in

Path.ts:467open in new window


empty

Const empty: Path

Empty path.

Defined in

Path.ts:158open in new window


fan

fan(center, innerRadius, outerRadius, startAngle, endAngle): Path

Creates a fan path.

Parameters

NameTypeDescription
centervec2The center of the fan
innerRadiusnumberThe inner radius of the fan
outerRadiusnumberThe outer radius of the fan
startAnglenumberThe start angle in radians
endAnglenumberThe end angle in radians

Returns

Path

The newly created path

Example

Defined in

Path.ts:742open in new window


formula

formula(f, iter, «destructured»?): Path

Creates a path from the given formula, which maps a parameter t to a point. The tangent will be automatically calculated by the derivative function, which is computed using Euler’s method with given delta. If the formula has cusps, you need to appropriately specify the range to put t at the cusp.

Parameters

NameTypeDescription
f(t: number) => vec2The formula to create the path
iterIterable<number>-
«destructured»FormulaOptions-

Returns

Path

The newly created path

Defined in

Path.ts:1062open in new window


fromSegment

fromSegment(segment): Path

Creates an open path consist of only a single command.

Parameters

NameTypeDescription
segmentSegmentThe segment to create

Returns

Path

The newly created path

Defined in

Path.ts:1019open in new window


grid

grid(rect, divs): PathL

Parameters

NameType
rectRect
divsvec2

Returns

PathL

Defined in

Path.ts:885open in new window


halfLine

halfLine(point, through, distance?): Path

Creates a half-lineopen in new window, infinite line in one direction from a starting point and a point that the line passes through. It is not actually an inifinite, but one with a very large length.

Parameters

NameTypeDefault valueDescription
pointvec2undefinedThe starting point
throughvec2undefinedThe point that the line passes through
distancenumber1e8The length of the half-line

Returns

Path

The half-line path

Defined in

Path.ts:335open in new window


infiniteLine

infiniteLine(point0, point1, distance?): Path

Creates an infinite line path from the given two points. Unlike line, the line will be drawn nearly infinitely in both directions.

Parameters

NameTypeDefault valueDescription
point0vec2undefinedThe first point
point1vec2undefinedThe second point
distancenumber1e8The length of the infinite line for each direction

Returns

Path

The infinite line path

Defined in

Path.ts:316open in new window


line

line(start, end): PathL

Creates a linear path from two points describing a line.

Parameters

NameTypeDescription
startvec2The line’s starting point
endvec2The line’s ending point

Returns

PathL

The newly created path

Example

Defined in

Path.ts:767open in new window


nBezier

nBezier(points): Path<Vertex>

Create a path consisting of cubic Bézier curves approximating the arbitrary higher-order Bézier curve.

Parameters

NameTypeDescription
pointsvec2[]The control points of the Bézier curve

Returns

Path<Vertex>

The newly created path

Defined in

Path.ts:968open in new window


ngon

ngon(center, radius, sides): PathL

Alias for regularPolygon

Parameters

NameType
centervec2
radiusnumber
sidesnumber

Returns

PathL

Defined in

Path.ts:880open in new window


polygon

polygon(...points): PathL

Creates a closed polyline from the given points.

Parameters

NameTypeDescription
...pointsvec2[]The points describing the polygon

Returns

PathL

The newly created path

Example

Defined in

Path.ts:836open in new window


polyline

polyline(...points): PathL

Creates a open polyline from the given points.

Parameters

NameTypeDescription
...pointsvec2[]The points describing the polygon

Returns

PathL

The newly created path

Example

Defined in

Path.ts:814open in new window


quadraticBezier

quadraticBezier(start, control, point): Path

Creates a quadratic Bézier curve path from the given points.

Parameters

NameTypeDescription
startvec2The start point
controlvec2The control point
pointvec2The end point

Returns

Path

THe newly created path

Defined in

Path.ts:952open in new window


rect

rect(start, end): Path

Alias for rectangle

Parameters

NameType
startvec2
endvec2

Returns

Path

Defined in

Path.ts:194open in new window


rectFromCenter

rectFromCenter(center, size): Path

Creates a rectangle path from the given center and size.

Parameters

NameTypeDescription
centervec2The center of the rectangle
sizevec2The size of the rectangle

Returns

Path

The newly created path

Defined in

Path.ts:203open in new window


rectangle

rectangle(start, end): Path

Creates a rectangle path from the given two points.

Parameters

NameTypeDescription
startvec2The first point defining the rectangle
endvec2The second point defining the rectangle

Returns

Path

The newly created path

Example

Defined in

Path.ts:174open in new window


regularPolygon

regularPolygon(center, radius, sides): PathL

Creates a regular polygon. The first vertex will be placed at the +X axis relative to the center.

Parameters

NameTypeDescription
centervec2The center of the polygon
radiusnumberThe radius of the circumcircle of the polygon
sidesnumberThe number o sides of the polygon

Returns

PathL

The newly created path

Example

Defined in

Path.ts:860open in new window


roundRect

roundRect(start, end, radii): Path

Creates a rounded rectangle. The arguments are almost the same as the CanvasRenderingContext2D’s roundRect method.

Parameters

NameType
startvec2
endvec2
radiinumber | [allCorner: number] | [topLeftAndBottomRight: number, topRightAndBottomLeft: number] | [topLeft: number, topRightAndBottomLeft: number, bottomRight: number] | [topLeft: number, topRight: number, bottomRight: number, bottomLeft: number]

Returns

Path

See

https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/roundRectopen in new window

Defined in

Path.ts:215open in new window


semicircle

semicircle(start, end, closed?): Path

Creates a semicircle path from the given start and end points.

Parameters

NameTypeDefault value
startvec2undefined
endvec2undefined
closedbooleantrue

Returns

Path

Defined in

Path.ts:300open in new window

Properties

area

area(arg): number

Calculates an area of the given path.

Parameters

NameType
argPath<Vertex>

Returns

number

The area of the path

Defined in

Path.ts:1142open in new window


bounds

bounds(arg): Rect

Calculates the bound of the given path.

Parameters

NameType
argPath<Vertex>

Returns

Rect

The rect of the path

Example

Defined in

Path.ts:1132open in new window


derivative

derivative(path, loc): vec2

Calculates the normalized tangent vector of the path at the given location.

Parameters

NameTypeDescription
pathPath<Vertex>The path to calcuate
locPathLocation-

Returns

vec2

The tangent vector

Defined in

Path.ts:1376open in new window


length

length(arg): number

Returns the length of the given path. The returned value is memoized.

Parameters

NameType
argPath<Vertex>

Returns

number

The length of the path

Defined in

Path.ts:1102open in new window


normal

normal(path, loc): vec2

Calculates the normalized tangent vector of the path at the given location.

Parameters

NameTypeDescription
pathPath<Vertex>The path to calcuate
locPathLocation-

Returns

vec2

The tangent vector

Defined in

Path.ts:1400open in new window


orientation

orientation(path, loc): mat2d

Calculates the transformation matrix of the path at the given location. The x-axis of the matrix is the tangent vector and the y-axis is the normal vector, and the translation is the point on the path.

Parameters

NameTypeDescription
pathPath<Vertex>The path to calculate
locPathLocation-

Returns

mat2d

The transformation matrix at the given offset

Defined in

Path.ts:1412open in new window


point

point(path, loc): vec2

Calculates the position on the path at the given location.

Parameters

NameTypeDescription
pathPath<Vertex>The path to calculate
locPathLocationThe location on the path

Returns

vec2

The position at the given offset

Defined in

Path.ts:1364open in new window


segment

segment(path, curveIndex, segmentIndex?): Segment

Returns the segment of the path by indices. If the segmentIndex is omitted, the curveIndex is treated as the linear segment index of the whole path. It also supports negative indices, which count from the end of the path or curve.

Parameters

NameTypeDescription
pathPath<Vertex>The path that contains the segment
curveIndexnumberThe index of the curve.
segmentIndex?numberThe index of the segment in the curve.

Returns

Segment

The segment

Defined in

Path.ts:1167open in new window


segmentCount

segmentCount(arg): number

Returns the count of segments in the given path.

Parameters

NameType
argPath<Vertex>

Returns

number

The count of segments in the path

Defined in

Path.ts:1152open in new window


segments

segments(arg): Segment[]

Returns all segmentse

Parameters

NameType
argPath<Vertex>

Returns

Segment[]

Defined in

Path.ts:2154open in new window


tangent

tangent(path, loc): vec2

Calculates the normalized tangent vector of the path at the given location.

Parameters

NameTypeDescription
pathPath<Vertex>The path to calcuate
locPathLocation-

Returns

vec2

The tangent vector

Defined in

Path.ts:1388open in new window

Modifiers

distort

distort(path, transform, «destructured»?): Path<Vertex>

Distorts path by the given transformation function. It assumes that the continuity of transformation is smooth in the spatial domain and has no singularities or cusps.

Parameters

NameTypeDescription
pathPath<Vertex>The path to distort
transform(position: vec2) => mat2dThe distort function that maps a point coordinate to a transformation matrix. The translation component is absolute, and affects points of Bézier curves. The rotation, scaling, and skewing components affect the orientation of two handles.
«destructured»DistortOptions-

Returns

Path<Vertex>

The newly created path

Example

Defined in

Path.ts:1975open in new window


flatten

flatten(path, flatness?): Path

Flattens the curves in path to straight lines.

Parameters

NameTypeDefault valueDescription
pathPath<Vertex>undefinedThe path to flatten
flatnessnumber0.25The maximum distance between the path and the flattened path

Returns

Path

The flattened path consists of only M, L, and Z commands

See

http://paperjs.org/reference/path/#flattenopen in new window

Example

Defined in

Path.ts:1886open in new window


join

join(paths): Path

Joins the given paths into a single open paths.

Parameters

NameTypeDescription
pathsPath<Vertex>[]The paths to join

Returns

Path

The joined path

Defined in

Path.ts:1849open in new window


merge

merge(pathOrCurves): Path

Merges the given paths into a single path. Unlike join or unite, the vertices are not connected, and it simply returns compound path.

Parameters

NameType
pathOrCurves(Curve | Path<Vertex>)[]

Returns

Path

Defined in

Path.ts:1864open in new window


offset

offset(path, offset, options?): Path

Creates an offset path from the given path.

Parameters

NameTypeDescription
pathPath<Vertex>The path to offset
offsetnumberThe width of offset
options?OffsetOptionsThe options

Returns

Path

The newly created path

Example

Defined in

Path.ts:1786open in new window


offsetStroke

offsetStroke(path, width, options?): Path<Vertex>

Creates an offset path from the given path.

Parameters

NameTypeDescription
pathPath<Vertex>The path to offset
widthnumberThe width of stroke
options?OffsetStrokeOptionsThe options

Returns

Path<Vertex>

The newly created path

Example

Defined in

Path.ts:1825open in new window


reduce

reduce(path, options?): Path

Cleans up the path by removing redundant vertices and

Parameters

NameType
pathPath<Vertex>
optionsReduceOptions

Returns

Path

Defined in

Path.ts:2760open in new window


reverse

reverse(path, options:?): Path

Reverses the given path.

Parameters

NameTypeDescription
pathPath<Vertex>The path to reverse
options:ReverseOptionsThe options

Returns

Path

The reversed path

Defined in

Path.ts:1626open in new window


spawn

spawn(path, fn, «destructured»?): Path

Maps each segments in the path to a path and create a new path concatinating those paths.

Parameters

NameType
pathPath<Vertex>
fn(seg: Segment, segmentIndex: number, curve: Curve) => Path<Vertex>
«destructured»SpawnOptions

Returns

Path

Defined in

Path.ts:1502open in new window


spawnCurve

spawnCurve<V1, V2>(path, fn): Path<V2>

Maps each curves in the path to a single or array of curves and creates a new path concatinating those curves. Unlike spawnVertex, you can also change the number of curves, or open/close state of the curves.

Type parameters

NameType
V1extends Vertex = Vertex
V2extends Vertex = Vertex

Parameters

NameTypeDescription
pathPath<V1>The path to map
fn(curve: Curve<V1>, curveIndex: number) => Curve<V2> | Curve<V2>[]The curve mapping function.

Returns

Path<V2>

The newly created path

Defined in

Path.ts:1478open in new window


spawnVertex

spawnVertex<V1, V2>(path, fn): Path<V2>

Maps each segment in the path to a single or array of vertices and creates a new path concatinating those vertices. you can change the type of commands, and change the number of them in the path, but you cannot change the topology of the path. The segments that were originally continuous remains connected, and vice versa.

Type parameters

NameType
V1extends Vertex = Vertex
V2extends Vertex = Vertex

Parameters

NameTypeDescription
pathPath<V1>The path to map
fn(segment: Segment<V1>, index: number, curve: Curve) => V2 | V2[]The vertex mapping function. It takes a Segment and returns a single or array of vertices.

Returns

Path<V2>

The newly created path

Defined in

Path.ts:1424open in new window


split

split(path, locs): Path[]

Splits the path into multiple paths at the given locations.

Parameters

NameTypeDescription
pathPath<Vertex>The path to split
locsIterable<PathLocation>The locations to split

Returns

Path[]

The splitted paths

Defined in

Path.ts:1932open in new window


subdivide

subdivide(path, division): Path

Subdivides each segment in the path into specific number of sub-segments.

Parameters

NameTypeDescription
pathPath<Vertex>The path to subdivide
divisionnumberThe number of division for each segment

Returns

Path

The newly created path

Defined in

Path.ts:1899open in new window


toCubicBezier

toCubicBezier(path, unarcAngle?): PathC

Converts all commands in the path to cubic Bézier curve commands.

Parameters

NameTypeDefault valueDescription
pathPath<Vertex>undefinedThe path to convert
unarcAnglenumber90The angle step for approximating arc commands with cubic Béziers

Returns

PathC

The new path with only cubic Bézier curve commands

Defined in

Path.ts:1733open in new window


transform

transform(path, matrix): Path

Transforms the given path by the given matrix.

Parameters

NameTypeDescription
pathPath<Vertex>The path to transform
matrixmat2dThe matrix to transform the path by

Returns

Path

The transformed path

Defined in

Path.ts:1589open in new window


trim

trim(path, from, to, crossFirstPoint?): Path

Trims the path from the given location to the given location.

Parameters

NameTypeDefault valueDescription
pathPath<Vertex>undefinedThe path to trim
fromPathLocationundefinedThe start location
toPathLocationundefinedThe end location
crossFirstPointbooleantrue-

Returns

Path

The trimmed path

Defined in

Path.ts:1643open in new window


unarc

unarc(path, angle?): UnarcPath

Parameters

NameTypeDefault value
pathPath<Vertex>undefined
anglenumber90

Returns

UnarcPath

Example

Defined in

Path.ts:1716open in new window

Boolean Operations

subtract

subtract(subject, tools): Path

Subtracts the tools from the subject.

Parameters

NameTypeDescription
subjectPath<Vertex>The target path to be subtracted
toolsPath<Vertex>[]The paths to subtract

Returns

Path

The resulting path

Defined in

Path.ts:2021open in new window


unite

unite(paths): Path

Unites the given paths.

Parameters

NameTypeDescription
pathsPath<Vertex>[]The paths to unite

Returns

Path

The resulting path

Defined in

Path.ts:2003open in new window

Converters

drawToCanvas

drawToCanvas(path, context): void

Draws the given path to the context. It calls context.beginPath at the beginning, so please note that the sub-paths already stacked on the context are also cleared. Note that you also need to call context.stroke or context.fill to actually draw the path.

Parameters

NameTypeDescription
pathPath<Vertex>The path to draw
contextCanvasRenderingContext2D | OffscreenCanvasRenderingContext2DThe Canvas context

Returns

void

Defined in

Path.ts:2443open in new window


fromPaperPath

fromPaperPath(arg): Path<Vertex>

Creates a path from the given paper.Path instance.

Parameters

NameType
argPathItem

Returns

Path<Vertex>

The newly created path

Paper Path

The paper.Path instance to convert

Defined in

Path.ts:2527open in new window


fromSVG

fromSVG(commands): Path

Converts an array of SVG commands to a Path.

Parameters

NameTypeDescription
commandsSVGCommand[]The array of SVG commands

Returns

Path

The newly created path

Defined in

Path.ts:2164open in new window


fromSVGString

fromSVGString(d): Path

Parses the given d attribute of an SVG path and creates a new path. Internally uses svgpathopen in new window library.

Parameters

NameTypeDescription
dstringThe d attribute of an SVG path

Returns

Path

The newly created path

Defined in

Path.ts:2041open in new window


toPaperPath

toPaperPath(arg): Path | CompoundPath

Converts the given path to paper.Path

Parameters

NameType
argPath<Vertex>

Returns

Path | CompoundPath

The newly created paper.Path instance

See

http://paperjs.org/reference/pathitem/open in new window

Defined in

Path.ts:2458open in new window


toPath2D

toPath2D(arg): Path2D

Creates a Path2D instance with the given path data.

Parameters

NameType
argPath<Vertex>

Returns

Path2D

The newly created Path2D

Defined in

Path.ts:2429open in new window


toSVGString

toSVGString(path): string

Converts the given path to a string that can be used as the d attribute of an SVG path element.

Parameters

NameTypeDescription
pathPath<Vertex>The path to convert

Returns

string

The string for the d attribute of the SVG path element

Defined in

Path.ts:2089open in new window

Draw Functions

addVertex

addVertex(path, vertex): Path

Appends the given command to the end of the path.

Parameters

NameTypeDescription
pathPath<Vertex>The base path
vertexVertex-

Returns

Path

The newely created path

Defined in

Path.ts:2594open in new window


arcTo

arcTo(path, radii, xAxisRotation, largeArcFlag, sweepFlag, point): Path

Returns the new path with the new A (arc) command at the end.

Parameters

NameTypeDescription
pathPath<Vertex>The base path
radiivec2The radii of the ellipse used to draw the arc
xAxisRotationnumberThe rotation angle of the ellipse’s x-axis relative to the x-axis of the current coordinate system, expressed in degrees
largeArcFlagbooleanThe large arc flag. If true, then draw the arc spanning greather than 180 degrees. Otherwise, draw the arc spanning less than 180 degrees.
sweepFlagbooleanThe sweep flag. If true, then draw the arc in a “positive-angle” direction in the current coordinate system. Otherwise, draw it in a “negative-angle” direction.
pointvec2The end point of the arc

Returns

Path

The newely created path

Defined in

Path.ts:2692open in new window


close

close(path, «destructured»?): Path

Closes the specified curves

Parameters

NameTypeDescription
pathPath<Vertex>The base path
«destructured»PathCloseOptions-

Returns

Path

The newely created path

Defined in

Path.ts:2730open in new window


cubicBezierTo

cubicBezierTo(path, control1, control2, point): Path

Returns the new path with the new C (cubic Bézier curve) command at the end.

Parameters

NameTypeDescription
pathPath<Vertex>The base path
control1vec2The first control point
control2vec2The second control point
pointvec2The end point

Returns

Path

The newely created path

Defined in

Path.ts:2639open in new window


lineTo

lineTo(path, point): Path

Returns the new path with the new L (line-to) command at the end.

Parameters

NameTypeDescription
pathPath<Vertex>The base path
pointvec2The point to draw a line to

Returns

Path

The newely created path

Defined in

Path.ts:2626open in new window


moveTo

moveTo(path, point): Path

Returns the new path with the new M (move-to) command at the end.

Parameters

NameTypeDescription
pathPath<Vertex>The base path
pointvec2The point to move to

Returns

Path

The newely created path

Defined in

Path.ts:2574open in new window


pen

pen(): Pen

Creates a new Path instance to begin drawing a path.

Returns

Pen

Defined in

Path.ts:2776open in new window


quadraticBezierTo

quadraticBezierTo(path, control, point): Path

Returns the new path with the new Q (quadratic Bézier curve) command at the end.

Parameters

NameTypeDescription
pathPath<Vertex>The base path
controlvec2The control point
pointvec2The end point

Returns

Path

The newely created path

Defined in

Path.ts:2660open in new window

Utilities

toTime

toTime(path, location): Required<TimePathLocation> & { segment: Segment }

Retrieves the segment location information from the given path and path-based signed location.

Parameters

NameTypeDescription
pathPath<Vertex>The path to retrieve the segment location
locationPathLocationThe path-based location

Returns

Required<TimePathLocation> & { segment: Segment }

The information of the segment location

Defined in

Path.ts:1215open in new window


unlinearSegmentIndex

unlinearSegmentIndex(path, linearSegmentIndex): Object

Converts a signed linear segment index to a pair of curve and unsgined segment index.

Parameters

NameType
pathPath<Vertex>
linearSegmentIndexnumber

Returns

Object

NameType
curveIndexnumber
segmentIndexnumber

Defined in

Path.ts:1333open in new window

Aliases

fromD

fromD(d): Path

Alias for fromSVGString

Parameters

NameType
dstring

Returns

Path

Defined in

Path.ts:2081open in new window


subdiv

subdiv(path, division): Path

Alias for subdivide

Parameters

NameType
pathPath<Vertex>
divisionnumber

Returns

Path

Defined in

Path.ts:1923open in new window


toC

toC(path, unarcAngle?): PathC

Alias for toCubicBezier

Parameters

NameTypeDefault value
pathPath<Vertex>undefined
unarcAnglenumber90

Returns

PathC

Defined in

Path.ts:1751open in new window


toD

toD(path): string

Alias for toSVGString

Parameters

NameType
pathPath<Vertex>

Returns

string

Defined in

Path.ts:2147open in new window

Options

ArcOptions

Ƭ ArcOptions: Object

An options for arc

Type declaration

NameTypeDescription
align?ResampleOptions["align"]The alignment of the vertices Default ts 'uniform'
count?numberThe total count of the segments in the arc. If this is specified, the step will be ignored and the arc will be deviced into the specified number of segments uniformly.
step?numberThe maximum angle step in degrees Default 360 - 1e-4

Defined in

Path.ts:496open in new window


PathCloseOptions

Ƭ PathCloseOptions: Object

An options for close

Type declaration

NameTypeDescription
fuse?booleanIf true, deletes overwrapped first and last vertices. Default ts true
group?CurveGroupSpecifies which curves to close. Default is the last curve. Default ts -1

Defined in

Path.ts:2711open in new window


ReduceOptions

Ƭ ReduceOptions: ReduceOptions & { removeEmptyCurves?: boolean }

An options for reduce

Defined in

Path.ts:2747open in new window