romgrk-2d-geometry
Version:
Javascript library for 2d geometry
50 lines • 1.21 kB
TypeScript
import { Arc } from './Arc';
import { Box } from './Box';
import { Matrix } from './Matrix';
import { Point } from './Point';
import { Segment } from './Segment';
import { Shape } from './Shape';
type Part = Segment | Arc;
/**
* Class representing a path
*/
export declare class Path extends Shape<Path> {
static EMPTY: Readonly<Path>;
static fromPoints(points: Point[]): Path;
parts: Part[];
private _length;
private _box;
constructor(parts: Part[]);
clone(): Path;
/**
* The total path length
*/
get length(): number;
/**
* Path center
*/
get center(): Point;
/**
* The bounding box
*/
get box(): Box;
/**
* Return new segment transformed using affine transformation matrix
*/
transform(matrix?: Matrix): Path;
/**
* Point at a distance along the path.
*/
getPointAtLength(length: number): Point;
/**
* Slice path at lengths `start` and `end`, returning a new path.
*/
slice(start: number, end: number): Path;
/**
* Get the SVGPath "d" attribute
*/
toSVG(): string;
svg(attrs?: Record<any, any>): string;
}
export {};
//# sourceMappingURL=Path.d.ts.map