/** * @classdesc A HobbyCurve/HobbyPath calculation class: compute a set of optimal * cubic Bézier curves from a sequence of vertices. * * This Hobby curve (path) implementation was strongly inspired by * the one by Prof. Dr. Edmund Weitz: * Here's the website: * http://weitz.de/hobby/ * * @date 2020-04-07 * @author Transformed to a JS-class by Ikaros Kappler * @modified 2020-08-19 Ported from vanilla JS to TypeScript. * @version 1.0.1 * * @file HobbyPath * @public **/ import { CubicBezierCurve } from "../../CubicBezierCurve"; import { Vertex } from "../../Vertex"; /** * @classdesc A HobbyCurve/HobbyPath calculation class: compute a set of optimal * cubic Bézier curves from a sequence of vertices. * * @requires CubicBezierCurve * @requires Vertex */ export declare class HobbyPath { /** * @member {Array} vertices * @memberof HobbyPath * @type {Array} * @instance **/ private vertices; /** * @constructor * @name HobbyPath * @param {Array=} vertices? - An optional array of vertices to initialize the path with. **/ constructor(vertices?: Array); /** * Add a new point to the end of the vertex sequence. * * @name addPoint * @memberof HobbyPath * @instance * @param {Vertex} p - The vertex (point) to add. **/ addPoint(p: Vertex): void; /** * Generate a sequence of cubic Bézier curves from the point set. * * @name generateCurve * @memberof HobbyPath * @instance * @param {boolean=} circular - Specify if the path should be closed. * @param {number=0} omega - (default=0) An optional tension parameter. * @return Array **/ generateCurve(circular?: boolean, omega?: number): Array; /** * Computes the control point coordinates for a Hobby curve through * the points given. * * @name hobbyControls * @memberof HobbyPath * @instance * @param {boolean} circular - If true, then the path will be closed. * @param {number=0} omega - The 'curl' or the path. * @return {IControlPoints} An object with two members: startControlPoints and endControlPoints (Array). **/ private hobbyControls; static utils: { rotate: (vert: Vertex, sin: number, cos: number) => Vertex; rotateAngle: (vert: Vertex, alpha: number) => Vertex; normalize: (vec: Vertex) => Vertex; rho: (a: number, b: number) => number; thomas: (a: Array, b: Array, c: Array, d: Array) => Array; sherman: (a: Array, b: Array, c: Array, d: Array, s: number, t: number) => Array; }; }