@bitbybit-dev/core
Version:
Bit By Bit Developers Core CAD API to Program Geometry
99 lines (98 loc) • 3.6 kB
TypeScript
import { ContextBase } from "../context";
import { GeometryHelper } from "@bitbybit-dev/base";
import * as Inputs from "../inputs";
/**
* Contains various methods for lines. Line in bitbybit is a simple object that has star and end point properties.
* { start: [ x, y, z ], end: [ x, y, z ] }
*/
export declare class Line {
private readonly context;
private readonly geometryHelper;
constructor(context: ContextBase, geometryHelper: GeometryHelper);
/**
* Converts a line to a NURBS line curve
* Returns the verbnurbs Line object
* @param inputs Line to be transformed to curve
* @returns Verb nurbs curve
*/
convertToNurbsCurve(inputs: Inputs.Line.LineDto): any;
/**
* Converts lines to a NURBS curves
* Returns array of the verbnurbs Line objects
* @param inputs Lines to be transformed to curves
* @returns Verb nurbs curves
*/
convertLinesToNurbsCurves(inputs: Inputs.Line.LinesDto): any[];
/**
* Gets the start point of the line
* @param inputs Line to be queried
* @returns Start point
*/
getStartPoint(inputs: Inputs.Line.LineDto): Inputs.Base.Point3;
/**
* Gets the end point of the line
* @param inputs Line to be queried
* @returns End point
*/
getEndPoint(inputs: Inputs.Line.LineDto): Inputs.Base.Point3;
/**
* Gets the length of the line
* @param inputs Line to be queried
* @returns Length of the line
*/
length(inputs: Inputs.Line.LineDto): number;
/**
* Reverse the endpoints of the line
* @param inputs Line to be reversed
* @returns Reversed line
*/
reverse(inputs: Inputs.Line.LineDto): Inputs.Base.Line3;
/**
* Transform the line
* @param inputs Line to be transformed
* @returns Transformed line
*/
transformLine(inputs: Inputs.Line.TransformLineDto): Inputs.Base.Line3;
/**
* Transforms the lines with multiple transform for each line
* @param inputs Lines to be transformed and transformations
* @returns Transformed lines
*/
transformsForLines(inputs: Inputs.Line.TransformsLinesDto): Inputs.Base.Line3[];
/**
* Create the line
* @param inputs Endpoints of the line
* @returns Line
*/
create(inputs: Inputs.Line.LinePointsDto): Inputs.Base.Line3;
/**
* Create the line from possibly async inputs of points
* @param inputs Endpoints of the line
* @returns Line
*/
createAsync(inputs: Inputs.Line.LinePointsDto): Promise<Inputs.Base.Line3>;
/**
* Gets the point on the line segment at a given param
* @param inputs Line and parameter
* @returns Point on line
*/
getPointOnLine(inputs: Inputs.Line.PointOnLineDto): Inputs.Base.Point3;
/**
* Create the line segments between all of the points in a list
* @param inputs Lines in a list
* @returns Lines
*/
linesBetweenPoints(inputs: Inputs.Line.PointsLinesDto): Inputs.Base.Line3[];
/**
* Create the lines between two lists of start and end points of equal length
* @param inputs Two lists of start and end points
* @returns Lines
*/
linesBetweenStartAndEndPoints(inputs: Inputs.Line.LineStartEndPointsDto): Inputs.Base.Line3[];
/**
* Create the lines between two lists of start and end points of equal length with potential async inputs
* @param inputs Two lists of start and end points
* @returns Lines
*/
linesBetweenStartAndEndPointsAsync(inputs: Inputs.Line.LineStartEndPointsDto): Promise<Inputs.Base.Line3[]>;
}