@baku89/pave / Curve
Curve
A collection of functions to handle Curve.
Interfaces
ReduceOptions
Defined in: Curve.ts:263
Properties
| Property | Type | Description |
|---|---|---|
convertStraightLines? | boolean | If true, the function will convert straight lines to L commands Default true |
Functions
bounds()
bounds(
arg):Rect
Defined in: Curve.ts:50
Parameters
| Parameter | Type |
|---|---|
arg | Curve |
Returns
Rect
close()
close(
curve,fuse):Curve
Defined in: Curve.ts:240
Parameters
| Parameter | Type | Default value |
|---|---|---|
curve | Curve | undefined |
fuse | boolean | true |
Returns
isZero()
isZero(
curve):boolean
Defined in: Curve.ts:311
Parameters
| Parameter | Type |
|---|---|
curve | Curve |
Returns
boolean
length()
length(
arg):number
Defined in: Curve.ts:35
Parameters
| Parameter | Type |
|---|---|
arg | Curve |
Returns
number
neighborSegment()
neighborSegment(
curve,segmentIndex,offset):null|Segment
Defined in: Curve.ts:87
Parameters
| Parameter | Type |
|---|---|
curve | Curve |
segmentIndex | number |
offset | number |
Returns
null | Segment
nextSegment()
nextSegment(
curve,segmentIndex):null|Segment
Defined in: Curve.ts:107
Parameters
| Parameter | Type |
|---|---|
curve | Curve |
segmentIndex | number |
Returns
null | Segment
prevSegment()
prevSegment(
curve,segmentIndex):null|Segment
Defined in: Curve.ts:114
Parameters
| Parameter | Type |
|---|---|
curve | Curve |
segmentIndex | number |
Returns
null | Segment
reduce()
reduce(
curve,__namedParameters):Curve
Defined in: Curve.ts:274
Cleans up the curve by removing redundant vertices and segments
Parameters
| Parameter | Type |
|---|---|
curve | Curve |
__namedParameters | ReduceOptions |
Returns
reverse()
reverse(
curve):Curve
Defined in: Curve.ts:121
Parameters
| Parameter | Type |
|---|---|
curve | Curve |
Returns
segment()
segment(
curve,index):Segment
Defined in: Curve.ts:58
Parameters
| Parameter | Type |
|---|---|
curve | Curve |
index | number |
Returns
segmentCount()
segmentCount(
curve):number
Defined in: Curve.ts:54
Parameters
| Parameter | Type |
|---|---|
curve | Curve |
Returns
number
segments()
segments(
arg):Segment[]
Defined in: Curve.ts:62
Parameters
| Parameter | Type |
|---|---|
arg | Curve |
Returns
Segment[]
toTime()
toTime(
curve,location):Required<TimeCurveLocation> &object
Defined in: Curve.ts:323
Retrieves the segment location information from a signed curve loocation
Parameters
| Parameter | Type | Description |
|---|---|---|
curve | Curve | The cuve to retrieve the segment location from |
location | CurveLocation | The location on the curve |
Returns
Required<TimeCurveLocation> & object
The information of the segment location
trim()
trim(
curve,from,to):Curve
Defined in: Curve.ts:160
Parameters
| Parameter | Type |
|---|---|
curve | Curve |
from | CurveLocation |
to | CurveLocation |