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

@baku89/pave v1.0.1


@baku89/pave / Curve

Curve

A collection of functions to handle Curve. Inputs are never mutated; returned curves are new objects unless noted otherwise.

Interfaces

ReduceOptions

Defined in: Curve.ts:265

Properties

PropertyTypeDescription
convertStraightLines?booleanIf true, the function will convert straight lines to L commands Default true

Functions

bounds()

bounds(arg): Rect

Defined in: Curve.ts:19

Parameters

ParameterType
argCurve

Returns

Rect


close()

close(curve, fuse): Curve

Defined in: Curve.ts:241

Parameters

ParameterTypeDefault value
curveCurveundefined
fusebooleantrue

Returns

Curve


isZero()

isZero(curve): boolean

Defined in: Curve.ts:319

Parameters

ParameterType
curveCurve

Returns

boolean


length()

length(arg): number

Defined in: Curve.ts:11

Parameters

ParameterType
argCurve

Returns

number


neighborSegment()

neighborSegment(curve, segmentIndex, offset): null | Segment

Defined in: Curve.ts:60

Parameters

ParameterType
curveCurve
segmentIndexnumber
offsetnumber

Returns

null | Segment


nextSegment()

nextSegment(curve, segmentIndex): null | Segment

Defined in: Curve.ts:80

Parameters

ParameterType
curveCurve
segmentIndexnumber

Returns

null | Segment


prevSegment()

prevSegment(curve, segmentIndex): null | Segment

Defined in: Curve.ts:87

Parameters

ParameterType
curveCurve
segmentIndexnumber

Returns

null | Segment


reduce()

reduce(curve, __namedParameters): Curve

Defined in: Curve.ts:276

Cleans up the curve by removing redundant vertices and segments

Parameters

ParameterType
curveCurve
__namedParametersReduceOptions

Returns

Curve


reverse()

reverse(curve): Curve

Defined in: Curve.ts:94

Parameters

ParameterType
curveCurve

Returns

Curve


segment()

segment(curve, index): Segment

Defined in: Curve.ts:27

Parameters

ParameterType
curveCurve
indexnumber

Returns

Segment


segmentCount()

segmentCount(curve): number

Defined in: Curve.ts:23

Parameters

ParameterType
curveCurve

Returns

number


segments()

segments(arg): Segment[]

Defined in: Curve.ts:31

Parameters

ParameterType
argCurve

Returns

Segment[]


toTime()

toTime(curve, location): Required<TimeCurveLocation> & object

Defined in: Curve.ts:331

Retrieves the segment location information from a signed curve loocation

Parameters

ParameterTypeDescription
curveCurveThe cuve to retrieve the segment location from
locationCurveLocationThe location on the curve

Returns

Required<TimeCurveLocation> & object

The information of the segment location


trim()

trim(curve, from, to, attrDefs?): Curve

Defined in: Curve.ts:153

Parameters

ParameterType
curveCurve
fromCurveLocation
toCurveLocation
attrDefs?Readonly<Record<string, AttributeDef>>

Returns

Curve

Edit this page