@bitbybit-dev/base 1.4.1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/GlobalCDNProvider.js +1 -1
- package/lib/api/color-space.d.ts +14 -0
- package/lib/api/color-space.js +24 -0
- package/lib/api/index.d.ts +2 -0
- package/lib/api/index.js +2 -0
- package/lib/api/inputs/base-inputs.d.ts +382 -5
- package/lib/api/inputs/base-inputs.js +0 -3
- package/lib/api/inputs/color-inputs.d.ts +1 -1
- package/lib/api/inputs/color-inputs.js +0 -1
- package/lib/api/inputs/dates-inputs.js +0 -1
- package/lib/api/inputs/frame-inputs.d.ts +1 -1
- package/lib/api/inputs/inputs.js +0 -1
- package/lib/api/inputs/io-inputs.d.ts +1 -1
- package/lib/api/inputs/line-inputs.d.ts +1 -1
- package/lib/api/inputs/lists-inputs.js +0 -1
- package/lib/api/inputs/logic-inputs.d.ts +1 -1
- package/lib/api/inputs/logic-inputs.js +0 -1
- package/lib/api/inputs/math-inputs.js +0 -1
- package/lib/api/inputs/mesh-inputs.d.ts +29 -1
- package/lib/api/inputs/mesh-inputs.js +25 -1
- package/lib/api/inputs/point-inputs.d.ts +30 -1
- package/lib/api/inputs/point-inputs.js +28 -0
- package/lib/api/inputs/polyline-inputs.d.ts +1 -1
- package/lib/api/inputs/transforms-inputs.d.ts +1 -1
- package/lib/api/inputs/vector-inputs.d.ts +1 -1
- package/lib/api/kernel-calls/describe-failure.d.ts +3 -2
- package/lib/api/kernel-calls/describe-failure.js +9 -17
- package/lib/api/kernel-calls/failure-message.d.ts +1 -1
- package/lib/api/kernel-calls/hashing.d.ts +14 -0
- package/lib/api/kernel-calls/hashing.js +47 -0
- package/lib/api/kernel-calls/index.d.ts +3 -0
- package/lib/api/kernel-calls/index.js +3 -0
- package/lib/api/kernel-calls/input-rules.d.ts +1 -1
- package/lib/api/kernel-calls/input-rules.js +10 -5
- package/lib/api/kernel-calls/input-validation.d.ts +3 -3
- package/lib/api/kernel-calls/input-validation.js +24 -14
- package/lib/api/kernel-calls/kernel-steps.d.ts +19 -0
- package/lib/api/kernel-calls/kernel-steps.js +19 -0
- package/lib/api/kernel-calls/resolve-dto.d.ts +5 -3
- package/lib/api/kernel-calls/resolve-dto.js +9 -4
- package/lib/api/kernel-calls/unknown-values.d.ts +12 -0
- package/lib/api/kernel-calls/unknown-values.js +16 -0
- package/lib/api/kernel-calls/with-defaults.d.ts +1 -1
- package/lib/api/models/point/hex-grid-data.d.ts +1 -1
- package/lib/api/models/text/vector-char-data.d.ts +1 -1
- package/lib/api/models/text/vector-text-data.d.ts +1 -1
- package/lib/api/recipes/checker-types.d.ts +14 -0
- package/lib/api/recipes/checker-types.js +1 -0
- package/lib/api/recipes/index.d.ts +4 -0
- package/lib/api/recipes/index.js +3 -0
- package/lib/api/recipes/limits.constants.d.ts +23 -0
- package/lib/api/recipes/limits.constants.js +23 -0
- package/lib/api/recipes/recipe-types.d.ts +48 -0
- package/lib/api/recipes/recipe-types.js +1 -0
- package/lib/api/recipes/sources.d.ts +16 -0
- package/lib/api/recipes/sources.js +23 -0
- package/lib/api/recipes/surface-mesh.d.ts +16 -0
- package/lib/api/recipes/surface-mesh.js +86 -0
- package/lib/api/recipes/validate.d.ts +36 -0
- package/lib/api/recipes/validate.js +427 -0
- package/lib/api/resolved-inputs/index.d.ts +3 -0
- package/lib/api/services/color.d.ts +1 -1
- package/lib/api/services/frame.d.ts +3 -95
- package/lib/api/services/frame.js +24 -135
- package/lib/api/services/geometry-helper.d.ts +1 -1
- package/lib/api/services/helpers/arcs.d.ts +6 -0
- package/lib/api/services/helpers/arcs.js +30 -0
- package/lib/api/services/helpers/crc32.d.ts +1 -0
- package/lib/api/services/helpers/crc32.js +21 -0
- package/lib/api/services/helpers/dxf/dxf-generator.d.ts +0 -83
- package/lib/api/services/helpers/dxf/dxf-generator.js +5 -86
- package/lib/api/services/helpers/frame-axes.d.ts +9 -1
- package/lib/api/services/helpers/frame-axes.js +34 -0
- package/lib/api/services/helpers/helper-types.d.ts +34 -0
- package/lib/api/services/helpers/helper-types.js +1 -0
- package/lib/api/services/helpers/inflate.constants.d.ts +41 -0
- package/lib/api/services/helpers/inflate.constants.js +41 -0
- package/lib/api/services/helpers/inflate.d.ts +3 -0
- package/lib/api/services/helpers/inflate.js +228 -0
- package/lib/api/services/helpers/matrices.constants.d.ts +2 -0
- package/lib/api/services/helpers/matrices.constants.js +2 -0
- package/lib/api/services/helpers/matrices.d.ts +9 -1
- package/lib/api/services/helpers/matrices.js +18 -0
- package/lib/api/services/helpers/mesh-measures.d.ts +1 -0
- package/lib/api/services/helpers/mesh-measures.js +28 -0
- package/lib/api/services/helpers/mesh-normals.d.ts +2 -0
- package/lib/api/services/helpers/mesh-normals.js +118 -26
- package/lib/api/services/helpers/mesh-primitives.constants.d.ts +2 -0
- package/lib/api/services/helpers/mesh-primitives.constants.js +12 -0
- package/lib/api/services/helpers/mesh-primitives.d.ts +3 -0
- package/lib/api/services/helpers/mesh-primitives.js +46 -0
- package/lib/api/services/helpers/nurbs.d.ts +7 -0
- package/lib/api/services/helpers/nurbs.js +50 -0
- package/lib/api/services/helpers/paths.d.ts +8 -0
- package/lib/api/services/helpers/paths.js +96 -0
- package/lib/api/services/helpers/polygons.d.ts +8 -0
- package/lib/api/services/helpers/polygons.js +59 -0
- package/lib/api/services/helpers/surface-triangulation.d.ts +6 -0
- package/lib/api/services/helpers/surface-triangulation.js +298 -0
- package/lib/api/services/helpers/triangulation.d.ts +2 -0
- package/lib/api/services/helpers/triangulation.js +295 -0
- package/lib/api/services/helpers/vectors.d.ts +18 -0
- package/lib/api/services/helpers/vectors.js +17 -0
- package/lib/api/services/helpers/zip.constants.d.ts +34 -0
- package/lib/api/services/helpers/zip.constants.js +34 -0
- package/lib/api/services/helpers/zip.d.ts +4 -0
- package/lib/api/services/helpers/zip.js +89 -0
- package/lib/api/services/line.d.ts +3 -3
- package/lib/api/services/mesh.d.ts +37 -2
- package/lib/api/services/mesh.js +60 -3
- package/lib/api/services/point.d.ts +22 -10
- package/lib/api/services/point.js +42 -13
- package/lib/api/services/polyline.d.ts +39 -4
- package/lib/api/services/polyline.js +56 -6
- package/lib/api/services/text.d.ts +2 -2
- package/lib/api/services/text.js +10 -5
- package/lib/api/services/transforms.d.ts +3 -9
- package/lib/api/services/transforms.js +0 -6
- package/lib/api/services/vector.d.ts +2 -2
- package/lib/api/services/vector.js +2 -5
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Base } from "../inputs/base-inputs";
|
|
1
|
+
import type { Base } from "../inputs/base-inputs";
|
|
2
2
|
import * as Inputs from "../inputs";
|
|
3
|
-
import { MathBitByBit } from "./math";
|
|
4
|
-
import { Vector } from "./vector";
|
|
3
|
+
import type { MathBitByBit } from "./math";
|
|
4
|
+
import type { Vector } from "./vector";
|
|
5
5
|
/**
|
|
6
6
|
* Builds transformation matrices for moving, rotating, scaling and stretching geometry. A
|
|
7
7
|
* transformation is a 4x4 matrix as 16 numbers in column-major order; most methods return a short
|
|
@@ -238,11 +238,5 @@ export declare class Transforms {
|
|
|
238
238
|
private rotationZ;
|
|
239
239
|
private rotationYawPitchRoll;
|
|
240
240
|
private rotationMatrixFromQuat;
|
|
241
|
-
/**
|
|
242
|
-
* Creates a 4x4 matrix that scales along a given direction vector.
|
|
243
|
-
* @param direction The direction vector (will be normalized).
|
|
244
|
-
* @param scale The scale factor along the direction.
|
|
245
|
-
* @returns A 4x4 column-major transformation matrix.
|
|
246
|
-
*/
|
|
247
241
|
private stretchDirection;
|
|
248
242
|
}
|
|
@@ -392,12 +392,6 @@ export class Transforms {
|
|
|
392
392
|
m[15] = 1.0;
|
|
393
393
|
return m;
|
|
394
394
|
}
|
|
395
|
-
/**
|
|
396
|
-
* Creates a 4x4 matrix that scales along a given direction vector.
|
|
397
|
-
* @param direction The direction vector (will be normalized).
|
|
398
|
-
* @param scale The scale factor along the direction.
|
|
399
|
-
* @returns A 4x4 column-major transformation matrix.
|
|
400
|
-
*/
|
|
401
395
|
stretchDirection(direction, scale) {
|
|
402
396
|
const d = this.vector.normalized({ vector: direction });
|
|
403
397
|
if (!d || isNaN(d[0]) || (d[0] === 0 && d[1] === 0 && d[2] === 0)) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Inputs from "../inputs";
|
|
2
|
-
import { GeometryHelper } from "./geometry-helper";
|
|
3
|
-
import { MathBitByBit } from "./math";
|
|
2
|
+
import type { GeometryHelper } from "./geometry-helper";
|
|
3
|
+
import type { MathBitByBit } from "./math";
|
|
4
4
|
/**
|
|
5
5
|
* Vector maths on plain number arrays. A vector is an array of numbers; in 3D it is `[x, y, z]`
|
|
6
6
|
* with Y pointing up, the same shape as a point, so the two can be passed to each other's methods.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as Inputs from "../inputs";
|
|
2
2
|
import { resolveDto } from "../kernel-calls";
|
|
3
|
+
import { cross3 } from "./helpers/vectors";
|
|
3
4
|
/**
|
|
4
5
|
* Vector maths on plain number arrays. A vector is an array of numbers; in 3D it is `[x, y, z]`
|
|
5
6
|
* with Y pointing up, the same shape as a point, so the two can be passed to each other's methods.
|
|
@@ -219,11 +220,7 @@ export class Vector {
|
|
|
219
220
|
* ```
|
|
220
221
|
*/
|
|
221
222
|
cross(inputs) {
|
|
222
|
-
|
|
223
|
-
res.push(inputs.first[1] * inputs.second[2] - inputs.first[2] * inputs.second[1]);
|
|
224
|
-
res.push(inputs.first[2] * inputs.second[0] - inputs.first[0] * inputs.second[2]);
|
|
225
|
-
res.push(inputs.first[0] * inputs.second[1] - inputs.first[1] * inputs.second[0]);
|
|
226
|
-
return res;
|
|
223
|
+
return cross3(inputs.first, inputs.second);
|
|
227
224
|
}
|
|
228
225
|
/**
|
|
229
226
|
* Computes the squared distance between two vectors, which avoids the square root when only
|