curves
import {...} from "@canvas-commons/2d/lib/curves";
Classes
Interfaces
Type Aliases
KnotAutoHandles
type KnotAutoHandles
Properties
end
end: number
start
start: number
Functions
getBezierSplineProfile
public getBezierSplineProfileknots: KnotInfo[]closed: booleansmoothness: number: CurveProfile
Calculate the curve profile of a spline based on a set of knots.
Parameters
knots: KnotInfo[]The knots defining the spline
closed: booleanWhether the spline should be closed or not
smoothness: numberThe desired smoothness of the spline when using auto calculated handles.
getCircleProfile
public getCircleProfilesize: Vector2startAngle: numberendAngle: numberclosed: booleancounterclockwise: boolean = false: CurveProfile
Parameters
size: Vector2startAngle: numberendAngle: numberclosed: booleancounterclockwise: boolean = false
getPointAtDistance
Parameters
getPolylineProfile
Parameters
getRectProfile
public getRectProfilerect: BBoxradius: SpacingsmoothCorners: booleancornerSharpness: number: CurveProfile
Parameters
rect: BBoxradius: SpacingsmoothCorners: booleancornerSharpness: number
profileToSVGPathData
public profileToSVGPathDataprofile: CurveProfile: string
Convert a curve profile to SVG path data.
Parameters
profile: CurveProfileThe curve profile to convert