UNPKG

@bitblit/ratchet-common

Version:

Common tools for general use

48 lines (47 loc) 2.95 kB
import { Point2d } from "./point-2d.js"; import { Plane2d } from "./plane-2d.js"; import { Line2d } from "./line-2d.js"; import { PolyLine2d } from "./poly-line-2d.js"; import { TransformationMatrix } from "./transformation-matrix.js"; import { Plane2dType } from "./plane-2d-type.js"; export declare class Ratchet2d { private constructor(); static translateToOriginVector(points: Point2d[]): Point2d; static minimalContainingPlane(points: Point2d[], type?: Plane2dType): Plane2d; static scaleVector(src: Plane2d, dst: Plane2d): Point2d; static samePoint(p1: Point2d, p2: Point2d): boolean; static atLeastOneDimensionShared(p1: Point2d, p2: Point2d): boolean; static validPlane(plane: Plane2d): boolean; static validLine(line: Line2d): boolean; static validLines(lines: Line2d[]): boolean; static validPolyLine(pline: PolyLine2d): boolean; static polyLineToLines(pline: PolyLine2d): Line2d[]; static lastPointOnPolyLine(polyLine: PolyLine2d): Point2d; static lineToPolyLine(line: Line2d): PolyLine2d; static linesToPolyLines(lines: Line2d[]): PolyLine2d[]; static validPoint(pt: Point2d): boolean; static validPoints(pt: Point2d[]): boolean; static planeContainsPoint(pt: Point2d, plane: Plane2d): boolean; static planeContainsPoints(pt: Point2d[], plane: Plane2d): boolean; static linesToPoints(lines: Line2d[]): Point2d[]; static pointsToLines(points: Point2d[]): Line2d[]; static rotateRightAboutCartesianOrigin90Degrees(points: Point2d[], times?: number): Point2d[]; static planeContainsLines(lines: Line2d[], plane: Plane2d): boolean; static planeContainsPolyLine(pline: PolyLine2d, plane: Plane2d): boolean; static planeContainsLine(line: Line2d, plane: Plane2d): boolean; static xToY(points: Point2d[]): Point2d[]; static translate(points: Point2d[], xlate: Point2d): Point2d[]; static mirrorPointsOnPlane(points: Point2d[], src: Plane2d, mirrorX: boolean, mirrorY: boolean): Point2d[]; static matchingVerticalOrientation(pt1: Plane2dType, pt2: Plane2dType): boolean; static matchingHorizontalOrientation(pt1: Plane2dType, pt2: Plane2dType): boolean; static transformPointsToNewPlane(points: Point2d[], src: Plane2d, dst: Plane2d): Point2d[]; static transformPointToNewPlane(point: Point2d, src: Plane2d, dst: Plane2d): Point2d; static transformLines(_lines: Line2d[], _src: Plane2d, _dst: Plane2d): Line2d[]; static fitCurve(curveDef: Point2d[], inputX: number): number; static midPoint(src: Point2d, other: Point2d): Point2d; static pointAtPercentDistance(src: Point2d, other: Point2d, percent: number): Point2d; static validatePoint(pt: Point2d): void; static validateMatrix(tx: TransformationMatrix, includeUV?: boolean): void; static applyTransform(pt: Point2d[], tx: TransformationMatrix): Point2d[]; static applyTransformSingle(pt: Point2d, tx: TransformationMatrix): Point2d; }