@baku89/pave - v0.4.1 / Path
Namespace: Path
Functions for manipulating paths represented as Path.
Classes
Interfaces
- CircleFromPointsOptions
- DistortOptions
- FormulaOptions
- OffsetOptions
- OffsetStrokeOptions
- ReverseOptions
- SpawnOptions
Primitives
arc
▸ arc(center
, radius
, startAngle
, endAngle
, options?
): Path
Creates an arc path.
Parameters
Name | Type | Description |
---|---|---|
center | vec2 | The center of the arc |
radius | number | The radius of the arc |
startAngle | number | The start angle in radians |
endAngle | number | The end angle in radians |
options | ArcOptions | - |
Returns
The newly created path
Example
Defined in
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
Name | Type | Description |
---|---|---|
start | vec2 | The start point |
through | vec2 | The point that the arc passes through |
end | vec2 | The end point |
Returns
The newly created path
Defined in
arcByPointsAngle
▸ arcByPointsAngle(start
, end
, angle
): Path
<Vertex
>
Creates an arc path from two points and an angle.
Parameters
Name | Type | Description |
---|---|---|
start | vec2 | The start point |
end | vec2 | The end point |
angle | number | The 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
The newly created path
Defined in
arcByPointsTangent
▸ arcByPointsTangent(start
, startTangent
, end
): Path
Creates an arc path from start point, start tangent, and end point.
Parameters
Name | Type | Description |
---|---|---|
start | vec2 | The start point |
startTangent | vec2 | The tangent at the start point |
end | vec2 | The end point |
Returns
A newly created open arc path
Defined in
circle
▸ circle(center
, radius
): Path
Creates a circle path from the given center and radius.
Parameters
Name | Type | Description |
---|---|---|
center | vec2 | The center of the circle |
radius | number | The radius of the circle |
Returns
The newly created path
Example
Defined in
circleFromPoints
▸ circleFromPoints(p1
, p2?
, p3?
, «destructured»?
): Path
Creates a circle path which passes through the given points.
Parameters
Name | Type | Description |
---|---|---|
p1 | vec2 | The first point |
p2? | null | vec2 | The second point |
p3? | null | vec2 | The third point |
«destructured» | CircleFromPointsOptions | - |
Returns
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
cubicBezier
▸ cubicBezier(start
, control1
, control2
, point
): Path
Creates a path consisting of a single C command.
Parameters
Name | Type | Description |
---|---|---|
start | vec2 | The start point |
control1 | vec2 | The first control point |
control2 | vec2 | The second control point |
point | vec2 | The end point |
Returns
The newly created path
Defined in
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
Name | Type | Description |
---|---|---|
point | vec2 | The center point of the dot |
Returns
The newly created paths
Example
Defined in
ellipse
▸ ellipse(center
, radius
): Path
Creates an ellipse path from the given center and radius.
Parameters
Name | Type | Description |
---|---|---|
center | vec2 | The center of the ellipse |
radius | vec2 | The radius of the ellipse |
Returns
The newly created path
Example
Defined in
empty
• Const
empty: Path
Empty path.
Defined in
fan
▸ fan(center
, innerRadius
, outerRadius
, startAngle
, endAngle
): Path
Creates a fan path.
Parameters
Name | Type | Description |
---|---|---|
center | vec2 | The center of the fan |
innerRadius | number | The inner radius of the fan |
outerRadius | number | The outer radius of the fan |
startAngle | number | The start angle in radians |
endAngle | number | The end angle in radians |
Returns
The newly created path
Example
Defined in
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
Name | Type | Description |
---|---|---|
f | (t : number ) => vec2 | The formula to create the path |
iter | Iterable <number > | - |
«destructured» | FormulaOptions | - |
Returns
The newly created path
Defined in
fromSegment
▸ fromSegment(segment
): Path
Creates an open path consist of only a single command.
Parameters
Name | Type | Description |
---|---|---|
segment | Segment | The segment to create |
Returns
The newly created path
Defined in
grid
▸ grid(rect
, divs
): PathL
Parameters
Name | Type |
---|---|
rect | Rect |
divs | vec2 |
Returns
Defined in
halfLine
▸ halfLine(point
, through
, distance?
): Path
Creates a half-line, 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
Name | Type | Default value | Description |
---|---|---|---|
point | vec2 | undefined | The starting point |
through | vec2 | undefined | The point that the line passes through |
distance | number | 1e8 | The length of the half-line |
Returns
The half-line path
Defined in
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
Name | Type | Default value | Description |
---|---|---|---|
point0 | vec2 | undefined | The first point |
point1 | vec2 | undefined | The second point |
distance | number | 1e8 | The length of the infinite line for each direction |
Returns
The infinite line path
Defined in
line
▸ line(start
, end
): PathL
Creates a linear path from two points describing a line.
Parameters
Name | Type | Description |
---|---|---|
start | vec2 | The line’s starting point |
end | vec2 | The line’s ending point |
Returns
The newly created path
Example
Defined in
nBezier
▸ nBezier(points
): Path
<Vertex
>
Create a path consisting of cubic Bézier curves approximating the arbitrary higher-order Bézier curve.
Parameters
Name | Type | Description |
---|---|---|
points | vec2 [] | The control points of the Bézier curve |
Returns
The newly created path
Defined in
ngon
▸ ngon(center
, radius
, sides
): PathL
Alias for regularPolygon
Parameters
Name | Type |
---|---|
center | vec2 |
radius | number |
sides | number |
Returns
Defined in
polygon
▸ polygon(...points
): PathL
Creates a closed polyline from the given points.
Parameters
Name | Type | Description |
---|---|---|
...points | vec2 [] | The points describing the polygon |
Returns
The newly created path
Example
Defined in
polyline
▸ polyline(...points
): PathL
Creates a open polyline from the given points.
Parameters
Name | Type | Description |
---|---|---|
...points | vec2 [] | The points describing the polygon |
Returns
The newly created path
Example
Defined in
quadraticBezier
▸ quadraticBezier(start
, control
, point
): Path
Creates a quadratic Bézier curve path from the given points.
Parameters
Name | Type | Description |
---|---|---|
start | vec2 | The start point |
control | vec2 | The control point |
point | vec2 | The end point |
Returns
THe newly created path
Defined in
rect
▸ rect(start
, end
): Path
Alias for rectangle
Parameters
Name | Type |
---|---|
start | vec2 |
end | vec2 |
Returns
Defined in
rectFromCenter
▸ rectFromCenter(center
, size
): Path
Creates a rectangle path from the given center and size.
Parameters
Name | Type | Description |
---|---|---|
center | vec2 | The center of the rectangle |
size | vec2 | The size of the rectangle |
Returns
The newly created path
Defined in
rectangle
▸ rectangle(start
, end
): Path
Creates a rectangle path from the given two points.
Parameters
Name | Type | Description |
---|---|---|
start | vec2 | The first point defining the rectangle |
end | vec2 | The second point defining the rectangle |
Returns
The newly created path
Example
Defined in
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
Name | Type | Description |
---|---|---|
center | vec2 | The center of the polygon |
radius | number | The radius of the circumcircle of the polygon |
sides | number | The number o sides of the polygon |
Returns
The newly created path
Example
Defined in
roundRect
▸ roundRect(start
, end
, radii
): Path
Creates a rounded rectangle. The arguments are almost the same as the CanvasRenderingContext2D’s roundRect
method.
Parameters
Name | Type |
---|---|
start | vec2 |
end | vec2 |
radii | number | [allCorner: number] | [topLeftAndBottomRight: number, topRightAndBottomLeft: number] | [topLeft: number, topRightAndBottomLeft: number, bottomRight: number] | [topLeft: number, topRight: number, bottomRight: number, bottomLeft: number] |
Returns
See
https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/roundRect
Defined in
semicircle
▸ semicircle(start
, end
, closed?
): Path
Creates a semicircle path from the given start and end points.
Parameters
Name | Type | Default value |
---|---|---|
start | vec2 | undefined |
end | vec2 | undefined |
closed | boolean | true |
Returns
Defined in
Properties
area
▸ area(arg
): number
Calculates an area of the given path.
Parameters
Name | Type |
---|---|
arg | Path <Vertex > |
Returns
number
The area of the path
Defined in
bounds
▸ bounds(arg
): Rect
Calculates the bound of the given path.
Parameters
Name | Type |
---|---|
arg | Path <Vertex > |
Returns
The rect of the path
Example
Defined in
derivative
▸ derivative(path
, loc
): vec2
Calculates the normalized tangent vector of the path at the given location.
Parameters
Name | Type | Description |
---|---|---|
path | Path <Vertex > | The path to calcuate |
loc | PathLocation | - |
Returns
vec2
The tangent vector
Defined in
length
▸ length(arg
): number
Returns the length of the given path. The returned value is memoized.
Parameters
Name | Type |
---|---|
arg | Path <Vertex > |
Returns
number
The length of the path
Defined in
normal
▸ normal(path
, loc
): vec2
Calculates the normalized tangent vector of the path at the given location.
Parameters
Name | Type | Description |
---|---|---|
path | Path <Vertex > | The path to calcuate |
loc | PathLocation | - |
Returns
vec2
The tangent vector
Defined in
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
Name | Type | Description |
---|---|---|
path | Path <Vertex > | The path to calculate |
loc | PathLocation | - |
Returns
mat2d
The transformation matrix at the given offset
Defined in
point
▸ point(path
, loc
): vec2
Calculates the position on the path at the given location.
Parameters
Name | Type | Description |
---|---|---|
path | Path <Vertex > | The path to calculate |
loc | PathLocation | The location on the path |
Returns
vec2
The position at the given offset
Defined in
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
Name | Type | Description |
---|---|---|
path | Path <Vertex > | The path that contains the segment |
curveIndex | number | The index of the curve. |
segmentIndex? | number | The index of the segment in the curve. |
Returns
The segment
Defined in
segmentCount
▸ segmentCount(arg
): number
Returns the count of segments in the given path.
Parameters
Name | Type |
---|---|
arg | Path <Vertex > |
Returns
number
The count of segments in the path
Defined in
segments
▸ segments(arg
): Segment
[]
Returns all segmentse
Parameters
Name | Type |
---|---|
arg | Path <Vertex > |
Returns
Segment
[]
Defined in
tangent
▸ tangent(path
, loc
): vec2
Calculates the normalized tangent vector of the path at the given location.
Parameters
Name | Type | Description |
---|---|---|
path | Path <Vertex > | The path to calcuate |
loc | PathLocation | - |
Returns
vec2
The tangent vector
Defined in
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
Name | Type | Description |
---|---|---|
path | Path <Vertex > | The path to distort |
transform | (position : vec2 ) => mat2d | The 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
The newly created path
Example
Defined in
flatten
▸ flatten(path
, flatness?
): Path
Flattens the curves in path to straight lines.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
path | Path <Vertex > | undefined | The path to flatten |
flatness | number | 0.25 | The maximum distance between the path and the flattened path |
Returns
The flattened path consists of only M, L, and Z commands
See
http://paperjs.org/reference/path/#flatten
Example
Defined in
join
▸ join(paths
): Path
Joins the given paths into a single open paths.
Parameters
Name | Type | Description |
---|---|---|
paths | Path <Vertex >[] | The paths to join |
Returns
The joined path
Defined in
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
Name | Type |
---|---|
pathOrCurves | (Curve | Path <Vertex >)[] |
Returns
Defined in
offset
▸ offset(path
, offset
, options?
): Path
Creates an offset path from the given path.
Parameters
Name | Type | Description |
---|---|---|
path | Path <Vertex > | The path to offset |
offset | number | The width of offset |
options? | OffsetOptions | The options |
Returns
The newly created path
Example
Defined in
offsetStroke
▸ offsetStroke(path
, width
, options?
): Path
<Vertex
>
Creates an offset path from the given path.
Parameters
Name | Type | Description |
---|---|---|
path | Path <Vertex > | The path to offset |
width | number | The width of stroke |
options? | OffsetStrokeOptions | The options |
Returns
The newly created path
Example
Defined in
reduce
▸ reduce(path
, options?
): Path
Cleans up the path by removing redundant vertices and
Parameters
Name | Type |
---|---|
path | Path <Vertex > |
options | ReduceOptions |
Returns
Defined in
reverse
▸ reverse(path
, options:?
): Path
Reverses the given path.
Parameters
Name | Type | Description |
---|---|---|
path | Path <Vertex > | The path to reverse |
options: | ReverseOptions | The options |
Returns
The reversed path
Defined in
spawn
▸ spawn(path
, fn
, «destructured»?
): Path
Maps each segments in the path to a path and create a new path concatinating those paths.
Parameters
Name | Type |
---|---|
path | Path <Vertex > |
fn | (seg : Segment , segmentIndex : number , curve : Curve ) => Path <Vertex > |
«destructured» | SpawnOptions |
Returns
Defined in
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
Name | Type |
---|---|
V1 | extends Vertex = Vertex |
V2 | extends Vertex = Vertex |
Parameters
Name | Type | Description |
---|---|---|
path | Path <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
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
Name | Type |
---|---|
V1 | extends Vertex = Vertex |
V2 | extends Vertex = Vertex |
Parameters
Name | Type | Description |
---|---|---|
path | Path <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
split
▸ split(path
, locs
): Path
[]
Splits the path into multiple paths at the given locations.
Parameters
Name | Type | Description |
---|---|---|
path | Path <Vertex > | The path to split |
locs | Iterable <PathLocation > | The locations to split |
Returns
Path
[]
The splitted paths
Defined in
subdivide
▸ subdivide(path
, division
): Path
Subdivides each segment in the path into specific number of sub-segments.
Parameters
Name | Type | Description |
---|---|---|
path | Path <Vertex > | The path to subdivide |
division | number | The number of division for each segment |
Returns
The newly created path
Defined in
toCubicBezier
▸ toCubicBezier(path
, unarcAngle?
): PathC
Converts all commands in the path to cubic Bézier curve commands.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
path | Path <Vertex > | undefined | The path to convert |
unarcAngle | number | 90 | The angle step for approximating arc commands with cubic Béziers |
Returns
The new path with only cubic Bézier curve commands
Defined in
transform
▸ transform(path
, matrix
): Path
Transforms the given path by the given matrix.
Parameters
Name | Type | Description |
---|---|---|
path | Path <Vertex > | The path to transform |
matrix | mat2d | The matrix to transform the path by |
Returns
The transformed path
Defined in
trim
▸ trim(path
, from
, to
, crossFirstPoint?
): Path
Trims the path from the given location to the given location.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
path | Path <Vertex > | undefined | The path to trim |
from | PathLocation | undefined | The start location |
to | PathLocation | undefined | The end location |
crossFirstPoint | boolean | true | - |
Returns
The trimmed path
Defined in
unarc
▸ unarc(path
, angle?
): UnarcPath
Parameters
Name | Type | Default value |
---|---|---|
path | Path <Vertex > | undefined |
angle | number | 90 |
Returns
UnarcPath
Example
Defined in
Boolean Operations
subtract
▸ subtract(subject
, tools
): Path
Subtracts the tools from the subject.
Parameters
Name | Type | Description |
---|---|---|
subject | Path <Vertex > | The target path to be subtracted |
tools | Path <Vertex >[] | The paths to subtract |
Returns
The resulting path
Defined in
unite
▸ unite(paths
): Path
Unites the given paths.
Parameters
Name | Type | Description |
---|---|---|
paths | Path <Vertex >[] | The paths to unite |
Returns
The resulting path
Defined in
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
Name | Type | Description |
---|---|---|
path | Path <Vertex > | The path to draw |
context | CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D | The Canvas context |
Returns
void
Defined in
fromPaperPath
▸ fromPaperPath(arg
): Path
<Vertex
>
Creates a path from the given paper.Path instance.
Parameters
Name | Type |
---|---|
arg | PathItem |
Returns
The newly created path
Paper Path
The paper.Path instance to convert
Defined in
fromSVG
▸ fromSVG(commands
): Path
Converts an array of SVG commands to a Path.
Parameters
Name | Type | Description |
---|---|---|
commands | SVGCommand [] | The array of SVG commands |
Returns
The newly created path
Defined in
fromSVGString
▸ fromSVGString(d
): Path
Parses the given d attribute of an SVG path and creates a new path. Internally uses svgpath library.
Parameters
Name | Type | Description |
---|---|---|
d | string | The d attribute of an SVG path |
Returns
The newly created path
Defined in
toPaperPath
▸ toPaperPath(arg
): Path
| CompoundPath
Converts the given path to paper.Path
Parameters
Name | Type |
---|---|
arg | Path <Vertex > |
Returns
Path
| CompoundPath
The newly created paper.Path instance
See
http://paperjs.org/reference/pathitem/
Defined in
toPath2D
▸ toPath2D(arg
): Path2D
Creates a Path2D instance with the given path data.
Parameters
Name | Type |
---|---|
arg | Path <Vertex > |
Returns
Path2D
The newly created Path2D
Defined in
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
Name | Type | Description |
---|---|---|
path | Path <Vertex > | The path to convert |
Returns
string
The string for the d attribute of the SVG path element
Defined in
Draw Functions
addVertex
▸ addVertex(path
, vertex
): Path
Appends the given command to the end of the path.
Parameters
Name | Type | Description |
---|---|---|
path | Path <Vertex > | The base path |
vertex | Vertex | - |
Returns
The newely created path
Defined in
arcTo
▸ arcTo(path
, radii
, xAxisRotation
, largeArcFlag
, sweepFlag
, point
): Path
Returns the new path with the new A (arc) command at the end.
Parameters
Name | Type | Description |
---|---|---|
path | Path <Vertex > | The base path |
radii | vec2 | The radii of the ellipse used to draw the arc |
xAxisRotation | number | The rotation angle of the ellipse’s x-axis relative to the x-axis of the current coordinate system, expressed in degrees |
largeArcFlag | boolean | The large arc flag. If true, then draw the arc spanning greather than 180 degrees. Otherwise, draw the arc spanning less than 180 degrees. |
sweepFlag | boolean | The 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. |
point | vec2 | The end point of the arc |
Returns
The newely created path
Defined in
close
▸ close(path
, «destructured»?
): Path
Closes the specified curves
Parameters
Name | Type | Description |
---|---|---|
path | Path <Vertex > | The base path |
«destructured» | PathCloseOptions | - |
Returns
The newely created path
Defined in
cubicBezierTo
▸ cubicBezierTo(path
, control1
, control2
, point
): Path
Returns the new path with the new C (cubic Bézier curve) command at the end.
Parameters
Name | Type | Description |
---|---|---|
path | Path <Vertex > | The base path |
control1 | vec2 | The first control point |
control2 | vec2 | The second control point |
point | vec2 | The end point |
Returns
The newely created path
Defined in
lineTo
▸ lineTo(path
, point
): Path
Returns the new path with the new L (line-to) command at the end.
Parameters
Name | Type | Description |
---|---|---|
path | Path <Vertex > | The base path |
point | vec2 | The point to draw a line to |
Returns
The newely created path
Defined in
moveTo
▸ moveTo(path
, point
): Path
Returns the new path with the new M (move-to) command at the end.
Parameters
Name | Type | Description |
---|---|---|
path | Path <Vertex > | The base path |
point | vec2 | The point to move to |
Returns
The newely created path
Defined in
pen
▸ pen(): Pen
Creates a new Path instance to begin drawing a path.
Returns
Defined in
quadraticBezierTo
▸ quadraticBezierTo(path
, control
, point
): Path
Returns the new path with the new Q (quadratic Bézier curve) command at the end.
Parameters
Name | Type | Description |
---|---|---|
path | Path <Vertex > | The base path |
control | vec2 | The control point |
point | vec2 | The end point |
Returns
The newely created path
Defined in
Utilities
toTime
▸ toTime(path
, location
): Required
<TimePathLocation
> & { segment
: Segment
}
Retrieves the segment location information from the given path and path-based signed location.
Parameters
Name | Type | Description |
---|---|---|
path | Path <Vertex > | The path to retrieve the segment location |
location | PathLocation | The path-based location |
Returns
Required
<TimePathLocation
> & { segment
: Segment
}
The information of the segment location
Defined in
unlinearSegmentIndex
▸ unlinearSegmentIndex(path
, linearSegmentIndex
): Object
Converts a signed linear segment index to a pair of curve and unsgined segment index.
Parameters
Name | Type |
---|---|
path | Path <Vertex > |
linearSegmentIndex | number |
Returns
Object
Name | Type |
---|---|
curveIndex | number |
segmentIndex | number |
Defined in
Aliases
fromD
▸ fromD(d
): Path
Alias for fromSVGString
Parameters
Name | Type |
---|---|
d | string |
Returns
Defined in
subdiv
▸ subdiv(path
, division
): Path
Alias for subdivide
Parameters
Name | Type |
---|---|
path | Path <Vertex > |
division | number |
Returns
Defined in
toC
▸ toC(path
, unarcAngle?
): PathC
Alias for toCubicBezier
Parameters
Name | Type | Default value |
---|---|---|
path | Path <Vertex > | undefined |
unarcAngle | number | 90 |
Returns
Defined in
toD
▸ toD(path
): string
Alias for toSVGString
Parameters
Name | Type |
---|---|
path | Path <Vertex > |
Returns
string
Defined in
Options
ArcOptions
Ƭ ArcOptions: Object
An options for arc
Type declaration
Name | Type | Description |
---|---|---|
align? | ResampleOptions ["align" ] | The alignment of the vertices Default ts 'uniform' |
count? | number | The 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? | number | The maximum angle step in degrees Default 360 - 1e-4 |
Defined in
PathCloseOptions
Ƭ PathCloseOptions: Object
An options for close
Type declaration
Name | Type | Description |
---|---|---|
fuse? | boolean | If true, deletes overwrapped first and last vertices. Default ts true |
group? | CurveGroup | Specifies which curves to close. Default is the last curve. Default ts -1 |
Defined in
ReduceOptions
Ƭ ReduceOptions: ReduceOptions
& { removeEmptyCurves?
: boolean
}
An options for reduce