@bitbybit-dev/base
Version:
Bit By Bit Developers Base CAD Library to Program Geometry
334 lines (333 loc) • 9.29 kB
JavaScript
import { Math } from "./inputs";
export var Vector;
(function (Vector) {
class TwoVectorsDto {
constructor(first, second) {
if (first !== undefined) {
this.first = first;
}
if (second !== undefined) {
this.second = second;
}
}
}
Vector.TwoVectorsDto = TwoVectorsDto;
class VectorBoolDto {
constructor(vector) {
if (vector !== undefined) {
this.vector = vector;
}
}
}
Vector.VectorBoolDto = VectorBoolDto;
class RemoveAllDuplicateVectorsDto {
constructor(vectors, tolerance) {
/**
* Tolerance value
* @default 1e-7
* @minimum 0
* @maximum Infinity
*/
this.tolerance = 1e-7;
if (vectors !== undefined) {
this.vectors = vectors;
}
if (tolerance !== undefined) {
this.tolerance = tolerance;
}
}
}
Vector.RemoveAllDuplicateVectorsDto = RemoveAllDuplicateVectorsDto;
class RemoveConsecutiveDuplicateVectorsDto {
constructor(vectors, checkFirstAndLast, tolerance) {
/**
* Check first and last vectors
* @default false
*/
this.checkFirstAndLast = false;
/**
* Tolerance value
* @default 1e-7
* @minimum 0
* @maximum Infinity
*/
this.tolerance = 1e-7;
if (vectors !== undefined) {
this.vectors = vectors;
}
if (checkFirstAndLast !== undefined) {
this.checkFirstAndLast = checkFirstAndLast;
}
if (tolerance !== undefined) {
this.tolerance = tolerance;
}
}
}
Vector.RemoveConsecutiveDuplicateVectorsDto = RemoveConsecutiveDuplicateVectorsDto;
class VectorsTheSameDto {
constructor(vec1, vec2, tolerance) {
/**
* Tolerance value
* @default 1e-7
* @minimum 0
* @maximum Infinity
*/
this.tolerance = 1e-7;
if (vec1 !== undefined) {
this.vec1 = vec1;
}
if (vec2 !== undefined) {
this.vec2 = vec2;
}
if (tolerance !== undefined) {
this.tolerance = tolerance;
}
}
}
Vector.VectorsTheSameDto = VectorsTheSameDto;
class VectorDto {
constructor(vector) {
if (vector !== undefined) {
this.vector = vector;
}
}
}
Vector.VectorDto = VectorDto;
class Vector3Dto {
constructor(vector) {
if (vector !== undefined) {
this.vector = vector;
}
}
}
Vector.Vector3Dto = Vector3Dto;
class RangeMaxDto {
constructor(max) {
if (max !== undefined) {
this.max = max;
}
}
}
Vector.RangeMaxDto = RangeMaxDto;
class VectorXYZDto {
constructor(x, y, z) {
if (x !== undefined) {
this.x = x;
}
if (y !== undefined) {
this.y = y;
}
if (z !== undefined) {
this.z = z;
}
}
}
Vector.VectorXYZDto = VectorXYZDto;
class VectorXYDto {
constructor(x, y) {
if (x !== undefined) {
this.x = x;
}
if (y !== undefined) {
this.y = y;
}
}
}
Vector.VectorXYDto = VectorXYDto;
class SpanDto {
constructor(step, min, max) {
/**
* Step of the span
* @default 0.1
* @minimum -Infinity
* @maximum Infinity
* @step 0.1
*/
this.step = 0.1;
/**
* Min value of the span
* @default 0
* @minimum -Infinity
* @maximum Infinity
* @step 1
*/
this.min = 0;
/**
* Max value of the span
* @default 1
* @minimum -Infinity
* @maximum Infinity
* @step 1
*/
this.max = 1;
if (step !== undefined) {
this.step = step;
}
if (min !== undefined) {
this.min = min;
}
if (max !== undefined) {
this.max = max;
}
}
}
Vector.SpanDto = SpanDto;
class SpanEaseItemsDto {
constructor(nrItems, min, max, ease) {
/**
* Nr of items in the span
* @default 100
* @minimum 2
* @maximum Infinity
* @step 1
*/
this.nrItems = 100;
/**
* Min value of the span
* @default 0
* @minimum -Infinity
* @maximum Infinity
* @step 1
*/
this.min = 0;
/**
* Max value of the span
* @default 1
* @minimum -Infinity
* @maximum Infinity
* @step 1
*/
this.max = 1;
/**
* Ease type
* @default easeInSine
*/
this.ease = Math.easeEnum.easeInSine;
/**
* Indicates wether only intervals should be outputed. This will output step lengths between the values.
* @default false
*/
this.intervals = false;
if (nrItems !== undefined) {
this.nrItems = nrItems;
}
if (min !== undefined) {
this.min = min;
}
if (max !== undefined) {
this.max = max;
}
if (ease !== undefined) {
this.ease = ease;
}
}
}
Vector.SpanEaseItemsDto = SpanEaseItemsDto;
class SpanLinearItemsDto {
constructor(nrItems, min, max) {
/**
* Nr of items in the span
* @default 100
* @minimum 2
* @maximum Infinity
* @step 1
*/
this.nrItems = 100;
/**
* Min value of the span
* @default 0
* @minimum -Infinity
* @maximum Infinity
* @step 1
*/
this.min = 0;
/**
* Max value of the span
* @default 1
* @minimum -Infinity
* @maximum Infinity
* @step 1
*/
this.max = 1;
if (nrItems !== undefined) {
this.nrItems = nrItems;
}
if (min !== undefined) {
this.min = min;
}
if (max !== undefined) {
this.max = max;
}
}
}
Vector.SpanLinearItemsDto = SpanLinearItemsDto;
class RayPointDto {
constructor(point, distance, vector) {
if (point !== undefined) {
this.point = point;
}
if (distance !== undefined) {
this.distance = distance;
}
if (vector !== undefined) {
this.vector = vector;
}
}
}
Vector.RayPointDto = RayPointDto;
class VectorsDto {
constructor(vectors) {
if (vectors !== undefined) {
this.vectors = vectors;
}
}
}
Vector.VectorsDto = VectorsDto;
class FractionTwoVectorsDto {
constructor(fraction, first, second) {
/**
* Fraction number
* @default 0.5
* @minimum -Infinity
* @maximum Infinity
* @step 0.1
*/
this.fraction = 0.5;
if (fraction !== undefined) {
this.fraction = fraction;
}
if (first !== undefined) {
this.first = first;
}
if (second !== undefined) {
this.second = second;
}
}
}
Vector.FractionTwoVectorsDto = FractionTwoVectorsDto;
class VectorScalarDto {
constructor(scalar, vector) {
if (scalar !== undefined) {
this.scalar = scalar;
}
if (vector !== undefined) {
this.vector = vector;
}
}
}
Vector.VectorScalarDto = VectorScalarDto;
class TwoVectorsReferenceDto {
constructor(reference, first, second) {
if (reference !== undefined) {
this.reference = reference;
}
if (first !== undefined) {
this.first = first;
}
if (second !== undefined) {
this.second = second;
}
}
}
Vector.TwoVectorsReferenceDto = TwoVectorsReferenceDto;
})(Vector || (Vector = {}));