pencil.js
Version:
Nice modular interactive 2D drawing library.
50 lines (49 loc) • 1.73 kB
TypeScript
/**
* @module RegularPolygon
*/
/**
* Regular polygon class
* <br><img src="./media/examples/regular-polygon.png" alt="regular-polygon demo"/>
* @class
* @extends Polygon
*/
export default class RegularPolygon extends Polygon {
/**
* @inheritDoc
* @param {Object} definition - Regular polygon definition
* @return {RegularPolygon}
*/
static from(definition: any): RegularPolygon;
/**
* Return positions at regular intervals around a circle
* @param {Number} nbPoints - Number of points
* @param {Number} radius - Distance from origin
* @param {Number} [startAngle=0] - Starting angle of the points (between 0 and 1)
* @param {PositionDefinition} [center] - Relative center of all the points
* @return {Array<Position>}
*/
static getRotatingPoints(nbPoints: number, radius: number, startAngle?: number, center?: any): Array<Position>;
/**
* Regular polygon constructor
* @param {PositionDefinition} position - Center of the polygon
* @param {Number} nbSides - Number of sides
* @param {Number} [radius=0] - Distance between center and outer points
* @param {ComponentOptions} [options] - Drawing options
*/
constructor(position: any, nbSides: number, radius?: number, options?: any);
/**
* Set a new radius
* @param {Number} radius - New radius value
*/
set radius(arg: number);
/**
* Get the current radius
* @return {Number}
*/
get radius(): number;
[radiusKey]: number;
}
import Polygon from "@pencil.js/polygon";
declare const radiusKey: unique symbol;
import Position from "@pencil.js/position";
export {};