@bitbybit-dev/base 1.5.0 → 1.6.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/bearings/ansi-bearings.constants.d.ts +2 -0
- package/lib/api/bearings/ansi-bearings.constants.js +26 -0
- package/lib/api/bearings/ansi-bearings.d.ts +4 -0
- package/lib/api/bearings/ansi-bearings.js +14 -0
- package/lib/api/bearings/bearing-types.d.ts +25 -0
- package/lib/api/bearings/bearing-types.js +1 -0
- package/lib/api/bearings/bearings.constants.d.ts +1 -0
- package/lib/api/bearings/bearings.constants.js +1 -0
- package/lib/api/bearings/iso-bearings.constants.d.ts +2 -0
- package/lib/api/bearings/iso-bearings.constants.js +30 -0
- package/lib/api/bearings/iso-bearings.d.ts +4 -0
- package/lib/api/bearings/iso-bearings.js +14 -0
- package/lib/api/color-space.d.ts +2 -0
- package/lib/api/color-space.js +5 -8
- package/lib/api/fasteners/ansi-fasteners.constants.d.ts +16 -0
- package/lib/api/fasteners/ansi-fasteners.constants.js +118 -0
- package/lib/api/fasteners/ansi-fasteners.d.ts +8 -0
- package/lib/api/fasteners/ansi-fasteners.js +64 -0
- package/lib/api/fasteners/fastener-types.d.ts +161 -0
- package/lib/api/fasteners/fastener-types.js +1 -0
- package/lib/api/fasteners/fasteners.constants.d.ts +5 -0
- package/lib/api/fasteners/fasteners.constants.js +5 -0
- package/lib/api/fasteners/fasteners.d.ts +2 -0
- package/lib/api/fasteners/fasteners.js +9 -0
- package/lib/api/fasteners/iso-fasteners.constants.d.ts +23 -0
- package/lib/api/fasteners/iso-fasteners.constants.js +110 -0
- package/lib/api/fasteners/iso-fasteners.d.ts +9 -0
- package/lib/api/fasteners/iso-fasteners.js +61 -0
- package/lib/api/gears/bevel-gears.d.ts +6 -0
- package/lib/api/gears/bevel-gears.js +69 -0
- package/lib/api/gears/gear-checks.d.ts +8 -0
- package/lib/api/gears/gear-checks.js +69 -0
- package/lib/api/gears/gear-pairs.d.ts +4 -0
- package/lib/api/gears/gear-pairs.js +140 -0
- package/lib/api/gears/gear-types.d.ts +425 -0
- package/lib/api/gears/gear-types.js +1 -0
- package/lib/api/gears/gears.constants.d.ts +19 -0
- package/lib/api/gears/gears.constants.js +19 -0
- package/lib/api/gears/gears.d.ts +10 -0
- package/lib/api/gears/gears.js +156 -0
- package/lib/api/gears/helical-gears.d.ts +5 -0
- package/lib/api/gears/helical-gears.js +33 -0
- package/lib/api/gears/involute-flank.d.ts +26 -0
- package/lib/api/gears/involute-flank.js +158 -0
- package/lib/api/gears/racks.d.ts +3 -0
- package/lib/api/gears/racks.js +64 -0
- package/lib/api/index.d.ts +10 -1
- package/lib/api/index.js +0 -1
- package/lib/api/inputs/base-inputs.d.ts +450 -3
- package/lib/api/inputs/base-inputs.js +12 -0
- package/lib/api/inputs/color-inputs.d.ts +14 -0
- package/lib/api/inputs/color-inputs.js +19 -0
- package/lib/api/inputs/engineering-inputs.d.ts +1539 -0
- package/lib/api/inputs/engineering-inputs.js +2181 -0
- package/lib/api/inputs/index.d.ts +2 -0
- package/lib/api/inputs/index.js +2 -0
- package/lib/api/inputs/io-inputs.d.ts +8 -1
- package/lib/api/inputs/io-inputs.js +4 -1
- package/lib/api/inputs/math-inputs.d.ts +61 -0
- package/lib/api/inputs/math-inputs.js +85 -0
- package/lib/api/inputs/mesh-inputs.d.ts +170 -0
- package/lib/api/inputs/mesh-inputs.js +206 -0
- package/lib/api/inputs/point-inputs.d.ts +4 -4
- package/lib/api/inputs/polyline-inputs.d.ts +144 -0
- package/lib/api/inputs/polyline-inputs.js +151 -0
- package/lib/api/inputs/recipes-inputs.d.ts +76 -0
- package/lib/api/inputs/recipes-inputs.js +74 -0
- package/lib/api/inputs/transforms-inputs.d.ts +34 -0
- package/lib/api/inputs/transforms-inputs.js +35 -0
- package/lib/api/keys/ansi-keys.constants.d.ts +3 -0
- package/lib/api/keys/ansi-keys.constants.js +16 -0
- package/lib/api/keys/ansi-keys.d.ts +3 -0
- package/lib/api/keys/ansi-keys.js +14 -0
- package/lib/api/keys/din-keys.constants.d.ts +3 -0
- package/lib/api/keys/din-keys.constants.js +14 -0
- package/lib/api/keys/din-keys.d.ts +3 -0
- package/lib/api/keys/din-keys.js +13 -0
- package/lib/api/keys/key-types.d.ts +17 -0
- package/lib/api/keys/key-types.js +1 -0
- package/lib/api/keys/keys.constants.d.ts +1 -0
- package/lib/api/keys/keys.constants.js +1 -0
- package/lib/api/knurls/ansi-knurls.constants.d.ts +4 -0
- package/lib/api/knurls/ansi-knurls.constants.js +8 -0
- package/lib/api/knurls/ansi-knurls.d.ts +3 -0
- package/lib/api/knurls/ansi-knurls.js +20 -0
- package/lib/api/knurls/din-knurls.constants.d.ts +2 -0
- package/lib/api/knurls/din-knurls.constants.js +2 -0
- package/lib/api/knurls/din-knurls.d.ts +3 -0
- package/lib/api/knurls/din-knurls.js +19 -0
- package/lib/api/knurls/knurl-types.d.ts +24 -0
- package/lib/api/knurls/knurl-types.js +1 -0
- package/lib/api/knurls/knurls.constants.d.ts +1 -0
- package/lib/api/knurls/knurls.constants.js +1 -0
- package/lib/api/knurls/knurls.d.ts +2 -0
- package/lib/api/knurls/knurls.js +9 -0
- package/lib/api/recipes/checks.d.ts +15 -0
- package/lib/api/recipes/checks.js +85 -0
- package/lib/api/recipes/limits.constants.d.ts +4 -0
- package/lib/api/recipes/limits.constants.js +4 -0
- package/lib/api/recipes/sources.d.ts +0 -13
- package/lib/api/recipes/sources.js +3 -15
- package/lib/api/recipes/surface-mesh.d.ts +0 -14
- package/lib/api/recipes/surface-mesh.js +8 -21
- package/lib/api/recipes/validate-brep.d.ts +2 -0
- package/lib/api/recipes/validate-brep.js +330 -0
- package/lib/api/recipes/validate.d.ts +0 -31
- package/lib/api/recipes/validate.js +7 -115
- package/lib/api/resolved-inputs/index.d.ts +80 -0
- package/lib/api/retaining-rings/ansi-retaining-rings.constants.d.ts +4 -0
- package/lib/api/retaining-rings/ansi-retaining-rings.constants.js +93 -0
- package/lib/api/retaining-rings/ansi-retaining-rings.d.ts +4 -0
- package/lib/api/retaining-rings/ansi-retaining-rings.js +20 -0
- package/lib/api/retaining-rings/din-retaining-rings.constants.d.ts +3 -0
- package/lib/api/retaining-rings/din-retaining-rings.constants.js +115 -0
- package/lib/api/retaining-rings/din-retaining-rings.d.ts +4 -0
- package/lib/api/retaining-rings/din-retaining-rings.js +20 -0
- package/lib/api/retaining-rings/retaining-ring-types.d.ts +30 -0
- package/lib/api/retaining-rings/retaining-ring-types.js +1 -0
- package/lib/api/retaining-rings/retaining-rings.constants.d.ts +1 -0
- package/lib/api/retaining-rings/retaining-rings.constants.js +1 -0
- package/lib/api/retaining-rings/retaining-rings.d.ts +2 -0
- package/lib/api/retaining-rings/retaining-rings.js +9 -0
- package/lib/api/services/base-bitbybit.d.ts +42 -0
- package/lib/api/services/base-bitbybit.js +43 -0
- package/lib/api/services/color.d.ts +35 -2
- package/lib/api/services/color.js +48 -12
- package/lib/api/services/engineering/engineering.d.ts +12 -0
- package/lib/api/services/engineering/engineering.js +13 -0
- package/lib/api/services/engineering/index.d.ts +2 -0
- package/lib/api/services/engineering/index.js +2 -0
- package/lib/api/services/engineering/mechanical/bearings-ansi.d.ts +40 -0
- package/lib/api/services/engineering/mechanical/bearings-ansi.js +47 -0
- package/lib/api/services/engineering/mechanical/bearings-iso.d.ts +39 -0
- package/lib/api/services/engineering/mechanical/bearings-iso.js +46 -0
- package/lib/api/services/engineering/mechanical/bearings.d.ts +14 -0
- package/lib/api/services/engineering/mechanical/bearings.js +15 -0
- package/lib/api/services/engineering/mechanical/fasteners-ansi.d.ts +109 -0
- package/lib/api/services/engineering/mechanical/fasteners-ansi.js +133 -0
- package/lib/api/services/engineering/mechanical/fasteners-iso.d.ts +123 -0
- package/lib/api/services/engineering/mechanical/fasteners-iso.js +151 -0
- package/lib/api/services/engineering/mechanical/fasteners.d.ts +13 -0
- package/lib/api/services/engineering/mechanical/fasteners.js +14 -0
- package/lib/api/services/engineering/mechanical/gears.d.ts +267 -0
- package/lib/api/services/engineering/mechanical/gears.js +318 -0
- package/lib/api/services/engineering/mechanical/index.d.ts +24 -0
- package/lib/api/services/engineering/mechanical/index.js +24 -0
- package/lib/api/services/engineering/mechanical/keys-ansi.d.ts +27 -0
- package/lib/api/services/engineering/mechanical/keys-ansi.js +32 -0
- package/lib/api/services/engineering/mechanical/keys-din.d.ts +26 -0
- package/lib/api/services/engineering/mechanical/keys-din.js +31 -0
- package/lib/api/services/engineering/mechanical/keys.d.ts +14 -0
- package/lib/api/services/engineering/mechanical/keys.js +15 -0
- package/lib/api/services/engineering/mechanical/knurls-ansi.d.ts +26 -0
- package/lib/api/services/engineering/mechanical/knurls-ansi.js +31 -0
- package/lib/api/services/engineering/mechanical/knurls-din.d.ts +26 -0
- package/lib/api/services/engineering/mechanical/knurls-din.js +31 -0
- package/lib/api/services/engineering/mechanical/knurls.d.ts +14 -0
- package/lib/api/services/engineering/mechanical/knurls.js +15 -0
- package/lib/api/services/engineering/mechanical/mechanical.d.ts +29 -0
- package/lib/api/services/engineering/mechanical/mechanical.js +30 -0
- package/lib/api/services/engineering/mechanical/retaining-rings-ansi.d.ts +43 -0
- package/lib/api/services/engineering/mechanical/retaining-rings-ansi.js +51 -0
- package/lib/api/services/engineering/mechanical/retaining-rings-din.d.ts +43 -0
- package/lib/api/services/engineering/mechanical/retaining-rings-din.js +51 -0
- package/lib/api/services/engineering/mechanical/retaining-rings.d.ts +13 -0
- package/lib/api/services/engineering/mechanical/retaining-rings.js +14 -0
- package/lib/api/services/engineering/mechanical/splines-ansi.d.ts +27 -0
- package/lib/api/services/engineering/mechanical/splines-ansi.js +32 -0
- package/lib/api/services/engineering/mechanical/splines-din.d.ts +26 -0
- package/lib/api/services/engineering/mechanical/splines-din.js +31 -0
- package/lib/api/services/engineering/mechanical/splines.d.ts +13 -0
- package/lib/api/services/engineering/mechanical/splines.js +14 -0
- package/lib/api/services/engineering/mechanical/springs.d.ts +27 -0
- package/lib/api/services/engineering/mechanical/springs.js +31 -0
- package/lib/api/services/engineering/mechanical/threads-ansi.d.ts +40 -0
- package/lib/api/services/engineering/mechanical/threads-ansi.js +48 -0
- package/lib/api/services/engineering/mechanical/threads-iso.d.ts +40 -0
- package/lib/api/services/engineering/mechanical/threads-iso.js +48 -0
- package/lib/api/services/engineering/mechanical/threads.d.ts +13 -0
- package/lib/api/services/engineering/mechanical/threads.js +14 -0
- package/lib/api/services/frame.js +3 -3
- package/lib/api/services/geometry-helper.js +8 -111
- package/lib/api/services/helpers/color/color-space.d.ts +2 -0
- package/lib/api/services/helpers/color/color-space.js +12 -0
- package/lib/api/services/helpers/{nurbs.d.ts → curves/nurbs.d.ts} +1 -1
- package/lib/api/services/helpers/{surface-triangulation.d.ts → curves/surface-triangulation.d.ts} +2 -2
- package/lib/api/services/helpers/{surface-triangulation.js → curves/surface-triangulation.js} +14 -8
- package/lib/api/services/helpers/{dxf → files/dxf}/dxf-generator.d.ts +2 -1
- package/lib/api/services/helpers/{dxf → files/dxf}/dxf-generator.js +19 -5
- package/lib/api/services/helpers/files/dxf/dxf.constants.d.ts +4 -0
- package/lib/api/services/helpers/files/dxf/dxf.constants.js +4 -0
- package/lib/api/services/helpers/{dxf → files/dxf}/dxf.d.ts +1 -1
- package/lib/api/services/helpers/{dxf → files/dxf}/dxf.js +2 -2
- package/lib/api/services/helpers/files/glb.constants.d.ts +11 -0
- package/lib/api/services/helpers/files/glb.constants.js +11 -0
- package/lib/api/services/helpers/files/glb.d.ts +1 -0
- package/lib/api/services/helpers/files/glb.js +69 -0
- package/lib/api/services/helpers/files/gzip.constants.d.ts +11 -0
- package/lib/api/services/helpers/files/gzip.constants.js +11 -0
- package/lib/api/services/helpers/files/gzip.d.ts +2 -0
- package/lib/api/services/helpers/files/gzip.js +50 -0
- package/lib/api/services/helpers/{inflate.constants.d.ts → files/inflate.constants.d.ts} +2 -0
- package/lib/api/services/helpers/{inflate.constants.js → files/inflate.constants.js} +2 -0
- package/lib/api/services/helpers/{inflate.d.ts → files/inflate.d.ts} +2 -2
- package/lib/api/services/helpers/{inflate.js → files/inflate.js} +16 -7
- package/lib/api/services/helpers/{zip.constants.d.ts → files/zip.constants.d.ts} +8 -0
- package/lib/api/services/helpers/{zip.constants.js → files/zip.constants.js} +8 -0
- package/lib/api/services/helpers/files/zip.d.ts +8 -0
- package/lib/api/services/helpers/files/zip.js +226 -0
- package/lib/api/services/helpers/geometry/arcs.d.ts +9 -0
- package/lib/api/services/helpers/{arcs.js → geometry/arcs.js} +7 -0
- package/lib/api/services/helpers/{frame-axes.d.ts → geometry/frame-axes.d.ts} +8 -5
- package/lib/api/services/helpers/{frame-axes.js → geometry/frame-axes.js} +21 -9
- package/lib/api/services/helpers/geometry/lengths.constants.d.ts +4 -0
- package/lib/api/services/helpers/geometry/lengths.constants.js +3 -0
- package/lib/api/services/helpers/geometry/lengths.d.ts +7 -0
- package/lib/api/services/helpers/geometry/lengths.js +20 -0
- package/lib/api/services/helpers/geometry/matrices.constants.d.ts +8 -0
- package/lib/api/services/helpers/geometry/matrices.constants.js +7 -0
- package/lib/api/services/helpers/geometry/matrices.d.ts +17 -0
- package/lib/api/services/helpers/{matrices.js → geometry/matrices.js} +28 -17
- package/lib/api/services/helpers/{paths.d.ts → geometry/paths.d.ts} +2 -1
- package/lib/api/services/helpers/{paths.js → geometry/paths.js} +36 -30
- package/lib/api/services/helpers/{polygons.d.ts → geometry/polygons.d.ts} +1 -1
- package/lib/api/services/helpers/geometry/polygons.js +111 -0
- package/lib/api/services/helpers/geometry/scalars.d.ts +9 -0
- package/lib/api/services/helpers/geometry/scalars.js +34 -0
- package/lib/api/services/helpers/{triangulation.js → geometry/triangulation.js} +11 -6
- package/lib/api/services/helpers/geometry/vector-grid.d.ts +12 -0
- package/lib/api/services/helpers/geometry/vector-grid.js +149 -0
- package/lib/api/services/helpers/{vectors.d.ts → geometry/vectors.d.ts} +8 -1
- package/lib/api/services/helpers/geometry/vectors.js +43 -0
- package/lib/api/services/helpers/helper-types.d.ts +77 -0
- package/lib/api/services/helpers/mesh/mesh-normals.d.ts +21 -0
- package/lib/api/services/helpers/{mesh-normals.js → mesh/mesh-normals.js} +54 -65
- package/lib/api/services/helpers/mesh/mesh-orientation.d.ts +24 -0
- package/lib/api/services/helpers/mesh/mesh-orientation.js +104 -0
- package/lib/api/services/helpers/{mesh-primitives.d.ts → mesh/mesh-primitives.d.ts} +1 -1
- package/lib/api/services/helpers/{mesh-primitives.js → mesh/mesh-primitives.js} +6 -5
- package/lib/api/services/helpers/mesh/mesh-proximity.constants.d.ts +7 -0
- package/lib/api/services/helpers/mesh/mesh-proximity.constants.js +11 -0
- package/lib/api/services/helpers/mesh/mesh-proximity.d.ts +11 -0
- package/lib/api/services/helpers/mesh/mesh-proximity.js +382 -0
- package/lib/api/services/index.d.ts +3 -0
- package/lib/api/services/index.js +3 -0
- package/lib/api/services/io.d.ts +1 -1
- package/lib/api/services/io.js +1 -1
- package/lib/api/services/line.js +2 -3
- package/lib/api/services/math.d.ts +47 -0
- package/lib/api/services/math.js +77 -10
- package/lib/api/services/mesh.d.ts +174 -2
- package/lib/api/services/mesh.js +305 -7
- package/lib/api/services/point.js +4 -10
- package/lib/api/services/polyline-types.d.ts +6 -0
- package/lib/api/services/polyline-types.js +1 -0
- package/lib/api/services/polyline.d.ts +163 -1
- package/lib/api/services/polyline.js +270 -13
- package/lib/api/services/recipes.d.ts +80 -0
- package/lib/api/services/recipes.js +107 -0
- package/lib/api/services/transforms.d.ts +74 -2
- package/lib/api/services/transforms.js +100 -3
- package/lib/api/services/vector.d.ts +4 -3
- package/lib/api/services/vector.js +14 -14
- package/lib/api/splines/ansi-splines.constants.d.ts +9 -0
- package/lib/api/splines/ansi-splines.constants.js +9 -0
- package/lib/api/splines/ansi-splines.d.ts +3 -0
- package/lib/api/splines/ansi-splines.js +28 -0
- package/lib/api/splines/din-splines.constants.d.ts +12 -0
- package/lib/api/splines/din-splines.constants.js +12 -0
- package/lib/api/splines/din-splines.d.ts +3 -0
- package/lib/api/splines/din-splines.js +38 -0
- package/lib/api/splines/spline-types.d.ts +32 -0
- package/lib/api/splines/spline-types.js +1 -0
- package/lib/api/splines/splines.constants.d.ts +1 -0
- package/lib/api/splines/splines.constants.js +1 -0
- package/lib/api/springs/spring-types.d.ts +26 -0
- package/lib/api/springs/spring-types.js +1 -0
- package/lib/api/springs/springs.constants.d.ts +9 -0
- package/lib/api/springs/springs.constants.js +9 -0
- package/lib/api/springs/springs.d.ts +2 -0
- package/lib/api/springs/springs.js +50 -0
- package/lib/api/threads/ansi-threads.constants.d.ts +6 -0
- package/lib/api/threads/ansi-threads.constants.js +27 -0
- package/lib/api/threads/ansi-threads.d.ts +4 -0
- package/lib/api/threads/ansi-threads.js +50 -0
- package/lib/api/threads/iso-threads.constants.d.ts +5 -0
- package/lib/api/threads/iso-threads.constants.js +20 -0
- package/lib/api/threads/iso-threads.d.ts +4 -0
- package/lib/api/threads/iso-threads.js +32 -0
- package/lib/api/threads/thread-profile.constants.d.ts +3 -0
- package/lib/api/threads/thread-profile.constants.js +3 -0
- package/lib/api/threads/thread-types.d.ts +66 -0
- package/lib/api/threads/thread-types.js +1 -0
- package/package.json +1 -1
- package/lib/api/recipes/index.d.ts +0 -4
- package/lib/api/recipes/index.js +0 -3
- package/lib/api/services/helpers/arcs.d.ts +0 -6
- package/lib/api/services/helpers/matrices.constants.d.ts +0 -2
- package/lib/api/services/helpers/matrices.constants.js +0 -2
- package/lib/api/services/helpers/matrices.d.ts +0 -25
- package/lib/api/services/helpers/mesh-normals.d.ts +0 -11
- package/lib/api/services/helpers/polygons.js +0 -59
- package/lib/api/services/helpers/vectors.js +0 -17
- package/lib/api/services/helpers/zip.d.ts +0 -4
- package/lib/api/services/helpers/zip.js +0 -89
- /package/lib/api/services/helpers/{nurbs.js → curves/nurbs.js} +0 -0
- /package/lib/api/services/helpers/{crc32.d.ts → files/crc32.d.ts} +0 -0
- /package/lib/api/services/helpers/{crc32.js → files/crc32.js} +0 -0
- /package/lib/api/services/helpers/{triangulation.d.ts → geometry/triangulation.d.ts} +0 -0
- /package/lib/api/services/helpers/{mesh-measures.d.ts → mesh/mesh-measures.d.ts} +0 -0
- /package/lib/api/services/helpers/{mesh-measures.js → mesh/mesh-measures.js} +0 -0
- /package/lib/api/services/helpers/{mesh-primitives.constants.d.ts → mesh/mesh-primitives.constants.d.ts} +0 -0
- /package/lib/api/services/helpers/{mesh-primitives.constants.js → mesh/mesh-primitives.constants.js} +0 -0
|
@@ -249,4 +249,148 @@ export declare namespace Polyline {
|
|
|
249
249
|
*/
|
|
250
250
|
tolerance?: number | undefined;
|
|
251
251
|
}
|
|
252
|
+
/**
|
|
253
|
+
* A flat outline for `polyline.signedArea2d`, `polyline.perimeter2d` and the other 2D polygon
|
|
254
|
+
* methods: its points in order, the last joining back to the first.
|
|
255
|
+
*/
|
|
256
|
+
class Polygon2Dto {
|
|
257
|
+
constructor(points?: Base.Point2[]);
|
|
258
|
+
/**
|
|
259
|
+
* The outline's corners in order; the last joins back to the first.
|
|
260
|
+
* @default undefined
|
|
261
|
+
*/
|
|
262
|
+
points: Base.Point2[];
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* A flat outline and a point for `polyline.isPointInside2d`.
|
|
266
|
+
*/
|
|
267
|
+
class PointInPolygon2Dto {
|
|
268
|
+
constructor(points?: Base.Point2[], point?: Base.Point2);
|
|
269
|
+
/**
|
|
270
|
+
* The outline's corners in order; the last joins back to the first.
|
|
271
|
+
* @default undefined
|
|
272
|
+
*/
|
|
273
|
+
points: Base.Point2[];
|
|
274
|
+
/**
|
|
275
|
+
* The point to test.
|
|
276
|
+
* @default undefined
|
|
277
|
+
*/
|
|
278
|
+
point: Base.Point2;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* A flat outline and the way `polyline.orient2d` should make it run.
|
|
282
|
+
*/
|
|
283
|
+
class OrientPolygon2Dto {
|
|
284
|
+
constructor(points?: Base.Point2[], counterClockwise?: boolean);
|
|
285
|
+
/**
|
|
286
|
+
* The outline's corners in order; the last joins back to the first.
|
|
287
|
+
* @default undefined
|
|
288
|
+
*/
|
|
289
|
+
points: Base.Point2[];
|
|
290
|
+
/**
|
|
291
|
+
* When true the outline is made to run counter-clockwise, when false clockwise.
|
|
292
|
+
* @default true
|
|
293
|
+
*/
|
|
294
|
+
counterClockwise?: boolean | undefined;
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* A flat outline and the arcs `polyline.roundCorners2d` rounds its corners with.
|
|
298
|
+
*/
|
|
299
|
+
class RoundPolygon2Dto {
|
|
300
|
+
constructor(points?: Base.Point2[], radius?: number, radiusList?: number[], segments?: number);
|
|
301
|
+
/**
|
|
302
|
+
* The outline's corners in order; the last joins back to the first.
|
|
303
|
+
* @default undefined
|
|
304
|
+
*/
|
|
305
|
+
points: Base.Point2[];
|
|
306
|
+
/**
|
|
307
|
+
* The radius every corner is rounded with; 0 leaves corners sharp.
|
|
308
|
+
* @default 1
|
|
309
|
+
* @minimum 0
|
|
310
|
+
* @maximum Infinity
|
|
311
|
+
* @step 0.1
|
|
312
|
+
*/
|
|
313
|
+
radius?: number | undefined;
|
|
314
|
+
/**
|
|
315
|
+
* A radius per corner, in the order of `points`, used instead of `radius` when given.
|
|
316
|
+
* @default undefined
|
|
317
|
+
* @optional true
|
|
318
|
+
*/
|
|
319
|
+
radiusList?: number[] | undefined;
|
|
320
|
+
/**
|
|
321
|
+
* How many straight pieces draw a quarter turn of arc; a smaller turn takes fewer.
|
|
322
|
+
* @default 8
|
|
323
|
+
* @minimum 1
|
|
324
|
+
* @maximum Infinity
|
|
325
|
+
* @step 1
|
|
326
|
+
*/
|
|
327
|
+
segments?: number | undefined;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* A path and, optionally, the directions it starts and ends in, for `polyline.tangents`.
|
|
331
|
+
*/
|
|
332
|
+
class PolylineTangentsDto {
|
|
333
|
+
constructor(polyline?: PolylinePropertiesDto, startTangent?: Base.Vector3, endTangent?: Base.Vector3);
|
|
334
|
+
/**
|
|
335
|
+
* The path, an open polyline of at least two points; one with `isClosed` set is refused.
|
|
336
|
+
* @default undefined
|
|
337
|
+
*/
|
|
338
|
+
polyline: PolylinePropertiesDto;
|
|
339
|
+
/**
|
|
340
|
+
* The direction at the first point; left out, the first segment's.
|
|
341
|
+
* @default undefined
|
|
342
|
+
* @optional true
|
|
343
|
+
*/
|
|
344
|
+
startTangent?: Base.Vector3 | undefined;
|
|
345
|
+
/**
|
|
346
|
+
* The direction at the last point; left out, the last segment's.
|
|
347
|
+
* @default undefined
|
|
348
|
+
* @optional true
|
|
349
|
+
*/
|
|
350
|
+
endTangent?: Base.Vector3 | undefined;
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* A path and the direction a profile's X axis starts in, for `polyline.sweepFrames` and
|
|
354
|
+
* `polyline.sweepPlacements`.
|
|
355
|
+
*/
|
|
356
|
+
class PolylineSweepDto {
|
|
357
|
+
constructor(polyline?: PolylinePropertiesDto, firstDirection?: Base.Vector3);
|
|
358
|
+
/**
|
|
359
|
+
* The path, an open polyline of at least two points; one with `isClosed` set is refused.
|
|
360
|
+
* @default undefined
|
|
361
|
+
*/
|
|
362
|
+
polyline: PolylinePropertiesDto;
|
|
363
|
+
/**
|
|
364
|
+
* Roughly where the profile's X axis points at the start; it is turned square to the path.
|
|
365
|
+
* @default [1, 0, 0]
|
|
366
|
+
*/
|
|
367
|
+
firstDirection?: Base.Vector3 | undefined;
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* A path and the arcs `polyline.roundCorners` rounds its corners with.
|
|
371
|
+
*/
|
|
372
|
+
class RoundPolylineDto {
|
|
373
|
+
constructor(polyline?: PolylinePropertiesDto, radius?: number, segments?: number);
|
|
374
|
+
/**
|
|
375
|
+
* The path, an open polyline of at least two points; one with `isClosed` set is refused.
|
|
376
|
+
* @default undefined
|
|
377
|
+
*/
|
|
378
|
+
polyline: PolylinePropertiesDto;
|
|
379
|
+
/**
|
|
380
|
+
* The radius each corner is rounded with; it shrinks where the segments beside it are short.
|
|
381
|
+
* @default 1
|
|
382
|
+
* @minimum 0
|
|
383
|
+
* @maximum Infinity
|
|
384
|
+
* @step 0.1
|
|
385
|
+
*/
|
|
386
|
+
radius?: number | undefined;
|
|
387
|
+
/**
|
|
388
|
+
* How many straight pieces draw a quarter turn of arc; a smaller turn takes fewer.
|
|
389
|
+
* @default 8
|
|
390
|
+
* @minimum 1
|
|
391
|
+
* @maximum Infinity
|
|
392
|
+
* @step 1
|
|
393
|
+
*/
|
|
394
|
+
segments?: number | undefined;
|
|
395
|
+
}
|
|
252
396
|
}
|
|
@@ -266,4 +266,155 @@ export var Polyline;
|
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
268
|
Polyline.TwoPolylinesToleranceDto = TwoPolylinesToleranceDto;
|
|
269
|
+
/**
|
|
270
|
+
* A flat outline for `polyline.signedArea2d`, `polyline.perimeter2d` and the other 2D polygon
|
|
271
|
+
* methods: its points in order, the last joining back to the first.
|
|
272
|
+
*/
|
|
273
|
+
class Polygon2Dto {
|
|
274
|
+
constructor(points) {
|
|
275
|
+
if (points !== undefined) {
|
|
276
|
+
this.points = points;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
Polyline.Polygon2Dto = Polygon2Dto;
|
|
281
|
+
/**
|
|
282
|
+
* A flat outline and a point for `polyline.isPointInside2d`.
|
|
283
|
+
*/
|
|
284
|
+
class PointInPolygon2Dto {
|
|
285
|
+
constructor(points, point) {
|
|
286
|
+
if (points !== undefined) {
|
|
287
|
+
this.points = points;
|
|
288
|
+
}
|
|
289
|
+
if (point !== undefined) {
|
|
290
|
+
this.point = point;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
Polyline.PointInPolygon2Dto = PointInPolygon2Dto;
|
|
295
|
+
/**
|
|
296
|
+
* A flat outline and the way `polyline.orient2d` should make it run.
|
|
297
|
+
*/
|
|
298
|
+
class OrientPolygon2Dto {
|
|
299
|
+
constructor(points, counterClockwise) {
|
|
300
|
+
/**
|
|
301
|
+
* When true the outline is made to run counter-clockwise, when false clockwise.
|
|
302
|
+
* @default true
|
|
303
|
+
*/
|
|
304
|
+
this.counterClockwise = true;
|
|
305
|
+
if (points !== undefined) {
|
|
306
|
+
this.points = points;
|
|
307
|
+
}
|
|
308
|
+
if (counterClockwise !== undefined) {
|
|
309
|
+
this.counterClockwise = counterClockwise;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
Polyline.OrientPolygon2Dto = OrientPolygon2Dto;
|
|
314
|
+
/**
|
|
315
|
+
* A flat outline and the arcs `polyline.roundCorners2d` rounds its corners with.
|
|
316
|
+
*/
|
|
317
|
+
class RoundPolygon2Dto {
|
|
318
|
+
constructor(points, radius, radiusList, segments) {
|
|
319
|
+
/**
|
|
320
|
+
* The radius every corner is rounded with; 0 leaves corners sharp.
|
|
321
|
+
* @default 1
|
|
322
|
+
* @minimum 0
|
|
323
|
+
* @maximum Infinity
|
|
324
|
+
* @step 0.1
|
|
325
|
+
*/
|
|
326
|
+
this.radius = 1;
|
|
327
|
+
/**
|
|
328
|
+
* How many straight pieces draw a quarter turn of arc; a smaller turn takes fewer.
|
|
329
|
+
* @default 8
|
|
330
|
+
* @minimum 1
|
|
331
|
+
* @maximum Infinity
|
|
332
|
+
* @step 1
|
|
333
|
+
*/
|
|
334
|
+
this.segments = 8;
|
|
335
|
+
if (points !== undefined) {
|
|
336
|
+
this.points = points;
|
|
337
|
+
}
|
|
338
|
+
if (radius !== undefined) {
|
|
339
|
+
this.radius = radius;
|
|
340
|
+
}
|
|
341
|
+
if (radiusList !== undefined) {
|
|
342
|
+
this.radiusList = radiusList;
|
|
343
|
+
}
|
|
344
|
+
if (segments !== undefined) {
|
|
345
|
+
this.segments = segments;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
Polyline.RoundPolygon2Dto = RoundPolygon2Dto;
|
|
350
|
+
/**
|
|
351
|
+
* A path and, optionally, the directions it starts and ends in, for `polyline.tangents`.
|
|
352
|
+
*/
|
|
353
|
+
class PolylineTangentsDto {
|
|
354
|
+
constructor(polyline, startTangent, endTangent) {
|
|
355
|
+
if (polyline !== undefined) {
|
|
356
|
+
this.polyline = polyline;
|
|
357
|
+
}
|
|
358
|
+
if (startTangent !== undefined) {
|
|
359
|
+
this.startTangent = startTangent;
|
|
360
|
+
}
|
|
361
|
+
if (endTangent !== undefined) {
|
|
362
|
+
this.endTangent = endTangent;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
Polyline.PolylineTangentsDto = PolylineTangentsDto;
|
|
367
|
+
/**
|
|
368
|
+
* A path and the direction a profile's X axis starts in, for `polyline.sweepFrames` and
|
|
369
|
+
* `polyline.sweepPlacements`.
|
|
370
|
+
*/
|
|
371
|
+
class PolylineSweepDto {
|
|
372
|
+
constructor(polyline, firstDirection) {
|
|
373
|
+
/**
|
|
374
|
+
* Roughly where the profile's X axis points at the start; it is turned square to the path.
|
|
375
|
+
* @default [1, 0, 0]
|
|
376
|
+
*/
|
|
377
|
+
this.firstDirection = [1, 0, 0];
|
|
378
|
+
if (polyline !== undefined) {
|
|
379
|
+
this.polyline = polyline;
|
|
380
|
+
}
|
|
381
|
+
if (firstDirection !== undefined) {
|
|
382
|
+
this.firstDirection = firstDirection;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
Polyline.PolylineSweepDto = PolylineSweepDto;
|
|
387
|
+
/**
|
|
388
|
+
* A path and the arcs `polyline.roundCorners` rounds its corners with.
|
|
389
|
+
*/
|
|
390
|
+
class RoundPolylineDto {
|
|
391
|
+
constructor(polyline, radius, segments) {
|
|
392
|
+
/**
|
|
393
|
+
* The radius each corner is rounded with; it shrinks where the segments beside it are short.
|
|
394
|
+
* @default 1
|
|
395
|
+
* @minimum 0
|
|
396
|
+
* @maximum Infinity
|
|
397
|
+
* @step 0.1
|
|
398
|
+
*/
|
|
399
|
+
this.radius = 1;
|
|
400
|
+
/**
|
|
401
|
+
* How many straight pieces draw a quarter turn of arc; a smaller turn takes fewer.
|
|
402
|
+
* @default 8
|
|
403
|
+
* @minimum 1
|
|
404
|
+
* @maximum Infinity
|
|
405
|
+
* @step 1
|
|
406
|
+
*/
|
|
407
|
+
this.segments = 8;
|
|
408
|
+
if (polyline !== undefined) {
|
|
409
|
+
this.polyline = polyline;
|
|
410
|
+
}
|
|
411
|
+
if (radius !== undefined) {
|
|
412
|
+
this.radius = radius;
|
|
413
|
+
}
|
|
414
|
+
if (segments !== undefined) {
|
|
415
|
+
this.segments = segments;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
Polyline.RoundPolylineDto = RoundPolylineDto;
|
|
269
420
|
})(Polyline || (Polyline = {}));
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { Base } from "./base-inputs";
|
|
2
|
+
/**
|
|
3
|
+
* Parameters for working with recipes without a CAD kernel: the recipe to check or read, the roots
|
|
4
|
+
* to draw as meshes, and the node to follow. Experimental: the recipe format may still change before
|
|
5
|
+
* it is declared stable.
|
|
6
|
+
* @beta
|
|
7
|
+
*/
|
|
8
|
+
export declare namespace Recipes {
|
|
9
|
+
/**
|
|
10
|
+
* A recipe for `recipes.check` and `recipes.read`, as it came from a file, another thread or a
|
|
11
|
+
* caller.
|
|
12
|
+
* @beta
|
|
13
|
+
*/
|
|
14
|
+
class RecipeDto {
|
|
15
|
+
constructor(recipe?: Base.Recipe);
|
|
16
|
+
/**
|
|
17
|
+
* The recipe: steps such as polygons, extrusions and cuts, and the roots to build from them;
|
|
18
|
+
* its buffers may be typed arrays or, as JSON holds them, lists of numbers.
|
|
19
|
+
* @default undefined
|
|
20
|
+
*/
|
|
21
|
+
recipe: Base.Recipe;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A recipe for `recipes.surfaceMeshes`, which gives the roots made of triangle meshes alone as
|
|
25
|
+
* meshes, with which roots to read and whether Z turns into Y.
|
|
26
|
+
* @beta
|
|
27
|
+
*/
|
|
28
|
+
class RecipeSurfaceMeshesDto {
|
|
29
|
+
constructor(recipe?: Base.Recipe, roots?: number[], adjustZtoY?: boolean);
|
|
30
|
+
/**
|
|
31
|
+
* The recipe: steps such as polygons, extrusions and triangle meshes, and the roots to build
|
|
32
|
+
* from them.
|
|
33
|
+
* @default undefined
|
|
34
|
+
*/
|
|
35
|
+
recipe: Base.Recipe;
|
|
36
|
+
/**
|
|
37
|
+
* The positions of the roots to read; every root when left out.
|
|
38
|
+
* @default undefined
|
|
39
|
+
* @optional true
|
|
40
|
+
*/
|
|
41
|
+
roots?: number[] | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* When true, each mesh turns a quarter turn about X, as a kernel's recipe build does with
|
|
44
|
+
* this option: `(x, y, z)` becomes `(x, z, -y)`.
|
|
45
|
+
* @default false
|
|
46
|
+
*/
|
|
47
|
+
adjustZtoY?: boolean | undefined;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* A node of a recipe for `recipes.sourceOf`, which follows it through the transforms that only
|
|
51
|
+
* turn and move to the step it places, with the matrix that places the node.
|
|
52
|
+
* @beta
|
|
53
|
+
*/
|
|
54
|
+
class RecipeSourceDto {
|
|
55
|
+
constructor(recipe?: Base.Recipe, node?: number, matrix?: Base.TransformMatrix);
|
|
56
|
+
/**
|
|
57
|
+
* The recipe the node belongs to, as `recipes.read` gives it; one without `nodes` is refused.
|
|
58
|
+
* @default undefined
|
|
59
|
+
*/
|
|
60
|
+
recipe: Base.Recipe;
|
|
61
|
+
/**
|
|
62
|
+
* The position of the node to follow in the recipe's nodes, such as a root's `node`.
|
|
63
|
+
* @default 0
|
|
64
|
+
* @minimum 0
|
|
65
|
+
* @maximum Infinity
|
|
66
|
+
* @step 1
|
|
67
|
+
*/
|
|
68
|
+
node?: number | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* What places the node, as a column-major 4 x 4 matrix of 16 finite numbers, such as its
|
|
71
|
+
* root's `matrix`; anything else is refused.
|
|
72
|
+
* @default undefined
|
|
73
|
+
*/
|
|
74
|
+
matrix: Base.TransformMatrix;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parameters for working with recipes without a CAD kernel: the recipe to check or read, the roots
|
|
3
|
+
* to draw as meshes, and the node to follow. Experimental: the recipe format may still change before
|
|
4
|
+
* it is declared stable.
|
|
5
|
+
* @beta
|
|
6
|
+
*/
|
|
7
|
+
export var Recipes;
|
|
8
|
+
(function (Recipes) {
|
|
9
|
+
/**
|
|
10
|
+
* A recipe for `recipes.check` and `recipes.read`, as it came from a file, another thread or a
|
|
11
|
+
* caller.
|
|
12
|
+
* @beta
|
|
13
|
+
*/
|
|
14
|
+
class RecipeDto {
|
|
15
|
+
constructor(recipe) {
|
|
16
|
+
if (recipe !== undefined) {
|
|
17
|
+
this.recipe = recipe;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
Recipes.RecipeDto = RecipeDto;
|
|
22
|
+
/**
|
|
23
|
+
* A recipe for `recipes.surfaceMeshes`, which gives the roots made of triangle meshes alone as
|
|
24
|
+
* meshes, with which roots to read and whether Z turns into Y.
|
|
25
|
+
* @beta
|
|
26
|
+
*/
|
|
27
|
+
class RecipeSurfaceMeshesDto {
|
|
28
|
+
constructor(recipe, roots, adjustZtoY) {
|
|
29
|
+
/**
|
|
30
|
+
* When true, each mesh turns a quarter turn about X, as a kernel's recipe build does with
|
|
31
|
+
* this option: `(x, y, z)` becomes `(x, z, -y)`.
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
this.adjustZtoY = false;
|
|
35
|
+
if (recipe !== undefined) {
|
|
36
|
+
this.recipe = recipe;
|
|
37
|
+
}
|
|
38
|
+
if (roots !== undefined) {
|
|
39
|
+
this.roots = roots;
|
|
40
|
+
}
|
|
41
|
+
if (adjustZtoY !== undefined) {
|
|
42
|
+
this.adjustZtoY = adjustZtoY;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
Recipes.RecipeSurfaceMeshesDto = RecipeSurfaceMeshesDto;
|
|
47
|
+
/**
|
|
48
|
+
* A node of a recipe for `recipes.sourceOf`, which follows it through the transforms that only
|
|
49
|
+
* turn and move to the step it places, with the matrix that places the node.
|
|
50
|
+
* @beta
|
|
51
|
+
*/
|
|
52
|
+
class RecipeSourceDto {
|
|
53
|
+
constructor(recipe, node, matrix) {
|
|
54
|
+
/**
|
|
55
|
+
* The position of the node to follow in the recipe's nodes, such as a root's `node`.
|
|
56
|
+
* @default 0
|
|
57
|
+
* @minimum 0
|
|
58
|
+
* @maximum Infinity
|
|
59
|
+
* @step 1
|
|
60
|
+
*/
|
|
61
|
+
this.node = 0;
|
|
62
|
+
if (recipe !== undefined) {
|
|
63
|
+
this.recipe = recipe;
|
|
64
|
+
}
|
|
65
|
+
if (node !== undefined) {
|
|
66
|
+
this.node = node;
|
|
67
|
+
}
|
|
68
|
+
if (matrix !== undefined) {
|
|
69
|
+
this.matrix = matrix;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
Recipes.RecipeSourceDto = RecipeSourceDto;
|
|
74
|
+
})(Recipes || (Recipes = {}));
|
|
@@ -199,4 +199,38 @@ export declare namespace Transforms {
|
|
|
199
199
|
*/
|
|
200
200
|
translations: Base.Vector3[];
|
|
201
201
|
}
|
|
202
|
+
/**
|
|
203
|
+
* A transformation for `transforms.combine`, `transforms.rigidInverse` and
|
|
204
|
+
* `transforms.determinant`: one matrix, or a list of them applied in order.
|
|
205
|
+
*/
|
|
206
|
+
class TransformationDto {
|
|
207
|
+
constructor(transformation?: Base.TransformMatrixes);
|
|
208
|
+
/**
|
|
209
|
+
* A transformation matrix, or a list of them applied in order; a list of such lists is
|
|
210
|
+
* applied one list after another, as `point.transformPoints` takes it.
|
|
211
|
+
* @default undefined
|
|
212
|
+
*/
|
|
213
|
+
transformation: Base.TransformMatrixes;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* A transformation and how far from exact `transforms.isRigid` lets it be.
|
|
217
|
+
*/
|
|
218
|
+
class TransformationToleranceDto {
|
|
219
|
+
constructor(transformation?: Base.TransformMatrixes, tolerance?: number);
|
|
220
|
+
/**
|
|
221
|
+
* A transformation matrix, or a list of them applied in order; a list of such lists is
|
|
222
|
+
* applied one list after another, as `point.transformPoints` takes it.
|
|
223
|
+
* @default undefined
|
|
224
|
+
*/
|
|
225
|
+
transformation: Base.TransformMatrixes;
|
|
226
|
+
/**
|
|
227
|
+
* How far each axis may be from length 1, and from square to the others, for the
|
|
228
|
+
* transformation to still count as rigid.
|
|
229
|
+
* @default 1e-7
|
|
230
|
+
* @minimum 0
|
|
231
|
+
* @maximum Infinity
|
|
232
|
+
* @step 0.0000001
|
|
233
|
+
*/
|
|
234
|
+
tolerance?: number | undefined;
|
|
235
|
+
}
|
|
202
236
|
}
|
|
@@ -274,4 +274,39 @@ export var Transforms;
|
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
Transforms.TranslationsXYZDto = TranslationsXYZDto;
|
|
277
|
+
/**
|
|
278
|
+
* A transformation for `transforms.combine`, `transforms.rigidInverse` and
|
|
279
|
+
* `transforms.determinant`: one matrix, or a list of them applied in order.
|
|
280
|
+
*/
|
|
281
|
+
class TransformationDto {
|
|
282
|
+
constructor(transformation) {
|
|
283
|
+
if (transformation !== undefined) {
|
|
284
|
+
this.transformation = transformation;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
Transforms.TransformationDto = TransformationDto;
|
|
289
|
+
/**
|
|
290
|
+
* A transformation and how far from exact `transforms.isRigid` lets it be.
|
|
291
|
+
*/
|
|
292
|
+
class TransformationToleranceDto {
|
|
293
|
+
constructor(transformation, tolerance) {
|
|
294
|
+
/**
|
|
295
|
+
* How far each axis may be from length 1, and from square to the others, for the
|
|
296
|
+
* transformation to still count as rigid.
|
|
297
|
+
* @default 1e-7
|
|
298
|
+
* @minimum 0
|
|
299
|
+
* @maximum Infinity
|
|
300
|
+
* @step 0.0000001
|
|
301
|
+
*/
|
|
302
|
+
this.tolerance = 1e-7;
|
|
303
|
+
if (transformation !== undefined) {
|
|
304
|
+
this.transformation = transformation;
|
|
305
|
+
}
|
|
306
|
+
if (tolerance !== undefined) {
|
|
307
|
+
this.tolerance = tolerance;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
Transforms.TransformationToleranceDto = TransformationToleranceDto;
|
|
277
312
|
})(Transforms || (Transforms = {}));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const ANSI_PARALLEL_KEYS = [
|
|
2
|
+
{ upTo: 0.4375, width: 0.09375, height: 0.09375, shaftDepth: 0.046875, hubDepth: 0.051875 },
|
|
3
|
+
{ upTo: 0.5625, width: 0.125, height: 0.125, shaftDepth: 0.0625, hubDepth: 0.0675 },
|
|
4
|
+
{ upTo: 0.875, width: 0.1875, height: 0.1875, shaftDepth: 0.09375, hubDepth: 0.09875 },
|
|
5
|
+
{ upTo: 1.25, width: 0.25, height: 0.25, shaftDepth: 0.125, hubDepth: 0.13 },
|
|
6
|
+
{ upTo: 1.375, width: 0.3125, height: 0.3125, shaftDepth: 0.15625, hubDepth: 0.16125 },
|
|
7
|
+
{ upTo: 1.75, width: 0.375, height: 0.375, shaftDepth: 0.1875, hubDepth: 0.1925 },
|
|
8
|
+
{ upTo: 2.25, width: 0.5, height: 0.5, shaftDepth: 0.25, hubDepth: 0.255 },
|
|
9
|
+
{ upTo: 2.75, width: 0.625, height: 0.625, shaftDepth: 0.3125, hubDepth: 0.3175 },
|
|
10
|
+
{ upTo: 3.25, width: 0.75, height: 0.75, shaftDepth: 0.375, hubDepth: 0.38 },
|
|
11
|
+
{ upTo: 3.75, width: 0.875, height: 0.875, shaftDepth: 0.4375, hubDepth: 0.4425 },
|
|
12
|
+
{ upTo: 4.5, width: 1, height: 1, shaftDepth: 0.5, hubDepth: 0.505 },
|
|
13
|
+
{ upTo: 5.5, width: 1.25, height: 1.25, shaftDepth: 0.625, hubDepth: 0.63 },
|
|
14
|
+
{ upTo: 6.5, width: 1.5, height: 1.5, shaftDepth: 0.75, hubDepth: 0.755 },
|
|
15
|
+
];
|
|
16
|
+
export const ANSI_SMALLEST_KEYED_SHAFT = 0.3125;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { InputError } from "../kernel-calls/errors";
|
|
2
|
+
import { lengthsConverted, snappedLength, tableLength } from "../services/helpers/geometry/lengths";
|
|
3
|
+
import { ANSI_PARALLEL_KEYS, ANSI_SMALLEST_KEYED_SHAFT } from "./ansi-keys.constants";
|
|
4
|
+
import { KEY_LENGTHS } from "./keys.constants";
|
|
5
|
+
export function ansiParallelKeySizes(shaftDiameter, unit) {
|
|
6
|
+
const diameter = tableLength(shaftDiameter, unit, "in");
|
|
7
|
+
const row = diameter > ANSI_SMALLEST_KEYED_SHAFT ? ANSI_PARALLEL_KEYS.find(each => diameter <= each.upTo) : undefined;
|
|
8
|
+
if (row === undefined) {
|
|
9
|
+
const largest = ANSI_PARALLEL_KEYS[ANSI_PARALLEL_KEYS.length - 1].upTo;
|
|
10
|
+
throw new InputError(`\`shaftDiameter\` is not more than ${String(snappedLength(ANSI_SMALLEST_KEYED_SHAFT, "in", unit))} and at most ${String(snappedLength(largest, "in", unit))}.`, "shaftDiameter");
|
|
11
|
+
}
|
|
12
|
+
const chordHeight = (diameter - Math.sqrt(diameter * diameter - row.width * row.width)) / 2;
|
|
13
|
+
return lengthsConverted({ width: row.width, height: row.height, shaftDepth: row.shaftDepth + chordHeight, hubDepth: row.hubDepth - chordHeight }, KEY_LENGTHS, "in", unit);
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const PARALLEL_KEYS = [
|
|
2
|
+
{ upTo: 8, width: 2, height: 2, shaftDepth: 1.2, hubDepth: 1 },
|
|
3
|
+
{ upTo: 10, width: 3, height: 3, shaftDepth: 1.8, hubDepth: 1.4 },
|
|
4
|
+
{ upTo: 12, width: 4, height: 4, shaftDepth: 2.5, hubDepth: 1.8 },
|
|
5
|
+
{ upTo: 17, width: 5, height: 5, shaftDepth: 3, hubDepth: 2.3 },
|
|
6
|
+
{ upTo: 22, width: 6, height: 6, shaftDepth: 3.5, hubDepth: 2.8 },
|
|
7
|
+
{ upTo: 30, width: 8, height: 7, shaftDepth: 4, hubDepth: 3.3 },
|
|
8
|
+
{ upTo: 38, width: 10, height: 8, shaftDepth: 5, hubDepth: 3.3 },
|
|
9
|
+
{ upTo: 44, width: 12, height: 8, shaftDepth: 5, hubDepth: 3.3 },
|
|
10
|
+
{ upTo: 50, width: 14, height: 9, shaftDepth: 5.5, hubDepth: 3.8 },
|
|
11
|
+
{ upTo: 58, width: 16, height: 10, shaftDepth: 6, hubDepth: 4.3 },
|
|
12
|
+
{ upTo: 65, width: 18, height: 11, shaftDepth: 7, hubDepth: 4.4 },
|
|
13
|
+
];
|
|
14
|
+
export const SMALLEST_KEYED_SHAFT = 6;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { InputError } from "../kernel-calls/errors";
|
|
2
|
+
import { lengthsConverted, snappedLength, tableLength } from "../services/helpers/geometry/lengths";
|
|
3
|
+
import { PARALLEL_KEYS, SMALLEST_KEYED_SHAFT } from "./din-keys.constants";
|
|
4
|
+
import { KEY_LENGTHS } from "./keys.constants";
|
|
5
|
+
export function dinParallelKeySizes(shaftDiameter, unit) {
|
|
6
|
+
const diameter = tableLength(shaftDiameter, unit, "mm");
|
|
7
|
+
const row = diameter > SMALLEST_KEYED_SHAFT ? PARALLEL_KEYS.find(each => diameter <= each.upTo) : undefined;
|
|
8
|
+
if (row === undefined) {
|
|
9
|
+
const largest = PARALLEL_KEYS[PARALLEL_KEYS.length - 1].upTo;
|
|
10
|
+
throw new InputError(`\`shaftDiameter\` is not more than ${String(snappedLength(SMALLEST_KEYED_SHAFT, "mm", unit))} and at most ${String(snappedLength(largest, "mm", unit))}.`, "shaftDiameter");
|
|
11
|
+
}
|
|
12
|
+
return lengthsConverted({ width: row.width, height: row.height, shaftDepth: row.shaftDepth, hubDepth: row.hubDepth }, KEY_LENGTHS, "mm", unit);
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The sizes of a parallel key and the keyways for it, from `keys.din.parallelKeySizes` or
|
|
3
|
+
* `keys.ansi.parallelKeySizes`, in the unit asked for.
|
|
4
|
+
*/
|
|
5
|
+
export interface ParallelKeySizes {
|
|
6
|
+
/** The width of the key. */
|
|
7
|
+
readonly width: number;
|
|
8
|
+
/** The height of the key. */
|
|
9
|
+
readonly height: number;
|
|
10
|
+
/** How deep the keyway goes into the shaft, from the top of the shaft's round over the keyway's middle. */
|
|
11
|
+
readonly shaftDepth: number;
|
|
12
|
+
/** How deep the keyway goes into the hub, from the top of the bore's round over the keyway's middle. */
|
|
13
|
+
readonly hubDepth: number;
|
|
14
|
+
}
|
|
15
|
+
export interface KeyRow extends ParallelKeySizes {
|
|
16
|
+
readonly upTo: number;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const KEY_LENGTHS: readonly ["width", "height", "shaftDepth", "hubDepth"];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const KEY_LENGTHS = ["width", "height", "shaftDepth", "hubDepth"];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const ANSI_KNURLS = {
|
|
2
|
+
64: { depth: 0.024, leastTeeth: 24 },
|
|
3
|
+
96: { depth: 0.016, leastTeeth: 24 },
|
|
4
|
+
128: { depth: 0.012, leastTeeth: 18 },
|
|
5
|
+
160: { depth: 0.009, leastTeeth: 15 },
|
|
6
|
+
};
|
|
7
|
+
export const ANSI_KNURL_PITCHES = Object.keys(ANSI_KNURLS).map(Number);
|
|
8
|
+
export const ANSI_KNURL_HELIX_ANGLE = 30;
|