brepjs 9.6.4 → 10.0.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/dist/2d/blueprints/Blueprint.d.ts +3 -3
- package/dist/2d/blueprints/Blueprint.d.ts.map +1 -1
- package/dist/2d/blueprints/Blueprints.d.ts +3 -3
- package/dist/2d/blueprints/Blueprints.d.ts.map +1 -1
- package/dist/2d/blueprints/CompoundBlueprint.d.ts +3 -3
- package/dist/2d/blueprints/CompoundBlueprint.d.ts.map +1 -1
- package/dist/2d.cjs +2 -2
- package/dist/2d.js +3 -3
- package/dist/{Blueprint-D73qryz7.cjs → Blueprint-B6UDSVJN.cjs} +5 -5
- package/dist/{Blueprint-DebTNazC.js → Blueprint-QlgNyzP7.js} +5 -5
- package/dist/{boolean2D-Die5sMjA.cjs → boolean2D-DZxTrl9x.cjs} +7 -7
- package/dist/{boolean2D-Dg9wSxP6.js → boolean2D-Gr-OYFsO.js} +7 -7
- package/dist/{booleanFns-D3QHXA3L.js → booleanFns-BEIrQNUH.js} +3 -3
- package/dist/{booleanFns-uwsn5G2P.cjs → booleanFns-CR6vk8qv.cjs} +3 -3
- package/dist/brepjs.cjs +22 -17
- package/dist/brepjs.js +47 -42
- package/dist/core/shapeTypes.d.ts +84 -33
- package/dist/core/shapeTypes.d.ts.map +1 -1
- package/dist/core/typeErrors.d.ts +17 -0
- package/dist/core/typeErrors.d.ts.map +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{cornerFinder-DvYYBvKj.js → cornerFinder-Bh_jsF_w.js} +1 -1
- package/dist/{cornerFinder-BcA7Chiv.cjs → cornerFinder-DlwI0iHu.cjs} +1 -1
- package/dist/{curveFns-DY55OAr3.js → curveFns-CNkC51il.js} +1 -1
- package/dist/{curveFns-BAXBhYiR.cjs → curveFns-jnEgxP5N.cjs} +1 -1
- package/dist/{drawFns-a74YTSws.cjs → drawFns-D0Wg1cy7.cjs} +10 -10
- package/dist/{drawFns-Diysw_m4.js → drawFns-Ex_DyuI1.js} +10 -10
- package/dist/{faceFns-CjRZGka6.cjs → faceFns-B10DQksf.cjs} +1 -1
- package/dist/{faceFns-BQ26A_zd.js → faceFns-DKkW12_x.js} +1 -1
- package/dist/{helpers-D2N1HNiK.cjs → helpers-4kc7odPn.cjs} +4 -4
- package/dist/{helpers-TF7WTmKB.js → helpers-BPzEhlP8.js} +4 -4
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/io/importFns.d.ts +4 -4
- package/dist/io/importFns.d.ts.map +1 -1
- package/dist/io/objImportFns.d.ts +2 -2
- package/dist/io/objImportFns.d.ts.map +1 -1
- package/dist/io/threemfImportFns.d.ts +2 -2
- package/dist/io/threemfImportFns.d.ts.map +1 -1
- package/dist/io.cjs +3 -3
- package/dist/io.js +3 -3
- package/dist/{loft-C55d1XrF.cjs → loft-ByirrIHz.cjs} +3 -3
- package/dist/{loft-DK0_xi5M.js → loft-CfNUe13X.js} +3 -3
- package/dist/measurement/interferenceFns.d.ts +3 -3
- package/dist/measurement/interferenceFns.d.ts.map +1 -1
- package/dist/measurement/measureFns.d.ts +10 -10
- package/dist/measurement/measureFns.d.ts.map +1 -1
- package/dist/{measurement-DQWf2-IP.js → measurement-BMfzcJ2H.js} +2 -2
- package/dist/{measurement-BF_JvjuA.cjs → measurement-CpWygrRd.cjs} +2 -2
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-CmZM1bAd.js → meshFns-CbuZpQmE.js} +2 -2
- package/dist/{meshFns-DYdC0ztK.cjs → meshFns-DRZcKqgZ.cjs} +2 -2
- package/dist/operations/api.d.ts +4 -4
- package/dist/operations/api.d.ts.map +1 -1
- package/dist/operations/exporterFns.d.ts +2 -2
- package/dist/operations/exporterFns.d.ts.map +1 -1
- package/dist/operations/exporters.d.ts +2 -2
- package/dist/operations/exporters.d.ts.map +1 -1
- package/dist/operations/extrudeFns.d.ts +7 -7
- package/dist/operations/extrudeFns.d.ts.map +1 -1
- package/dist/operations/guidedSweepFns.d.ts +2 -2
- package/dist/operations/guidedSweepFns.d.ts.map +1 -1
- package/dist/operations/historyFns.d.ts +6 -6
- package/dist/operations/historyFns.d.ts.map +1 -1
- package/dist/operations/loftFns.d.ts +2 -2
- package/dist/operations/loftFns.d.ts.map +1 -1
- package/dist/operations/multiSweepFns.d.ts +3 -3
- package/dist/operations/multiSweepFns.d.ts.map +1 -1
- package/dist/operations/roofFns.d.ts +2 -2
- package/dist/operations/roofFns.d.ts.map +1 -1
- package/dist/{operations-CMcb2KJ3.cjs → operations-DAt3B8iS.cjs} +5 -5
- package/dist/{operations-DhgY338f.js → operations-DBJ9dkjD.js} +5 -5
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/query/finderCore.d.ts +5 -5
- package/dist/query/finderCore.d.ts.map +1 -1
- package/dist/query/helpers.d.ts +2 -2
- package/dist/query/helpers.d.ts.map +1 -1
- package/dist/query/shapeDistanceFilter.d.ts +2 -2
- package/dist/query/shapeDistanceFilter.d.ts.map +1 -1
- package/dist/query/vertexFinder.d.ts.map +1 -1
- package/dist/query.cjs +4 -4
- package/dist/query.js +5 -5
- package/dist/{shapeFns-DBSqO7QJ.js → shapeFns-BrfVnd9Q.js} +2 -2
- package/dist/{shapeFns-D6qzq_Cu.cjs → shapeFns-vPR93KGT.cjs} +2 -2
- package/dist/{shapeTypes-BHy5rqqk.cjs → shapeTypes-BxAzFSfl.cjs} +25 -1
- package/dist/{shapeTypes-1WVcBBn_.js → shapeTypes-C1z8HWJf.js} +29 -5
- package/dist/sketching/CompoundSketch.d.ts +1 -1
- package/dist/sketching/draw.d.ts +3 -3
- package/dist/sketching/draw.d.ts.map +1 -1
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.js +2 -2
- package/dist/{surfaceBuilders-C_UpU97c.js → surfaceBuilders-B-yoDL2e.js} +2 -2
- package/dist/{surfaceBuilders-DU6Pq2ju.cjs → surfaceBuilders-BkTPbZFl.cjs} +2 -2
- package/dist/topology/adjacencyFns.d.ts +7 -7
- package/dist/topology/adjacencyFns.d.ts.map +1 -1
- package/dist/topology/api.d.ts +24 -24
- package/dist/topology/api.d.ts.map +1 -1
- package/dist/topology/apiTypes.d.ts +7 -7
- package/dist/topology/apiTypes.d.ts.map +1 -1
- package/dist/topology/booleanFns.d.ts +7 -7
- package/dist/topology/booleanFns.d.ts.map +1 -1
- package/dist/topology/cast.d.ts +6 -6
- package/dist/topology/cast.d.ts.map +1 -1
- package/dist/topology/colorFns.d.ts +7 -7
- package/dist/topology/colorFns.d.ts.map +1 -1
- package/dist/topology/curveFns.d.ts +14 -14
- package/dist/topology/curveFns.d.ts.map +1 -1
- package/dist/topology/faceTagFns.d.ts +8 -8
- package/dist/topology/faceTagFns.d.ts.map +1 -1
- package/dist/topology/healingFns.d.ts +7 -7
- package/dist/topology/healingFns.d.ts.map +1 -1
- package/dist/topology/hullFns.d.ts +2 -2
- package/dist/topology/hullFns.d.ts.map +1 -1
- package/dist/topology/meshFns.d.ts +6 -6
- package/dist/topology/meshFns.d.ts.map +1 -1
- package/dist/topology/primitiveFns.d.ts +2 -2
- package/dist/topology/primitiveFns.d.ts.map +1 -1
- package/dist/topology/shapeFns.d.ts +29 -29
- package/dist/topology/shapeFns.d.ts.map +1 -1
- package/dist/topology/shapeUtils.d.ts +2 -2
- package/dist/topology/shapeUtils.d.ts.map +1 -1
- package/dist/topology/solidBuilders.d.ts +2 -2
- package/dist/topology/solidBuilders.d.ts.map +1 -1
- package/dist/topology/surfaceBuilders.d.ts +5 -5
- package/dist/topology/surfaceBuilders.d.ts.map +1 -1
- package/dist/{topology-B-UCQkll.js → topology-Bt4qS8pS.js} +6 -6
- package/dist/{topology-BrCU7nI6.cjs → topology-CBZcJ5pS.cjs} +6 -6
- package/dist/topology.cjs +6 -6
- package/dist/topology.js +6 -6
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Vec3 } from '../core/types.js';
|
|
2
|
-
import { AnyShape } from '../core/shapeTypes.js';
|
|
2
|
+
import { AnyShape, Dimension } from '../core/shapeTypes.js';
|
|
3
3
|
import { Predicate } from './finderCore.js';
|
|
4
4
|
/**
|
|
5
5
|
* Create a predicate that checks whether a shape element's minimum distance
|
|
@@ -8,5 +8,5 @@ import { Predicate } from './finderCore.js';
|
|
|
8
8
|
* Uses the kernel's `distance()` method to compute minimum distance,
|
|
9
9
|
* with a vertex constructed at the reference point.
|
|
10
10
|
*/
|
|
11
|
-
export declare function distanceFromPointFilter<T extends AnyShape
|
|
11
|
+
export declare function distanceFromPointFilter<T extends AnyShape<Dimension>>(distance: number, point: Vec3, tolerance: number): Predicate<T>;
|
|
12
12
|
//# sourceMappingURL=shapeDistanceFilter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shapeDistanceFilter.d.ts","sourceRoot":"","sources":["../../src/query/shapeDistanceFilter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"shapeDistanceFilter.d.ts","sourceRoot":"","sources":["../../src/query/shapeDistanceFilter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,QAAQ,CAAC,SAAS,CAAC,EACnE,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,IAAI,EACX,SAAS,EAAE,MAAM,GAChB,SAAS,CAAC,CAAC,CAAC,CASd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vertexFinder.d.ts","sourceRoot":"","sources":["../../src/query/vertexFinder.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"vertexFinder.d.ts","sourceRoot":"","sources":["../../src/query/vertexFinder.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAuB,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAKzE,OAAO,EAAE,KAAK,WAAW,EAAqC,MAAM,iBAAiB,CAAC;AAMtF,MAAM,WAAW,cAAe,SAAQ,WAAW,CAAC,MAAM,CAAC;IACzD,6GAA6G;IAC7G,QAAQ,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,IAAI,KAAK,cAAc,CAAC;IACpD,+DAA+D;IAC/D,QAAQ,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,cAAc,CAAC;IACzE,2DAA2D;IAC3D,QAAQ,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,KAAK,cAAc,CAAC;IAC7D,wDAAwD;IACxD,QAAQ,CAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,cAAc,CAAC;CAC7F;AAuFD,yCAAyC;AACzC,wBAAgB,YAAY,IAAI,cAAc,CAE7C"}
|
package/dist/query.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const helpers = require("./helpers-
|
|
4
|
-
const cornerFinder = require("./cornerFinder-
|
|
5
|
-
const shapeTypes = require("./shapeTypes-
|
|
3
|
+
const helpers = require("./helpers-4kc7odPn.cjs");
|
|
4
|
+
const cornerFinder = require("./cornerFinder-DlwI0iHu.cjs");
|
|
5
|
+
const shapeTypes = require("./shapeTypes-BxAzFSfl.cjs");
|
|
6
6
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
7
|
-
const curveFns = require("./curveFns-
|
|
7
|
+
const curveFns = require("./curveFns-jnEgxP5N.cjs");
|
|
8
8
|
function edgeDirectionFilter(dir, angle) {
|
|
9
9
|
const d = vecOps.vecNormalize(helpers.resolveDir(dir));
|
|
10
10
|
return (edge) => {
|
package/dist/query.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { l as createTypedFinder, o as distanceFromPointFilter, q as resolveDir } from "./helpers-
|
|
2
|
-
import { m, g } from "./helpers-
|
|
3
|
-
import { c } from "./cornerFinder-
|
|
4
|
-
import { q as getKernel } from "./shapeTypes-
|
|
1
|
+
import { l as createTypedFinder, o as distanceFromPointFilter, q as resolveDir } from "./helpers-BPzEhlP8.js";
|
|
2
|
+
import { m, g } from "./helpers-BPzEhlP8.js";
|
|
3
|
+
import { c } from "./cornerFinder-Bh_jsF_w.js";
|
|
4
|
+
import { q as getKernel } from "./shapeTypes-C1z8HWJf.js";
|
|
5
5
|
import { j as vecNormalize, d as vecDot, D as DEG2RAD } from "./vecOps-ZDdZWbwT.js";
|
|
6
|
-
import { b as getCurveType, i as curveLength } from "./curveFns-
|
|
6
|
+
import { b as getCurveType, i as curveLength } from "./curveFns-CNkC51il.js";
|
|
7
7
|
function edgeDirectionFilter(dir, angle) {
|
|
8
8
|
const d = vecNormalize(resolveDir(dir));
|
|
9
9
|
return (edge) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { q as getKernel, c as castShape, g as getShapeKind } from "./shapeTypes-
|
|
1
|
+
import { q as getKernel, c as castShape, g as getShapeKind } from "./shapeTypes-C1z8HWJf.js";
|
|
2
2
|
import { H as HASH_CODE_MAX, D as DEG2RAD } from "./vecOps-ZDdZWbwT.js";
|
|
3
|
-
import { i as iterTopo, d as downcast } from "./faceFns-
|
|
3
|
+
import { i as iterTopo, d as downcast } from "./faceFns-DKkW12_x.js";
|
|
4
4
|
import { u as unwrap } from "./errors-lBwyc8YG.js";
|
|
5
5
|
function clone(shape) {
|
|
6
6
|
return castShape(unwrap(downcast(shape.wrapped)));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const shapeTypes = require("./shapeTypes-
|
|
2
|
+
const shapeTypes = require("./shapeTypes-BxAzFSfl.cjs");
|
|
3
3
|
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
4
|
-
const faceFns = require("./faceFns-
|
|
4
|
+
const faceFns = require("./faceFns-B10DQksf.cjs");
|
|
5
5
|
const errors = require("./errors-DiTn5EoC.cjs");
|
|
6
6
|
function clone(shape) {
|
|
7
7
|
return shapeTypes.castShape(errors.unwrap(faceFns.downcast(shape.wrapped)));
|
|
@@ -5356,12 +5356,28 @@ function isCompound(s) {
|
|
|
5356
5356
|
}
|
|
5357
5357
|
function isShape3D(s) {
|
|
5358
5358
|
const kind = getShapeKind(s);
|
|
5359
|
-
|
|
5359
|
+
if (kind === "shell" || kind === "solid" || kind === "compsolid") return true;
|
|
5360
|
+
if (kind === "compound") return is3D(s);
|
|
5361
|
+
return false;
|
|
5360
5362
|
}
|
|
5361
5363
|
function isShape1D(s) {
|
|
5362
5364
|
const kind = getShapeKind(s);
|
|
5363
5365
|
return kind === "edge" || kind === "wire";
|
|
5364
5366
|
}
|
|
5367
|
+
function is3D(s) {
|
|
5368
|
+
return s.__is2D !== true;
|
|
5369
|
+
}
|
|
5370
|
+
function is2D(s) {
|
|
5371
|
+
return s.__is2D === true;
|
|
5372
|
+
}
|
|
5373
|
+
function as3D(s) {
|
|
5374
|
+
if (!is3D(s)) throw new Error("Expected 3D shape, got 2D");
|
|
5375
|
+
return s;
|
|
5376
|
+
}
|
|
5377
|
+
function as2D(s) {
|
|
5378
|
+
if (!is2D(s)) throw new Error("Expected 2D shape, got 3D");
|
|
5379
|
+
return s;
|
|
5380
|
+
}
|
|
5365
5381
|
function castShape(ocShape) {
|
|
5366
5382
|
const kernel = getKernel();
|
|
5367
5383
|
const st = kernel.shapeType(ocShape);
|
|
@@ -5375,8 +5391,14 @@ function castShape(ocShape) {
|
|
|
5375
5391
|
if (st === "compsolid") return createCompSolid(dc);
|
|
5376
5392
|
return createCompound(dc);
|
|
5377
5393
|
}
|
|
5394
|
+
function castShape3D(ocShape) {
|
|
5395
|
+
return castShape(ocShape);
|
|
5396
|
+
}
|
|
5378
5397
|
exports.DisposalScope = DisposalScope;
|
|
5398
|
+
exports.as2D = as2D;
|
|
5399
|
+
exports.as3D = as3D;
|
|
5379
5400
|
exports.castShape = castShape;
|
|
5401
|
+
exports.castShape3D = castShape3D;
|
|
5380
5402
|
exports.createCompound = createCompound;
|
|
5381
5403
|
exports.createEdge = createEdge;
|
|
5382
5404
|
exports.createFace = createFace;
|
|
@@ -5390,6 +5412,8 @@ exports.getKernel = getKernel;
|
|
|
5390
5412
|
exports.getKernel2D = getKernel2D;
|
|
5391
5413
|
exports.getShapeKind = getShapeKind;
|
|
5392
5414
|
exports.initFromOC = initFromOC;
|
|
5415
|
+
exports.is2D = is2D;
|
|
5416
|
+
exports.is3D = is3D;
|
|
5393
5417
|
exports.isCompound = isCompound;
|
|
5394
5418
|
exports.isEdge = isEdge;
|
|
5395
5419
|
exports.isFace = isFace;
|
|
@@ -5355,12 +5355,28 @@ function isCompound(s) {
|
|
|
5355
5355
|
}
|
|
5356
5356
|
function isShape3D(s) {
|
|
5357
5357
|
const kind = getShapeKind(s);
|
|
5358
|
-
|
|
5358
|
+
if (kind === "shell" || kind === "solid" || kind === "compsolid") return true;
|
|
5359
|
+
if (kind === "compound") return is3D(s);
|
|
5360
|
+
return false;
|
|
5359
5361
|
}
|
|
5360
5362
|
function isShape1D(s) {
|
|
5361
5363
|
const kind = getShapeKind(s);
|
|
5362
5364
|
return kind === "edge" || kind === "wire";
|
|
5363
5365
|
}
|
|
5366
|
+
function is3D(s) {
|
|
5367
|
+
return s.__is2D !== true;
|
|
5368
|
+
}
|
|
5369
|
+
function is2D(s) {
|
|
5370
|
+
return s.__is2D === true;
|
|
5371
|
+
}
|
|
5372
|
+
function as3D(s) {
|
|
5373
|
+
if (!is3D(s)) throw new Error("Expected 3D shape, got 2D");
|
|
5374
|
+
return s;
|
|
5375
|
+
}
|
|
5376
|
+
function as2D(s) {
|
|
5377
|
+
if (!is2D(s)) throw new Error("Expected 2D shape, got 3D");
|
|
5378
|
+
return s;
|
|
5379
|
+
}
|
|
5364
5380
|
function castShape(ocShape) {
|
|
5365
5381
|
const kernel = getKernel();
|
|
5366
5382
|
const st = kernel.shapeType(ocShape);
|
|
@@ -5374,13 +5390,21 @@ function castShape(ocShape) {
|
|
|
5374
5390
|
if (st === "compsolid") return createCompSolid(dc);
|
|
5375
5391
|
return createCompound(dc);
|
|
5376
5392
|
}
|
|
5393
|
+
function castShape3D(ocShape) {
|
|
5394
|
+
return castShape(ocShape);
|
|
5395
|
+
}
|
|
5377
5396
|
export {
|
|
5378
5397
|
unregisterFromCleanup as A,
|
|
5379
|
-
|
|
5380
|
-
|
|
5398
|
+
as2D as B,
|
|
5399
|
+
as3D as C,
|
|
5381
5400
|
DisposalScope as D,
|
|
5382
|
-
|
|
5383
|
-
|
|
5401
|
+
castShape3D as E,
|
|
5402
|
+
createShell as F,
|
|
5403
|
+
initFromOC as G,
|
|
5404
|
+
is2D as H,
|
|
5405
|
+
is3D as I,
|
|
5406
|
+
registerKernel as J,
|
|
5407
|
+
withKernel as K,
|
|
5384
5408
|
createHandle as a,
|
|
5385
5409
|
createKernelHandle as b,
|
|
5386
5410
|
castShape as c,
|
|
@@ -27,7 +27,7 @@ export default class CompoundSketch implements SketchInterface {
|
|
|
27
27
|
/** Return all wires (outer + holes) combined into a compound shape. */
|
|
28
28
|
get wires(): import('../index.js').Compound;
|
|
29
29
|
/** Build a face from the outer boundary with inner wires subtracted as holes. */
|
|
30
|
-
face(): Face
|
|
30
|
+
face(): Face<"3D">;
|
|
31
31
|
/**
|
|
32
32
|
* Extrude the compound face (with holes) along the default or given direction.
|
|
33
33
|
*
|
package/dist/sketching/draw.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ApproximationOptions, BoundingBox2d, Point2D } from '../2d/lib/index.js
|
|
|
2
2
|
import { Blueprint, ScaleMode, Shape2D } from '../2d/blueprints/index.js';
|
|
3
3
|
import { Plane, PlaneName } from '../core/planeTypes.js';
|
|
4
4
|
import { PointInput } from '../core/types.js';
|
|
5
|
-
import { AnyShape, Face } from '../core/shapeTypes.js';
|
|
5
|
+
import { AnyShape, Dimension, Face } from '../core/shapeTypes.js';
|
|
6
6
|
import { BaseSketcher2d } from './Sketcher2d.js';
|
|
7
7
|
import { SketchInterface } from './sketchLib.js';
|
|
8
8
|
import { default as Sketches } from './Sketches.js';
|
|
@@ -98,11 +98,11 @@ export declare class Drawing {
|
|
|
98
98
|
/** Project this drawing onto a 3D face surface with the given scale mode. */
|
|
99
99
|
sketchOnFace(face: Face, scaleMode: ScaleMode): SketchInterface | Sketches;
|
|
100
100
|
/** Punch the drawing's profile as a hole through a 3D shape on the given face. */
|
|
101
|
-
punchHole(shape: AnyShape
|
|
101
|
+
punchHole(shape: AnyShape<Dimension>, faceFinder: SingleFace, options?: {
|
|
102
102
|
height?: number;
|
|
103
103
|
origin?: PointInput;
|
|
104
104
|
draftAngle?: number;
|
|
105
|
-
}): AnyShape
|
|
105
|
+
}): AnyShape<Dimension>;
|
|
106
106
|
/** Export the drawing as a complete SVG string. */
|
|
107
107
|
toSVG(margin?: number): string;
|
|
108
108
|
/** Return the SVG `viewBox` attribute string for this drawing. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"draw.d.ts","sourceRoot":"","sources":["../../src/sketching/draw.ts"],"names":[],"mappings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EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAM7E;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,SAAI,GAAG,OAAO,CAEtF;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,MAAM,EACZ,EAAE,MAAU,EAAE,MAAU,EAAE,QAAa,EAAE,UAAsB,EAAE;;;;;CAAK,GACrE,OAAO,CAET;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GAClC,QAAQ,OAAO,EAAE,EACjB,sBAAqB,2BAAgC,EACrD,UAAS;IACP,UAAU,CAAC,EAAE,OAAO,CAAC;CACjB,KACL,OAeF,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,GACjC,MAAM,CAAC,CAAC,EAAE,MAAM,KAAK,OAAO,EAC5B;;;;;CAAmE,EACnE,sBAAqB,2BAAgC,KACpD,OAOF,CAAC;AAkBF;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,QAAQ,EACf,gBAAgB,GAAE,eAAe,GAAG,MAAgB,GACnD;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAcvC;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAWnD"}
|
package/dist/sketching.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const drawFns = require("./drawFns-
|
|
4
|
-
const boolean2D = require("./boolean2D-
|
|
3
|
+
const drawFns = require("./drawFns-D0Wg1cy7.cjs");
|
|
4
|
+
const boolean2D = require("./boolean2D-DZxTrl9x.cjs");
|
|
5
5
|
exports.CompoundSketch = drawFns.CompoundSketch;
|
|
6
6
|
exports.Drawing = drawFns.Drawing;
|
|
7
7
|
exports.DrawingPen = drawFns.DrawingPen;
|
package/dist/sketching.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C, D, a, S, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, T, U, V, W } from "./drawFns-
|
|
2
|
-
import { B as B2, a as a2, F as F2, S as S2 } from "./boolean2D-
|
|
1
|
+
import { C, D, a, S, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, T, U, V, W } from "./drawFns-Ex_DyuI1.js";
|
|
2
|
+
import { B as B2, a as a2, F as F2, S as S2 } from "./boolean2D-Gr-OYFsO.js";
|
|
3
3
|
export {
|
|
4
4
|
B2 as BaseSketcher2d,
|
|
5
5
|
a2 as BlueprintSketcher,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as createWire, q as getKernel, s as createEdge, t as createFace, e as isFace } from "./shapeTypes-
|
|
1
|
+
import { r as createWire, q as getKernel, s as createEdge, t as createFace, e as isFace } from "./shapeTypes-C1z8HWJf.js";
|
|
2
2
|
import { o as ok, e as err, k as kernelError, x as validationError, a as andThen } from "./errors-lBwyc8YG.js";
|
|
3
|
-
import { o as outerWire, c as cast } from "./faceFns-
|
|
3
|
+
import { o as outerWire, c as cast } from "./faceFns-DKkW12_x.js";
|
|
4
4
|
function range(len) {
|
|
5
5
|
return Array.from(Array(len).keys());
|
|
6
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const shapeTypes = require("./shapeTypes-
|
|
2
|
+
const shapeTypes = require("./shapeTypes-BxAzFSfl.cjs");
|
|
3
3
|
const errors = require("./errors-DiTn5EoC.cjs");
|
|
4
|
-
const faceFns = require("./faceFns-
|
|
4
|
+
const faceFns = require("./faceFns-B10DQksf.cjs");
|
|
5
5
|
function range(len) {
|
|
6
6
|
return Array.from(Array(len).keys());
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyShape, Edge, Face, Vertex, Wire } from '../core/shapeTypes.js';
|
|
1
|
+
import { AnyShape, Dimension, Edge, Face, Vertex, Wire } from '../core/shapeTypes.js';
|
|
2
2
|
/**
|
|
3
3
|
* Get all faces adjacent to a given edge within a parent shape.
|
|
4
4
|
*
|
|
@@ -9,27 +9,27 @@ import { AnyShape, Edge, Face, Vertex, Wire } from '../core/shapeTypes.js';
|
|
|
9
9
|
* @param edge - The edge whose adjacent faces to find.
|
|
10
10
|
* @returns Array of unique faces containing the given edge.
|
|
11
11
|
*/
|
|
12
|
-
export declare function facesOfEdge(parent: AnyShape
|
|
12
|
+
export declare function facesOfEdge<D extends Dimension>(parent: AnyShape<D>, edge: Edge<D>): Face<D>[];
|
|
13
13
|
/**
|
|
14
14
|
* Get all edges bounding a face.
|
|
15
15
|
*
|
|
16
16
|
* @param face - The face whose edges to enumerate.
|
|
17
17
|
* @returns Array of unique edges forming the face boundary.
|
|
18
18
|
*/
|
|
19
|
-
export declare function edgesOfFace(face: Face): Edge[];
|
|
19
|
+
export declare function edgesOfFace<D extends Dimension>(face: Face<D>): Edge<D>[];
|
|
20
20
|
/**
|
|
21
21
|
* Get all wires of a face (outer wire + inner hole wires).
|
|
22
22
|
*
|
|
23
23
|
* @param face - The face whose wires to enumerate.
|
|
24
24
|
*/
|
|
25
|
-
export declare function wiresOfFace(face: Face): Wire[];
|
|
25
|
+
export declare function wiresOfFace<D extends Dimension>(face: Face<D>): Wire<D>[];
|
|
26
26
|
/**
|
|
27
27
|
* Get the start and end vertices of an edge.
|
|
28
28
|
*
|
|
29
29
|
* @param edge - The edge whose vertices to retrieve.
|
|
30
30
|
* @returns Array of 1-2 vertices (1 if degenerate/closed, 2 otherwise).
|
|
31
31
|
*/
|
|
32
|
-
export declare function verticesOfEdge(edge: Edge): Vertex[];
|
|
32
|
+
export declare function verticesOfEdge<D extends Dimension>(edge: Edge<D>): Vertex<D>[];
|
|
33
33
|
/**
|
|
34
34
|
* Get all faces that share at least one edge with the given face.
|
|
35
35
|
*
|
|
@@ -39,7 +39,7 @@ export declare function verticesOfEdge(edge: Edge): Vertex[];
|
|
|
39
39
|
* @param face - The face whose neighbors to find.
|
|
40
40
|
* @returns Array of unique adjacent faces (excluding the input face).
|
|
41
41
|
*/
|
|
42
|
-
export declare function adjacentFaces(parent: AnyShape
|
|
42
|
+
export declare function adjacentFaces<D extends Dimension>(parent: AnyShape<D>, face: Face<D>): Face<D>[];
|
|
43
43
|
/**
|
|
44
44
|
* Get all edges shared between two faces.
|
|
45
45
|
*
|
|
@@ -47,5 +47,5 @@ export declare function adjacentFaces(parent: AnyShape, face: Face): Face[];
|
|
|
47
47
|
* @param face2 - The second face.
|
|
48
48
|
* @returns Array of edges present in both faces (via isSame comparison).
|
|
49
49
|
*/
|
|
50
|
-
export declare function sharedEdges(face1: Face
|
|
50
|
+
export declare function sharedEdges<D extends Dimension>(face1: Face<D>, face2: Face<D>): Edge<D>[];
|
|
51
51
|
//# sourceMappingURL=adjacencyFns.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adjacencyFns.d.ts","sourceRoot":"","sources":["../../src/topology/adjacencyFns.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"adjacencyFns.d.ts","sourceRoot":"","sources":["../../src/topology/adjacencyFns.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAgG3F;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,CAG9F;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,CAGzE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,CAGzE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,CAG9E;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,CAmDhG;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,SAAS,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,CA4B1F"}
|
package/dist/topology/api.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Vec3, MatrixInput } from '../core/types.js';
|
|
2
2
|
import { Result } from '../core/result.js';
|
|
3
|
-
import { AnyShape, Edge, Face, Shape3D, Shell, Solid } from '../core/shapeTypes.js';
|
|
3
|
+
import { AnyShape, Dimension, Edge, Face, Shape3D, Shell, Solid } from '../core/shapeTypes.js';
|
|
4
4
|
import { Shapeable, FinderFn, FilletRadius, ChamferDistance } from './apiTypes.js';
|
|
5
5
|
import { ShapeFinder } from '../query/finderFns.js';
|
|
6
6
|
import { PlaneInput } from '../core/planeTypes.js';
|
|
@@ -8,7 +8,7 @@ import * as transforms from './shapeFns.js';
|
|
|
8
8
|
import * as booleans from './booleanFns.js';
|
|
9
9
|
import * as meshing from './meshFns.js';
|
|
10
10
|
/** Translate a shape by a vector. Returns a new shape. */
|
|
11
|
-
export declare function translate<T extends AnyShape
|
|
11
|
+
export declare function translate<T extends AnyShape<Dimension>>(shape: Shapeable<T>, v: Vec3): T;
|
|
12
12
|
/** Options for {@link rotate}. */
|
|
13
13
|
export interface RotateOptions {
|
|
14
14
|
/** Pivot point. Default: [0, 0, 0]. */
|
|
@@ -17,7 +17,7 @@ export interface RotateOptions {
|
|
|
17
17
|
axis?: Vec3;
|
|
18
18
|
}
|
|
19
19
|
/** Rotate a shape around an axis. Angle is in degrees. Returns a new shape. */
|
|
20
|
-
export declare function rotate<T extends AnyShape
|
|
20
|
+
export declare function rotate<T extends AnyShape<Dimension>>(shape: Shapeable<T>, angle: number, options?: RotateOptions): T;
|
|
21
21
|
/** Options for {@link mirror}. */
|
|
22
22
|
export interface MirrorOptions {
|
|
23
23
|
/** Plane normal. Default: [1, 0, 0]. */
|
|
@@ -26,16 +26,16 @@ export interface MirrorOptions {
|
|
|
26
26
|
at?: Vec3;
|
|
27
27
|
}
|
|
28
28
|
/** Mirror a shape through a plane. Returns a new shape. */
|
|
29
|
-
export declare function mirror<T extends AnyShape
|
|
29
|
+
export declare function mirror<T extends AnyShape<Dimension>>(shape: Shapeable<T>, options?: MirrorOptions): T;
|
|
30
30
|
/** Options for {@link scale}. */
|
|
31
31
|
export interface ScaleOptions {
|
|
32
32
|
/** Center of scaling. Default: [0, 0, 0]. */
|
|
33
33
|
center?: Vec3;
|
|
34
34
|
}
|
|
35
35
|
/** Scale a shape uniformly. Returns a new shape. */
|
|
36
|
-
export declare function scale<T extends AnyShape
|
|
36
|
+
export declare function scale<T extends AnyShape<Dimension>>(shape: Shapeable<T>, factor: number, options?: ScaleOptions): T;
|
|
37
37
|
/** Clone a shape (deep copy). */
|
|
38
|
-
export declare function clone<T extends AnyShape
|
|
38
|
+
export declare function clone<T extends AnyShape<Dimension>>(shape: Shapeable<T>): T;
|
|
39
39
|
/**
|
|
40
40
|
* Apply a 4x4 affine transformation matrix to a shape.
|
|
41
41
|
* Equivalent to OpenSCAD's `multmatrix`.
|
|
@@ -43,14 +43,14 @@ export declare function clone<T extends AnyShape>(shape: Shapeable<T>): T;
|
|
|
43
43
|
* Accepts either a raw `Matrix4x4` (4 rows of 4 numbers, row-major) or a structured
|
|
44
44
|
* `MatrixTransform` with explicit `linear` and `translation` fields.
|
|
45
45
|
*/
|
|
46
|
-
export declare function applyMatrix<T extends AnyShape
|
|
46
|
+
export declare function applyMatrix<T extends AnyShape<Dimension>>(shape: Shapeable<T>, matrix: MatrixInput): T;
|
|
47
47
|
export type { TransformOp, ComposedTransform } from './shapeFns.js';
|
|
48
48
|
export { composeTransforms } from './shapeFns.js';
|
|
49
49
|
/**
|
|
50
50
|
* Clone a shape and apply a pre-composed transform in a single kernel operation.
|
|
51
51
|
* Much faster than separate clone() + translate() + rotate() calls for batch patterns.
|
|
52
52
|
*/
|
|
53
|
-
export declare function transformCopy<T extends AnyShape
|
|
53
|
+
export declare function transformCopy<T extends AnyShape<Dimension>>(shape: Shapeable<T>, composed: transforms.ComposedTransform): T;
|
|
54
54
|
/** Fuse two 3D shapes (boolean union). */
|
|
55
55
|
export declare function fuse<T extends Shape3D>(a: Shapeable<T>, b: Shapeable<Shape3D>, options?: booleans.BooleanOptions): Result<T>;
|
|
56
56
|
/** Cut a tool from a base shape (boolean subtraction). */
|
|
@@ -58,22 +58,22 @@ export declare function cut<T extends Shape3D>(base: Shapeable<T>, tool: Shapeab
|
|
|
58
58
|
/** Compute the intersection of two shapes (boolean common). */
|
|
59
59
|
export declare function intersect<T extends Shape3D>(a: Shapeable<T>, b: Shapeable<Shape3D>, options?: booleans.BooleanOptions): Result<T>;
|
|
60
60
|
/** Section (cross-section) a shape with a plane. */
|
|
61
|
-
export declare function section(shape: Shapeable<AnyShape
|
|
61
|
+
export declare function section(shape: Shapeable<AnyShape<Dimension>>, plane: PlaneInput, options?: {
|
|
62
62
|
approximation?: boolean;
|
|
63
63
|
planeSize?: number;
|
|
64
|
-
}): Result<AnyShape
|
|
64
|
+
}): Result<AnyShape<Dimension>>;
|
|
65
65
|
/** Section a shape with a plane and return a filled Face. */
|
|
66
|
-
export declare function sectionToFace(shape: Shapeable<AnyShape
|
|
66
|
+
export declare function sectionToFace(shape: Shapeable<AnyShape<Dimension>>, plane: PlaneInput, options?: {
|
|
67
67
|
approximation?: boolean;
|
|
68
68
|
planeSize?: number;
|
|
69
69
|
}): Result<Face>;
|
|
70
70
|
/** Split a shape with tool shapes. */
|
|
71
|
-
export declare function split(shape: Shapeable<AnyShape
|
|
71
|
+
export declare function split(shape: Shapeable<AnyShape<Dimension>>, tools: AnyShape<Dimension>[]): Result<AnyShape<Dimension>>;
|
|
72
72
|
/** Slice a shape with multiple planes. */
|
|
73
|
-
export declare function slice(shape: Shapeable<AnyShape
|
|
73
|
+
export declare function slice(shape: Shapeable<AnyShape<Dimension>>, planes: PlaneInput[], options?: {
|
|
74
74
|
approximation?: boolean;
|
|
75
75
|
planeSize?: number;
|
|
76
|
-
}): Result<AnyShape[]>;
|
|
76
|
+
}): Result<AnyShape<Dimension>[]>;
|
|
77
77
|
/** Apply a fillet to all edges of a 3D shape. */
|
|
78
78
|
export declare function fillet<T extends Shape3D>(shape: Shapeable<T>, radius: FilletRadius): Result<T>;
|
|
79
79
|
/** Apply a fillet to selected edges of a 3D shape. */
|
|
@@ -91,29 +91,29 @@ export declare function offset<T extends Shape3D>(shape: Shapeable<T>, distance:
|
|
|
91
91
|
tolerance?: number;
|
|
92
92
|
}): Result<T>;
|
|
93
93
|
/** Thicken a surface (face or shell) into a solid. */
|
|
94
|
-
export declare function thicken(shape: Shapeable<Face | Shell>, thickness: number): Result<Solid>;
|
|
94
|
+
export declare function thicken(shape: Shapeable<Face<Dimension> | Shell>, thickness: number): Result<Solid>;
|
|
95
95
|
/** Heal a shape using the appropriate fixer. */
|
|
96
|
-
export declare function heal<T extends AnyShape
|
|
96
|
+
export declare function heal<T extends AnyShape<Dimension>>(shape: Shapeable<T>): Result<T>;
|
|
97
97
|
/** Simplify a shape by merging same-domain faces/edges. */
|
|
98
|
-
export declare function simplify<T extends AnyShape
|
|
98
|
+
export declare function simplify<T extends AnyShape<Dimension>>(shape: Shapeable<T>): T;
|
|
99
99
|
/** Mesh a shape for rendering. */
|
|
100
|
-
export declare function mesh(shape: Shapeable<AnyShape
|
|
100
|
+
export declare function mesh(shape: Shapeable<AnyShape<Dimension>>, options?: meshing.MeshOptions & {
|
|
101
101
|
skipNormals?: boolean;
|
|
102
102
|
includeUVs?: boolean;
|
|
103
103
|
cache?: boolean;
|
|
104
104
|
}): meshing.ShapeMesh;
|
|
105
105
|
/** Mesh the edges of a shape for wireframe rendering. */
|
|
106
|
-
export declare function meshEdges(shape: Shapeable<AnyShape
|
|
106
|
+
export declare function meshEdges(shape: Shapeable<AnyShape<Dimension>>, options?: meshing.MeshOptions & {
|
|
107
107
|
cache?: boolean;
|
|
108
108
|
}): meshing.EdgeMesh;
|
|
109
109
|
/** Get a summary description of a shape. */
|
|
110
|
-
export declare function describe(shape: Shapeable<AnyShape
|
|
110
|
+
export declare function describe(shape: Shapeable<AnyShape<Dimension>>): transforms.ShapeDescription;
|
|
111
111
|
/** Serialize a shape to BREP format. */
|
|
112
|
-
export declare function toBREP(shape: Shapeable<AnyShape
|
|
112
|
+
export declare function toBREP(shape: Shapeable<AnyShape<Dimension>>): string;
|
|
113
113
|
/** Deserialize a shape from BREP format. */
|
|
114
|
-
export declare function fromBREP(data: string): Result<AnyShape
|
|
114
|
+
export declare function fromBREP(data: string): Result<AnyShape<Dimension>>;
|
|
115
115
|
/** Check if a shape is valid. */
|
|
116
|
-
export declare function isValid(shape: Shapeable<AnyShape
|
|
116
|
+
export declare function isValid(shape: Shapeable<AnyShape<Dimension>>): boolean;
|
|
117
117
|
/** Check if a shape is empty (null). */
|
|
118
|
-
export declare function isEmpty(shape: Shapeable<AnyShape
|
|
118
|
+
export declare function isEmpty(shape: Shapeable<AnyShape<Dimension>>): boolean;
|
|
119
119
|
//# sourceMappingURL=api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/topology/api.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/topology/api.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACpG,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAExF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,QAAQ,MAAM,iBAAiB,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M,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAElE;AAED,iCAAiC;AACjC,wBAAgB,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,GAAG,OAAO,CAEtE;AAED,wCAAwC;AACxC,wBAAgB,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,GAAG,OAAO,CAEtE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Vec2, Vec3 } from '../core/types.js';
|
|
2
|
-
import { AnyShape, Edge, Face, Wire, Shape3D } from '../core/shapeTypes.js';
|
|
2
|
+
import { AnyShape, Dimension, Edge, Face, Wire, Shape3D } from '../core/shapeTypes.js';
|
|
3
3
|
import { ShapeFinder } from '../query/finderFns.js';
|
|
4
4
|
/**
|
|
5
5
|
* Structural type matching a Drawing's wire-producing interface.
|
|
@@ -12,7 +12,7 @@ export interface DrawingLike {
|
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
/** Callback that configures a shape finder for inline use in modifiers. */
|
|
15
|
-
export type FinderFn<T extends AnyShape
|
|
15
|
+
export type FinderFn<T extends AnyShape<Dimension>> = (finder: ShapeFinder<T>) => ShapeFinder<T>;
|
|
16
16
|
/**
|
|
17
17
|
* Fillet radius specification.
|
|
18
18
|
*
|
|
@@ -20,7 +20,7 @@ export type FinderFn<T extends AnyShape> = (finder: ShapeFinder<T>) => ShapeFind
|
|
|
20
20
|
* - `[number, number]` — variable radius (start, end)
|
|
21
21
|
* - callback — per-edge radius; return `null` to skip an edge
|
|
22
22
|
*/
|
|
23
|
-
export type FilletRadius = number | [number, number] | ((edge: Edge) => number | [number, number] | null);
|
|
23
|
+
export type FilletRadius = number | [number, number] | ((edge: Edge<Dimension>) => number | [number, number] | null);
|
|
24
24
|
/**
|
|
25
25
|
* Chamfer distance specification.
|
|
26
26
|
*
|
|
@@ -32,7 +32,7 @@ export type FilletRadius = number | [number, number] | ((edge: Edge) => number |
|
|
|
32
32
|
export type ChamferDistance = number | [number, number] | {
|
|
33
33
|
distance: number;
|
|
34
34
|
angle: number;
|
|
35
|
-
} | ((edge: Edge) => number | [number, number] | {
|
|
35
|
+
} | ((edge: Edge<Dimension>) => number | [number, number] | {
|
|
36
36
|
distance: number;
|
|
37
37
|
angle: number;
|
|
38
38
|
} | null);
|
|
@@ -94,7 +94,7 @@ export interface RectangularPatternOptions {
|
|
|
94
94
|
* for the `resolve()` utility and `Shapeable<T>` type to work without
|
|
95
95
|
* creating circular imports.
|
|
96
96
|
*/
|
|
97
|
-
export interface WrappedMarker<T extends AnyShape
|
|
97
|
+
export interface WrappedMarker<T extends AnyShape<Dimension>> {
|
|
98
98
|
readonly val: T;
|
|
99
99
|
/** Brand property to distinguish wrappers from branded shape handles. */
|
|
100
100
|
readonly __wrapped: true;
|
|
@@ -105,9 +105,9 @@ export interface WrappedMarker<T extends AnyShape> {
|
|
|
105
105
|
* All functional API functions use this as their shape parameter type,
|
|
106
106
|
* enabling seamless interop between styles.
|
|
107
107
|
*/
|
|
108
|
-
export type Shapeable<T extends AnyShape
|
|
108
|
+
export type Shapeable<T extends AnyShape<Dimension>> = T | WrappedMarker<T>;
|
|
109
109
|
/** Extract the raw branded shape from a Shapeable value. */
|
|
110
|
-
export declare function resolve<T extends AnyShape
|
|
110
|
+
export declare function resolve<T extends AnyShape<Dimension>>(s: Shapeable<T>): T;
|
|
111
111
|
/** Extract the raw branded 3D shape from a Shapeable<Shape3D>. */
|
|
112
112
|
export declare function resolve3D(s: Shapeable<Shape3D>): Shape3D;
|
|
113
113
|
//# sourceMappingURL=apiTypes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiTypes.d.ts","sourceRoot":"","sources":["../../src/topology/apiTypes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAA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