import { vec2 } from 'linearly'; import { SegmentLocation } from './Location.js'; import { Path, VertexC } from './Path.js'; import { SegmentC } from './Segment.js'; import { PartialBy } from './utils.js'; /** * Almost equivalent to {@link SegmentC}, but the redundant `command` field can be ommited. Used for the argument of CubicBezier functions. */ type SimpleSegmentC = PartialBy; /** * A collection of functions to handle a cubic bezier represented with {@link SimpleSegment}. * @category Modules */ export declare namespace CubicBezier { function of(start: vec2, control1: vec2, control2: vec2, point: vec2): { command: string; start: vec2; args: vec2[]; point: vec2; }; const toPaperBezier: (arg: SimpleSegmentC) => paper.Curve; function fromQuadraticBezier(start: vec2, control: vec2, point: vec2): SegmentC; /** * Calculates the length of the Bezier curve. Length is calculated using numerical approximation, specifically the Legendre-Gauss quadrature algorithm. */ const length: (arg: SimpleSegmentC) => number; /** * Calculates the rect of this Bezier curve. */ const bounds: (arg: SimpleSegmentC) => [vec2, vec2]; function toTime(bezier: SimpleSegmentC, loc: SegmentLocation): number; /** * Calculates the point on the curve at the specified `t` value. */ function point(bezier: SimpleSegmentC, loc: SegmentLocation): vec2; /** * Calculates the curve tangent at the specified `t` value. Note that this yields a not-normalized vector. */ function derivative(bezier: SimpleSegmentC, loc: SegmentLocation): vec2; /** * Calculates the curve tangent at the specified `t` value. Unlike {@link derivative}, this yields a normalized vector. */ function tangent(bezier: SimpleSegmentC, loc: SegmentLocation): vec2; /** * Calculates the curve normal at the specified `t` value. Note that this yields a normalized vector. */ function normal(bezier: SimpleSegmentC, loc: SegmentLocation): vec2; /** * Finds the on-curve point closest to the specific off-curve point */ function project(bezier: SimpleSegmentC, origin: vec2): { position: vec2; t?: number; distance?: number; }; function trim(bezier: SimpleSegmentC, start: SegmentLocation, end: SegmentLocation): SegmentC; function divideAtTimes(segment: SimpleSegmentC, times: Iterable): VertexC[]; function isZero(bezier: SimpleSegmentC): boolean; function isStraight(bezier: SimpleSegmentC): boolean; function offset(bezier: SimpleSegmentC, distance: number): Path; } export {}; //# sourceMappingURL=CubicBezier.d.ts.map