@bitbybit-dev/jscad 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/jscad-generated.js +0 -4
- package/lib/api/dto-registry.js +1 -2
- package/lib/api/inputs/inputs.js +0 -1
- package/lib/api/jscad-service.d.ts +2 -12
- package/lib/api/jscad-service.js +0 -10
- package/lib/api/services/entity-narrowing.d.ts +1 -1
- package/lib/api/services/jscad-booleans.d.ts +2 -2
- package/lib/api/services/jscad-colors.d.ts +1 -1
- package/lib/api/services/jscad-expansions.d.ts +1 -1
- package/lib/api/services/jscad-extrusions.d.ts +3 -3
- package/lib/api/services/jscad-hulls.d.ts +2 -2
- package/lib/api/services/jscad-path.d.ts +3 -3
- package/lib/api/services/jscad-polygon.d.ts +3 -3
- package/lib/api/services/jscad-shapes.d.ts +2 -2
- package/lib/api/services/jscad-text.d.ts +2 -2
- package/lib/api/validation/index.d.ts +1 -1
- package/package.json +2 -2
package/jscad-generated.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
// The JSCAD kernel as one object: @jscad/modeling with the serializers the wrapper downloads
|
|
2
|
-
// through, under the names it reads them by. The packages are CommonJS, so each is default-
|
|
3
|
-
// imported (the module.exports object) - a namespace import of a CommonJS module surfaces only
|
|
4
|
-
// the exports Node can lex, which for @jscad/modeling is one of fourteen.
|
|
5
1
|
import modeling from "@jscad/modeling";
|
|
6
2
|
import IOUTILS from "@jscad/io-utils";
|
|
7
3
|
import STLSERIALIZER from "@jscad/stl-serializer";
|
package/lib/api/dto-registry.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
// GENERATED by scripts/gen-dto-meta.mjs from the Jscad surface - do not edit
|
|
2
|
-
// Regenerate with `npm run gen:dto-meta` at the repository root.
|
|
1
|
+
// GENERATED by scripts/gen-dto-meta.mjs from the Jscad surface - do not edit; regenerate with `npm run gen:dto-meta`.
|
|
3
2
|
import { constraintKinds as k } from "@bitbybit-dev/base";
|
|
4
3
|
import * as Inputs from "./inputs";
|
|
5
4
|
const JSCAD_BooleanObjectsDto = { meshes: k.required(k.list(k.opaque)) };
|
package/lib/api/inputs/inputs.js
CHANGED
|
@@ -6,10 +6,10 @@ import { JSCADPolygon } from "./services/jscad-polygon";
|
|
|
6
6
|
import { JSCADShapes } from "./services/jscad-shapes";
|
|
7
7
|
import { JSCADText } from "./services/jscad-text";
|
|
8
8
|
import * as Inputs from "./inputs/jscad-inputs";
|
|
9
|
-
import { Base } from "./inputs/base-inputs";
|
|
9
|
+
import type { Base } from "./inputs/base-inputs";
|
|
10
10
|
import { JSCADHulls } from "./services/jscad-hulls";
|
|
11
11
|
import { JSCADColors } from "./services/jscad-colors";
|
|
12
|
-
import * as JSCAD from "@jscad/modeling";
|
|
12
|
+
import type * as JSCAD from "@jscad/modeling";
|
|
13
13
|
/**
|
|
14
14
|
* The entry point to the JSCAD kernel, a mesh-based solid modeler with three kinds of geometry: a
|
|
15
15
|
* solid, held as a closed set of polygons; a flat 2D shape, held as a region in the XY plane; and a
|
|
@@ -167,17 +167,7 @@ export declare class Jscad {
|
|
|
167
167
|
downloadGeometry3MF(inputs: Inputs.JSCAD.DownloadGeometryDto): {
|
|
168
168
|
blob: Blob;
|
|
169
169
|
};
|
|
170
|
-
/**
|
|
171
|
-
* JSCAD v1 handed back objects that carried their own `toPolygons()`; a v2 geometry is plain
|
|
172
|
-
* data and the equivalent is a free function. Anything still arriving in the old shape is read
|
|
173
|
-
* the old way, which is why this asks the value rather than trusting the type.
|
|
174
|
-
*/
|
|
175
170
|
private legacyPolygons;
|
|
176
|
-
/**
|
|
177
|
-
* Narrows an entity to the solid an operation needs, and says which operation wanted one. The
|
|
178
|
-
* kernel's own failure for a 2D shape here is a property access on undefined, several frames
|
|
179
|
-
* deep, which tells a script author nothing.
|
|
180
|
-
*/
|
|
181
171
|
private asSolid;
|
|
182
172
|
private getArrayDepth;
|
|
183
173
|
}
|
package/lib/api/jscad-service.js
CHANGED
|
@@ -302,20 +302,10 @@ export class Jscad {
|
|
|
302
302
|
const madeBlob = new Blob(rawData);
|
|
303
303
|
return { blob: madeBlob };
|
|
304
304
|
}
|
|
305
|
-
/**
|
|
306
|
-
* JSCAD v1 handed back objects that carried their own `toPolygons()`; a v2 geometry is plain
|
|
307
|
-
* data and the equivalent is a free function. Anything still arriving in the old shape is read
|
|
308
|
-
* the old way, which is why this asks the value rather than trusting the type.
|
|
309
|
-
*/
|
|
310
305
|
legacyPolygons(entity) {
|
|
311
306
|
const candidate = entity.toPolygons;
|
|
312
307
|
return typeof candidate === "function" ? candidate.bind(entity) : undefined;
|
|
313
308
|
}
|
|
314
|
-
/**
|
|
315
|
-
* Narrows an entity to the solid an operation needs, and says which operation wanted one. The
|
|
316
|
-
* kernel's own failure for a 2D shape here is a property access on undefined, several frames
|
|
317
|
-
* deep, which tells a script author nothing.
|
|
318
|
-
*/
|
|
319
309
|
asSolid(entity, operation) {
|
|
320
310
|
if (!("polygons" in entity)) {
|
|
321
311
|
throw new Error(`${operation} needs a 3D solid, but was given a 2D geometry or a path.`);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as Inputs from "../inputs/jscad-inputs";
|
|
1
|
+
import type * as Inputs from "../inputs/jscad-inputs";
|
|
2
2
|
/**
|
|
3
3
|
* Reads an input that the kernel accepts either singly or as a list. The published type says one
|
|
4
4
|
* entity, and a list has always worked too because the kernel's operations are variadic; declaring
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as Inputs from "../inputs/jscad-inputs";
|
|
2
|
-
import * as JSCAD from "@jscad/modeling";
|
|
1
|
+
import type * as Inputs from "../inputs/jscad-inputs";
|
|
2
|
+
import type * as JSCAD from "@jscad/modeling";
|
|
3
3
|
/**
|
|
4
4
|
* Combining JSCAD geometry: union fuses, subtract cuts and intersect keeps the overlap, in a
|
|
5
5
|
* two-input form and a many-input form. All inputs of one call must be of the same kind, either
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Inputs from "../inputs/jscad-inputs";
|
|
2
|
-
import * as JSCAD from "@jscad/modeling";
|
|
2
|
+
import type * as JSCAD from "@jscad/modeling";
|
|
3
3
|
/**
|
|
4
4
|
* Giving JSCAD geometry a color of its own. A colored entity is always drawn in that color, ahead
|
|
5
5
|
* of whatever color the drawing options ask for; the color survives transforms but a boolean result
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Inputs from "../inputs/jscad-inputs";
|
|
2
|
-
import * as JSCAD from "@jscad/modeling";
|
|
2
|
+
import type * as JSCAD from "@jscad/modeling";
|
|
3
3
|
/**
|
|
4
4
|
* Growing and shrinking JSCAD geometry by a distance: `expand` moves every boundary outward, or
|
|
5
5
|
* inward for a negative distance, and `offset` builds the outline at that distance. Both work on
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { GeometryHelper } from "@bitbybit-dev/base";
|
|
1
|
+
import type { GeometryHelper } from "@bitbybit-dev/base";
|
|
2
2
|
import * as Inputs from "../inputs/jscad-inputs";
|
|
3
|
-
import { MathBitByBit } from "@bitbybit-dev/base";
|
|
4
|
-
import * as JSCAD from "@jscad/modeling";
|
|
3
|
+
import type { MathBitByBit } from "@bitbybit-dev/base";
|
|
4
|
+
import type * as JSCAD from "@jscad/modeling";
|
|
5
5
|
/**
|
|
6
6
|
* Turning flat JSCAD shapes into solids: straight extrusion along Z with an optional twist, a wall
|
|
7
7
|
* built along an outline, and revolution around the Z axis. Every flat shape lies in the XY plane,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as Inputs from "../inputs/jscad-inputs";
|
|
2
|
-
import * as JSCAD from "@jscad/modeling";
|
|
1
|
+
import type * as Inputs from "../inputs/jscad-inputs";
|
|
2
|
+
import type * as JSCAD from "@jscad/modeling";
|
|
3
3
|
/**
|
|
4
4
|
* Wrapping JSCAD geometry in its convex hull, the shape a tight sheet would take around it: `hull`
|
|
5
5
|
* wraps everything at once and `hullChain` wraps each consecutive pair, so a row of shapes becomes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { GeometryHelper } from "@bitbybit-dev/base";
|
|
1
|
+
import type { GeometryHelper } from "@bitbybit-dev/base";
|
|
2
2
|
import * as Inputs from "../inputs/jscad-inputs";
|
|
3
|
-
import { MathBitByBit } from "@bitbybit-dev/base";
|
|
4
|
-
import * as JSCAD from "@jscad/modeling";
|
|
3
|
+
import type { MathBitByBit } from "@bitbybit-dev/base";
|
|
4
|
+
import type * as JSCAD from "@jscad/modeling";
|
|
5
5
|
/**
|
|
6
6
|
* Building JSCAD paths, the 2D polylines that walls are extruded along, offsets follow and filled
|
|
7
7
|
* shapes are closed from. A path lies in the XY plane and is open or closed; it grows by appending
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { GeometryHelper } from "@bitbybit-dev/base";
|
|
1
|
+
import type { GeometryHelper } from "@bitbybit-dev/base";
|
|
2
2
|
import * as Inputs from "../inputs";
|
|
3
|
-
import { MathBitByBit } from "@bitbybit-dev/base";
|
|
4
|
-
import * as JSCAD from "@jscad/modeling";
|
|
3
|
+
import type { MathBitByBit } from "@bitbybit-dev/base";
|
|
4
|
+
import type * as JSCAD from "@jscad/modeling";
|
|
5
5
|
/**
|
|
6
6
|
* Building flat JSCAD shapes, the filled 2D regions that booleans combine and extrusions turn into
|
|
7
7
|
* solids. They lie in the XY plane: a shape made from points or a curve keeps only the X and Y
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Inputs from "../inputs/jscad-inputs";
|
|
2
|
-
import { MathBitByBit } from "@bitbybit-dev/base";
|
|
3
|
-
import * as JSCAD from "@jscad/modeling";
|
|
2
|
+
import type { MathBitByBit } from "@bitbybit-dev/base";
|
|
3
|
+
import type * as JSCAD from "@jscad/modeling";
|
|
4
4
|
/**
|
|
5
5
|
* Building JSCAD solids: cubes, cuboids, spheres, ellipsoids, cylinders, a torus and a solid from
|
|
6
6
|
* raw polygon points, each with a variant that places one copy on every point of a list. The kernel
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Base } from "@bitbybit-dev/base";
|
|
1
|
+
import type { Base } from "@bitbybit-dev/base";
|
|
2
2
|
import * as Inputs from "../inputs/jscad-inputs";
|
|
3
|
-
import * as JSCAD from "@jscad/modeling";
|
|
3
|
+
import type * as JSCAD from "@jscad/modeling";
|
|
4
4
|
/**
|
|
5
5
|
* Writing text with JSCAD's built-in stroke font. `createVectorText` gives the pen strokes of the
|
|
6
6
|
* text as lists of 2D points in the XY plane; `cylindricalText` and `sphericalText` turn every
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RuleBook } from "@bitbybit-dev/base";
|
|
1
|
+
import type { RuleBook } from "@bitbybit-dev/base";
|
|
2
2
|
/**
|
|
3
3
|
* What the inputs of a JSCAD operation have to satisfy together, beyond what each property accepts
|
|
4
4
|
* on its own, by the DTO the operation takes; rules written for a shared parent apply to both
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitbybit-dev/jscad",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Bit By Bit Developers JSCAD based CAD Library to Program Geometry",
|
|
5
5
|
"homepage": "https://docs.bitbybit.dev/classes/Bit.JSCAD",
|
|
6
6
|
"main": "index.js",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"types": "./index.d.ts",
|
|
55
55
|
"type": "module",
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@bitbybit-dev/base": "1.
|
|
57
|
+
"@bitbybit-dev/base": "1.5.0",
|
|
58
58
|
"@jscad/io-utils": "2.0.33",
|
|
59
59
|
"@jscad/modeling": "2.13.0",
|
|
60
60
|
"@jscad/stl-serializer": "2.1.23",
|