@achirita/blox
Version:
A CAD library for building 3D models in the browser.
17 lines (16 loc) • 777 B
TypeScript
import { Plane, Vector } from '../math';
/**
* Creates a regular polygon based on the specified parameters.
* @param {Object} parameters - The parameters for the regular polygon.
* @param {Plane} [parameters.plane=Plane.XY] - The plane in which the polygon is constructed.
* @param {Vector} [parameters.center=Vector.ZERO] - The center of the polygon.
* @param {number} parameters.radius - The radius of the circumscribed circle of the polygon.
* @param {number} parameters.vertices - The number of vertices of the polygon.
* @returns {Face} A `Face` object representing the constructed regular polygon.
*/
export function RegularPolygon({ plane, center, radius, vertices }: {
plane?: Plane;
center?: Vector;
radius: number;
vertices: number;
}): Face;