UNPKG

@bitbybit-dev/base

Version:

Bit By Bit Developers Base CAD Library to Program Geometry

623 lines (622 loc) 17 kB
import { Base } from "./base-inputs"; export declare namespace Point { class PointDto { constructor(point?: Base.Point3); /** * Point * @default undefined */ point: Base.Point3; } class PointXYZDto { constructor(x?: number, y?: number, z?: number); /** * Point * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ x: number; /** * Point * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ y: number; /** * Point * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ z: number; } class PointXYDto { constructor(x?: number, y?: number); /** * Point * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ x: number; /** * Point * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ y: number; } class PointsDto { constructor(points?: Base.Point3[]); /** * Points * @default undefined */ points: Base.Point3[]; } class TwoPointsDto { constructor(point1?: Base.Point3, point2?: Base.Point3); /** * Point 1 * @default undefined */ point1: Base.Point3; /** * Point 2 * @default undefined */ point2: Base.Point3; } class DrawPointDto<T> { /** * Provide options without default values */ constructor(point?: Base.Point3, opacity?: number, size?: number, colours?: string | string[], updatable?: boolean, pointMesh?: T); /** * Point * @default undefined */ point: Base.Point3; /** * Value between 0 and 1 * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ opacity: number; /** * Size of the point * @default 3 * @minimum 0 * @maximum Infinity * @step 0.1 */ size: number; /** * Hex colour string * @default #444444 */ colours: string | string[]; /** * Indicates wether the position of this point will change in time * @default false */ updatable: boolean; /** * Point mesh variable in case it already exists and needs updating * @default undefined */ pointMesh?: T; } class DrawPointsDto<T> { /** * Provide options without default values */ constructor(points?: Base.Point3[], opacity?: number, size?: number, colours?: string | string[], updatable?: boolean, pointsMesh?: T); /** * Point * @default undefined */ points: Base.Point3[]; /** * Value between 0 and 1 * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ opacity: number; /** * Size of the points * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ size: number; /** * Hex colour string or collection of strings * @default #444444 */ colours: string | string[]; /** * Indicates wether the position of this point will change in time * @default false */ updatable: boolean; /** * Points mesh variable in case it already exists and needs updating * @default undefined */ pointsMesh?: T; } class TransformPointDto { constructor(point?: Base.Point3, transformation?: Base.TransformMatrixes); /** * Point to transform * @default undefined */ point: Base.Point3; /** * Transformation matrix or a list of transformation matrixes * @default undefined */ transformation: Base.TransformMatrixes; } class TransformPointsDto { constructor(points?: Base.Point3[], transformation?: Base.TransformMatrixes); /** * Points to transform * @default undefined */ points: Base.Point3[]; /** * Transformation matrix or a list of transformation matrixes * @default undefined */ transformation: Base.TransformMatrixes; } class TranslatePointsWithVectorsDto { constructor(points?: Base.Point3[], translations?: Base.Vector3[]); /** * Points to transform * @default undefined */ points: Base.Point3[]; /** * Translation vectors for each point * @default undefined */ translations: Base.Vector3[]; } class TranslatePointsDto { constructor(points?: Base.Point3[], translation?: Base.Vector3); /** * Points to transform * @default undefined */ points: Base.Point3[]; /** * Translation vector with x, y and z values * @default undefined */ translation: Base.Vector3; } class TranslateXYZPointsDto { constructor(points?: Base.Point3[], x?: number, y?: number, z?: number); /** * Points to transform * @default undefined */ points: Base.Point3[]; /** * X vector value * @default 0 */ x: number; /** * Y vector value * @default 1 */ y: number; /** * Z vector value * @default 0 */ z: number; } class ScalePointsCenterXYZDto { constructor(points?: Base.Point3[], center?: Base.Point3, scaleXyz?: Base.Vector3); /** * Points to transform * @default undefined */ points: Base.Point3[]; /** * The center from which the scaling is applied * @default [0, 0, 0] */ center: Base.Point3; /** * Scaling factors for each axis [1, 2, 1] means that Y axis will be scaled 200% and both x and z axis will remain on 100% * @default [1, 1, 1] */ scaleXyz: Base.Vector3; } class StretchPointsDirFromCenterDto { constructor(points?: Base.Point3[], center?: Base.Point3, direction?: Base.Vector3, scale?: number); /** * Points to transform * @default undefined */ points?: Base.Point3[]; /** * The center from which the scaling is applied * @default [0, 0, 0] */ center?: Base.Point3; /** * Stretch direction vector * @default [0, 0, 1] */ direction?: Base.Vector3; /** * The scale factor to apply along the direction vector. 1.0 means no change. * @default 2 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ scale?: number; } class RotatePointsCenterAxisDto { constructor(points?: Base.Point3[], angle?: number, axis?: Base.Vector3, center?: Base.Point3); /** * Points to transform * @default undefined */ points: Base.Point3[]; /** * Angle of rotation in degrees * @default 90 * @minimum -Infinity * @maximum Infinity * @step 1 */ angle: number; /** * Axis vector for rotation * @default [0, 1, 0] */ axis: Base.Vector3; /** * The center from which the axis is pointing * @default [0, 0, 0] */ center: Base.Point3; } class TransformsForPointsDto { constructor(points?: Base.Point3[], transformation?: Base.TransformMatrixes[]); /** * Points to transform * @default undefined */ points: Base.Point3[]; /** * Transformations that have to match nr of points * @default undefined */ transformation: Base.TransformMatrixes[]; } class ThreePointsNormalDto { constructor(point1?: Base.Point3, point2?: Base.Point3, point3?: Base.Point3, reverseNormal?: boolean); /** * Point 1 * @default undefined */ point1: Base.Point3; /** * Point 2 * @default undefined */ point2: Base.Point3; /** * Point 3 * @default undefined */ point3: Base.Point3; /** * Reverse normal direction * @default false */ reverseNormal: boolean; } class ThreePointsToleranceDto { constructor(start?: Base.Point3, center?: Base.Point3, end?: Base.Point3, tolerance?: number); /** * Start point * @default undefined */ start?: Base.Point3; /** * Center point * @default undefined */ center?: Base.Point3; /** * End point * @default undefined */ end?: Base.Point3; /** * Tolerance for the calculation * @default 1e-7 * @minimum -Infinity * @maximum Infinity * @step 1e-7 */ tolerance: number; } class PointsMaxFilletsHalfLineDto { constructor(points?: Base.Point3[], checkLastWithFirst?: boolean, tolerance?: number); /** * Points to transform * @default undefined */ points?: Base.Point3[]; /** * Check first and last point for duplicates * @default false */ checkLastWithFirst?: boolean; /** * Tolerance for the calculation * @default 1e-7 * @minimum -Infinity * @maximum Infinity * @step 1e-7 */ tolerance?: number; } class RemoveConsecutiveDuplicatesDto { constructor(points?: Base.Point3[], tolerance?: number, checkFirstAndLast?: boolean); /** * Points to transform * @default undefined */ points: Base.Point3[]; /** * Tolerance for removing duplicates * @default 1e-7 * @minimum 0 * @maximum Infinity * @step 1e-7 */ tolerance: number; /** * Check first and last point for duplicates */ checkFirstAndLast: boolean; } class ClosestPointFromPointsDto { constructor(points?: Base.Point3[], point?: Base.Point3); /** * Points to transform * @default undefined */ points: Base.Point3[]; /** * Transformation matrix or a list of transformation matrixes * @default undefined */ point: Base.Point3; } class TwoPointsToleranceDto { constructor(point1?: Base.Point3, point2?: Base.Point3, tolerance?: number); /** * First point to compare * @default undefined */ point1?: Base.Point3; /** * Second point to compare * @default undefined */ point2?: Base.Point3; /** * Tolerance for the calculation * @default 1e-7 * @minimum -Infinity * @maximum Infinity * @step 1e-7 */ tolerance?: number; } class StartEndPointsDto { constructor(startPoint?: Base.Point3, endPoint?: Base.Point3); /** * Start point * @default undefined */ startPoint: Base.Point3; /** * End point * @default undefined */ endPoint: Base.Point3; } class StartEndPointsListDto { constructor(startPoint?: Base.Point3, endPoints?: Base.Point3[]); /** * Start point * @default undefined */ startPoint: Base.Point3; /** * End point * @default undefined */ endPoints: Base.Point3[]; } class MultiplyPointDto { constructor(point?: Base.Point3, amountOfPoints?: number); /** * Point for multiplication * @default undefined */ point: Base.Point3; /** * Number of points to create in the list * @default undefined */ amountOfPoints: number; } class SpiralDto { constructor(radius?: number, numberPoints?: number, widening?: number, factor?: number, phi?: number); /** * Identifies phi angle * @default 0.9 * @minimum 0 * @maximum Infinity * @step 0.1 */ phi: number; /** * Identifies how many points will be created * @default 200 * @minimum 0 * @maximum Infinity * @step 10 */ numberPoints: number; /** * Widening factor of the spiral * @default 3 * @minimum 0 * @maximum Infinity * @step 0.1 */ widening: number; /** * Radius of the spiral * @default 6 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; /** * Factor of the spiral * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ factor: number; } class HexGridScaledToFitDto { constructor(wdith?: number, height?: number, nrHexagonsU?: number, nrHexagonsV?: number, centerGrid?: boolean, pointsOnGround?: boolean); /** Total desired width for the grid area. The hexagon size will be derived from this and nrHexagonsU. * @default 10 * @minimum 0 * @maximum Infinity * @step 0.1 */ width?: number; /** Total desired height for the grid area. Note: due to hexagon geometry, the actual grid height might differ slightly if maintaining regular hexagons based on width. * @default 10 * @minimum 0 * @maximum Infinity * @step 0.1 */ height?: number; /** Number of hexagons desired in width. * @default 10 * @minimum 0 * @maximum Infinity * @step 1 */ nrHexagonsInWidth?: number; /** Number of hexagons desired in height. * @default 10 * @minimum 0 * @maximum Infinity * @step 1 */ nrHexagonsInHeight?: number; /** If true, the hexagons will be oriented with their flat sides facing up and down. * @default false */ flatTop?: boolean; /** If true, shift the entire grid up by half hex height. * @default false */ extendTop?: boolean; /** If true, shift the entire grid down by half hex height. * @default false */ extendBottom?: boolean; /** If true, shift the entire grid left by half hex width. * @default false */ extendLeft?: boolean; /** If true, shift the entire grid right by half hex width. * @default false */ extendRight?: boolean; /** If true, the grid center (based on totalWidth/totalHeight) will be at [0,0,0]. * @default false */ centerGrid?: boolean; /** If true, swaps Y and Z coordinates and sets Y to 0, placing points on the XZ ground plane. * @default false */ pointsOnGround?: boolean; } class HexGridCentersDto { constructor(nrHexagonsX?: number, nrHexagonsY?: number, radiusHexagon?: number, orientOnCenter?: boolean, pointsOnGround?: boolean); /** * Number of hexagons on Y direction * @default 21 * @minimum 0 * @maximum Infinity * @step 1 */ nrHexagonsY: number; /** * Number of Hexagons on Z direction * @default 21 * @minimum 0 * @maximum Infinity * @step 1 */ nrHexagonsX: number; /** * radius of a single hexagon * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusHexagon: number; /** * Orient hexagon points grid on center * @default false */ orientOnCenter: boolean; /** * Orient points on the ground * @default false */ pointsOnGround: boolean; } }