@bitbybit-dev/base 1.4.1 → 1.5.0-rc.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.
Files changed (121) hide show
  1. package/lib/api/GlobalCDNProvider.js +1 -1
  2. package/lib/api/color-space.d.ts +14 -0
  3. package/lib/api/color-space.js +24 -0
  4. package/lib/api/index.d.ts +2 -0
  5. package/lib/api/index.js +2 -0
  6. package/lib/api/inputs/base-inputs.d.ts +382 -5
  7. package/lib/api/inputs/base-inputs.js +0 -3
  8. package/lib/api/inputs/color-inputs.d.ts +1 -1
  9. package/lib/api/inputs/color-inputs.js +0 -1
  10. package/lib/api/inputs/dates-inputs.js +0 -1
  11. package/lib/api/inputs/frame-inputs.d.ts +1 -1
  12. package/lib/api/inputs/inputs.js +0 -1
  13. package/lib/api/inputs/io-inputs.d.ts +1 -1
  14. package/lib/api/inputs/line-inputs.d.ts +1 -1
  15. package/lib/api/inputs/lists-inputs.js +0 -1
  16. package/lib/api/inputs/logic-inputs.d.ts +1 -1
  17. package/lib/api/inputs/logic-inputs.js +0 -1
  18. package/lib/api/inputs/math-inputs.js +0 -1
  19. package/lib/api/inputs/mesh-inputs.d.ts +29 -1
  20. package/lib/api/inputs/mesh-inputs.js +25 -1
  21. package/lib/api/inputs/point-inputs.d.ts +30 -1
  22. package/lib/api/inputs/point-inputs.js +28 -0
  23. package/lib/api/inputs/polyline-inputs.d.ts +1 -1
  24. package/lib/api/inputs/transforms-inputs.d.ts +1 -1
  25. package/lib/api/inputs/vector-inputs.d.ts +1 -1
  26. package/lib/api/kernel-calls/describe-failure.d.ts +3 -2
  27. package/lib/api/kernel-calls/describe-failure.js +9 -17
  28. package/lib/api/kernel-calls/failure-message.d.ts +1 -1
  29. package/lib/api/kernel-calls/hashing.d.ts +14 -0
  30. package/lib/api/kernel-calls/hashing.js +47 -0
  31. package/lib/api/kernel-calls/index.d.ts +3 -0
  32. package/lib/api/kernel-calls/index.js +3 -0
  33. package/lib/api/kernel-calls/input-rules.d.ts +1 -1
  34. package/lib/api/kernel-calls/input-rules.js +10 -5
  35. package/lib/api/kernel-calls/input-validation.d.ts +3 -3
  36. package/lib/api/kernel-calls/input-validation.js +24 -14
  37. package/lib/api/kernel-calls/kernel-steps.d.ts +19 -0
  38. package/lib/api/kernel-calls/kernel-steps.js +19 -0
  39. package/lib/api/kernel-calls/resolve-dto.d.ts +5 -3
  40. package/lib/api/kernel-calls/resolve-dto.js +9 -4
  41. package/lib/api/kernel-calls/unknown-values.d.ts +12 -0
  42. package/lib/api/kernel-calls/unknown-values.js +16 -0
  43. package/lib/api/kernel-calls/with-defaults.d.ts +1 -1
  44. package/lib/api/models/point/hex-grid-data.d.ts +1 -1
  45. package/lib/api/models/text/vector-char-data.d.ts +1 -1
  46. package/lib/api/models/text/vector-text-data.d.ts +1 -1
  47. package/lib/api/recipes/checker-types.d.ts +14 -0
  48. package/lib/api/recipes/checker-types.js +1 -0
  49. package/lib/api/recipes/index.d.ts +4 -0
  50. package/lib/api/recipes/index.js +3 -0
  51. package/lib/api/recipes/limits.constants.d.ts +23 -0
  52. package/lib/api/recipes/limits.constants.js +23 -0
  53. package/lib/api/recipes/recipe-types.d.ts +48 -0
  54. package/lib/api/recipes/recipe-types.js +1 -0
  55. package/lib/api/recipes/sources.d.ts +16 -0
  56. package/lib/api/recipes/sources.js +23 -0
  57. package/lib/api/recipes/surface-mesh.d.ts +16 -0
  58. package/lib/api/recipes/surface-mesh.js +86 -0
  59. package/lib/api/recipes/validate.d.ts +36 -0
  60. package/lib/api/recipes/validate.js +427 -0
  61. package/lib/api/resolved-inputs/index.d.ts +3 -0
  62. package/lib/api/services/color.d.ts +1 -1
  63. package/lib/api/services/frame.d.ts +3 -95
  64. package/lib/api/services/frame.js +24 -135
  65. package/lib/api/services/geometry-helper.d.ts +1 -1
  66. package/lib/api/services/helpers/arcs.d.ts +6 -0
  67. package/lib/api/services/helpers/arcs.js +30 -0
  68. package/lib/api/services/helpers/crc32.d.ts +1 -0
  69. package/lib/api/services/helpers/crc32.js +21 -0
  70. package/lib/api/services/helpers/dxf/dxf-generator.d.ts +0 -83
  71. package/lib/api/services/helpers/dxf/dxf-generator.js +5 -86
  72. package/lib/api/services/helpers/frame-axes.d.ts +9 -1
  73. package/lib/api/services/helpers/frame-axes.js +34 -0
  74. package/lib/api/services/helpers/helper-types.d.ts +34 -0
  75. package/lib/api/services/helpers/helper-types.js +1 -0
  76. package/lib/api/services/helpers/inflate.constants.d.ts +41 -0
  77. package/lib/api/services/helpers/inflate.constants.js +41 -0
  78. package/lib/api/services/helpers/inflate.d.ts +3 -0
  79. package/lib/api/services/helpers/inflate.js +228 -0
  80. package/lib/api/services/helpers/matrices.constants.d.ts +2 -0
  81. package/lib/api/services/helpers/matrices.constants.js +2 -0
  82. package/lib/api/services/helpers/matrices.d.ts +9 -1
  83. package/lib/api/services/helpers/matrices.js +18 -0
  84. package/lib/api/services/helpers/mesh-measures.d.ts +1 -0
  85. package/lib/api/services/helpers/mesh-measures.js +28 -0
  86. package/lib/api/services/helpers/mesh-normals.d.ts +2 -0
  87. package/lib/api/services/helpers/mesh-normals.js +118 -26
  88. package/lib/api/services/helpers/mesh-primitives.constants.d.ts +2 -0
  89. package/lib/api/services/helpers/mesh-primitives.constants.js +12 -0
  90. package/lib/api/services/helpers/mesh-primitives.d.ts +3 -0
  91. package/lib/api/services/helpers/mesh-primitives.js +46 -0
  92. package/lib/api/services/helpers/nurbs.d.ts +7 -0
  93. package/lib/api/services/helpers/nurbs.js +50 -0
  94. package/lib/api/services/helpers/paths.d.ts +8 -0
  95. package/lib/api/services/helpers/paths.js +96 -0
  96. package/lib/api/services/helpers/polygons.d.ts +8 -0
  97. package/lib/api/services/helpers/polygons.js +59 -0
  98. package/lib/api/services/helpers/surface-triangulation.d.ts +6 -0
  99. package/lib/api/services/helpers/surface-triangulation.js +298 -0
  100. package/lib/api/services/helpers/triangulation.d.ts +2 -0
  101. package/lib/api/services/helpers/triangulation.js +295 -0
  102. package/lib/api/services/helpers/vectors.d.ts +18 -0
  103. package/lib/api/services/helpers/vectors.js +17 -0
  104. package/lib/api/services/helpers/zip.constants.d.ts +34 -0
  105. package/lib/api/services/helpers/zip.constants.js +34 -0
  106. package/lib/api/services/helpers/zip.d.ts +4 -0
  107. package/lib/api/services/helpers/zip.js +89 -0
  108. package/lib/api/services/line.d.ts +3 -3
  109. package/lib/api/services/mesh.d.ts +37 -2
  110. package/lib/api/services/mesh.js +60 -3
  111. package/lib/api/services/point.d.ts +22 -10
  112. package/lib/api/services/point.js +42 -13
  113. package/lib/api/services/polyline.d.ts +39 -4
  114. package/lib/api/services/polyline.js +56 -6
  115. package/lib/api/services/text.d.ts +2 -2
  116. package/lib/api/services/text.js +10 -5
  117. package/lib/api/services/transforms.d.ts +3 -9
  118. package/lib/api/services/transforms.js +0 -6
  119. package/lib/api/services/vector.d.ts +2 -2
  120. package/lib/api/services/vector.js +2 -5
  121. 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
- const res = [];
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitbybit-dev/base",
3
- "version": "1.4.1",
3
+ "version": "1.5.0-rc.0",
4
4
  "description": "Bit By Bit Developers Base CAD Library to Program Geometry",
5
5
  "homepage": "https://docs.bitbybit.dev/modules/Bit",
6
6
  "main": "index.js",