UNPKG

@bitbybit-dev/core

Version:

Bit By Bit Developers Core CAD API to Program Geometry

56 lines (55 loc) 2.04 kB
import { ContextBase } from "../context"; import { GeometryHelper } from "@bitbybit-dev/base"; import * as Inputs from "../inputs/inputs"; /** * Contains various methods for polyline. Polyline in bitbybit is a simple object that has points property containing an array of points. * { points: number[][] } */ export declare class Polyline { private readonly context; private readonly geometryHelper; constructor(context: ContextBase, geometryHelper: GeometryHelper); /** * Converts a polyline to a NURBS curve * Returns the verbnurbs NurbsCurve object * @param inputs Polyline to be transformed to curve * @returns Verb nurbs curve */ convertToNurbsCurve(inputs: Inputs.Polyline.PolylineDto): any; /** * Gets the length of the polyline * @param inputs Polyline to be queried * @returns Length of the polyline */ length(inputs: Inputs.Polyline.PolylineDto): number; /** * Gets the number of points in the polyline * @param inputs Polyline to be queried * @returns Number of points in polyline */ countPoints(inputs: Inputs.Polyline.PolylineDto): number; /** * Gets the points of the polyline * @param inputs Polyline to be queried * @returns Points of the polyline */ getPoints(inputs: Inputs.Polyline.PolylineDto): number[][]; /** * Reverse the points of the polyline * @param inputs Polyline to be reversed * @returns Reversed polyline */ reverse(inputs: Inputs.Polyline.PolylineDto): Inputs.Polyline.PolylinePropertiesDto; /** * Transform the polyline * @param inputs Polyline to be transformed * @returns Transformed polyline */ transformPolyline(inputs: Inputs.Polyline.TransformPolylineDto): Inputs.Polyline.PolylinePropertiesDto; /** * Create the polyline * @param inputs Points of the polyline * @returns Polyline */ create(inputs: Inputs.Polyline.PolylinePropertiesDto): Inputs.Polyline.PolylinePropertiesDto; }