brepjs 13.0.0 → 13.2.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.cjs +3 -3
- package/dist/2d.js +3 -3
- package/dist/{arrayAccess-CccV7jov.js → arrayAccess-Dps31ERU.js} +3 -3
- package/dist/{arrayAccess-BF8Hm4-H.cjs → arrayAccess-peFKE9Ob.cjs} +3 -3
- package/dist/{blueprint-mSGgCL3V.js → blueprint-DYCdRlW5.js} +8 -8
- package/dist/{blueprint-BP3P8Ado.cjs → blueprint-PLJan-W5.cjs} +8 -8
- package/dist/{blueprintFns-BQ-MP_Vy.cjs → blueprintFns-Bsx25BG7.cjs} +3 -3
- package/dist/{blueprintFns-DWFkjbDT.js → blueprintFns-eWh7NpZx.js} +3 -3
- package/dist/{boolean2D-Cqfwz60G.js → boolean2D-52qVCooY.js} +10 -10
- package/dist/{boolean2D-D76Hc7Wx.cjs → boolean2D-CtB21ajK.cjs} +10 -10
- package/dist/{booleanFns-CYPXeNVN.cjs → booleanFns-BrptUFkP.cjs} +25 -13
- package/dist/{booleanFns-B79ALtKn.js → booleanFns-iM6UPb8e.js} +25 -13
- package/dist/brepjs.cjs +43 -311
- package/dist/brepjs.js +23 -306
- package/dist/core/errors.d.ts +7 -0
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core.cjs +3 -3
- package/dist/core.js +3 -3
- package/dist/{cornerFinder-BSwshSGB.js → cornerFinder-C7aDyYLJ.js} +2 -2
- package/dist/{cornerFinder-sg0JNgux.cjs → cornerFinder-SF-xmMO1.cjs} +2 -2
- package/dist/{curveFns-D_s3LdNT.js → curveFns-C-jU1_Y_.js} +2 -2
- package/dist/{curveFns-CJjkUGyW.cjs → curveFns-ywh7Ctyk.cjs} +2 -2
- package/dist/{drawFns-oyqai_HD.js → drawFns-D-0p86Lf.js} +13 -13
- package/dist/{drawFns-0CYuQn0J.cjs → drawFns-DknEB-Qs.cjs} +13 -13
- package/dist/{errors-B1fl3mAU.js → errors-B_T0aMQF.js} +7 -0
- package/dist/{errors-C85KVJr-.cjs → errors-DupKEMqI.cjs} +7 -0
- package/dist/{extrudeFns-0kBZvqJz.cjs → extrudeFns-CGCIbydL.cjs} +2 -2
- package/dist/{extrudeFns-lDvV4ir2.js → extrudeFns-LsH1rDMa.js} +2 -2
- package/dist/{faceFns-8BurpAGN.cjs → faceFns-8dGb8q3J.cjs} +2 -2
- package/dist/{faceFns-Bne5RIvn.js → faceFns-EnGcKFAr.js} +2 -2
- package/dist/{helpers-CxexSe1n.js → helpers-Rf0vhX6I.js} +6 -6
- package/dist/{helpers-D8DIMw2U.cjs → helpers-pQpV9Mwh.cjs} +6 -6
- package/dist/{historyFns-BTeasREV.js → historyFns-XkjLAQyu.js} +5 -5
- package/dist/{historyFns-BAzQr6EP.cjs → historyFns-lNalnOdR.cjs} +5 -5
- package/dist/{importFns-D__wN_Pq.cjs → importFns-BSH9cGIp.cjs} +36 -4
- package/dist/{importFns-clldr3EF.js → importFns-Bgs-FYAP.js} +31 -5
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/io/stepConfigFns.d.ts +27 -0
- package/dist/io/stepConfigFns.d.ts.map +1 -0
- package/dist/io.cjs +3 -2
- package/dist/io.d.ts +1 -0
- package/dist/io.d.ts.map +1 -1
- package/dist/io.js +3 -3
- package/dist/kernel/brepkit/booleanOps.d.ts +7 -1
- package/dist/kernel/brepkit/booleanOps.d.ts.map +1 -1
- package/dist/kernel/brepkit/brepkitAdapter.d.ts +5 -4
- package/dist/kernel/brepkit/brepkitAdapter.d.ts.map +1 -1
- package/dist/kernel/brepkit/evolutionOps.d.ts +4 -4
- package/dist/kernel/brepkit/evolutionOps.d.ts.map +1 -1
- package/dist/kernel/interfaces/booleanOps.d.ts +3 -1
- package/dist/kernel/interfaces/booleanOps.d.ts.map +1 -1
- package/dist/kernel/interfaces/evolutionOps.d.ts +4 -4
- package/dist/kernel/interfaces/evolutionOps.d.ts.map +1 -1
- package/dist/kernel/occt/booleanOps.d.ts +7 -1
- package/dist/kernel/occt/booleanOps.d.ts.map +1 -1
- package/dist/kernel/occt/defaultAdapter.d.ts +5 -4
- package/dist/kernel/occt/defaultAdapter.d.ts.map +1 -1
- package/dist/kernel/occt/evolutionOps.d.ts +2 -2
- package/dist/kernel/occt/evolutionOps.d.ts.map +1 -1
- package/dist/kernel/occt/historyOps.d.ts +4 -4
- package/dist/kernel/occt/historyOps.d.ts.map +1 -1
- package/dist/kernel/occt/wasmTypes/occtBuilders.d.ts +4 -0
- package/dist/kernel/occt/wasmTypes/occtBuilders.d.ts.map +1 -1
- package/dist/kernel/types.d.ts +30 -0
- package/dist/kernel/types.d.ts.map +1 -1
- package/dist/{measureFns-DrMZGJ6r.cjs → measureFns-CFdHa_fj.cjs} +3 -3
- package/dist/{measureFns-C4WqH4OT.js → measureFns-D7J6qUY_.js} +3 -3
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-DvOM43vV.cjs → meshFns-2XnDXgIh.cjs} +3 -3
- package/dist/{meshFns--M5PTyHG.js → meshFns-B7uklc4M.js} +3 -3
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{planeOps-DPintPbl.js → planeOps-BuBXTLBr.js} +1 -1
- package/dist/{planeOps-DdkIuVjk.cjs → planeOps-cTxDywpG.cjs} +1 -1
- package/dist/primitiveFns-CASk8g16.js +1452 -0
- package/dist/primitiveFns-DKtvEA0i.cjs +1817 -0
- package/dist/query.cjs +2 -2
- package/dist/query.js +2 -2
- package/dist/result.cjs +1 -1
- package/dist/result.js +1 -1
- package/dist/{shapeTypes-GmE4D5Q_.cjs → shapeTypes-CElaawp7.cjs} +114 -9
- package/dist/{shapeTypes-D38b_BKF.js → shapeTypes-CYb8Byqj.js} +114 -9
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.js +2 -2
- package/dist/{solidBuilders-FaTmd_PS.js → solidBuilders-ClJxiUa3.js} +3 -3
- package/dist/{solidBuilders-BqU0oT2q.cjs → solidBuilders-Cs4XyL58.cjs} +3 -3
- package/dist/{surfaceBuilders-DiCVk_Un.js → surfaceBuilders-DnGdDW8i.js} +3 -3
- package/dist/{surfaceBuilders-BzDQQ4EG.cjs → surfaceBuilders-ZUTb3z6i.cjs} +3 -3
- package/dist/topology/booleanDiagnosticFns.d.ts +18 -0
- package/dist/topology/booleanDiagnosticFns.d.ts.map +1 -0
- package/dist/topology/booleanFns.d.ts.map +1 -1
- package/dist/topology/evolutionFns.d.ts +71 -0
- package/dist/topology/evolutionFns.d.ts.map +1 -0
- package/dist/topology/healingFns.d.ts +17 -0
- package/dist/topology/healingFns.d.ts.map +1 -1
- package/dist/topology/modifierFns.d.ts +15 -0
- package/dist/topology/modifierFns.d.ts.map +1 -1
- package/dist/topology/positionFns.d.ts +15 -0
- package/dist/topology/positionFns.d.ts.map +1 -0
- package/dist/topology.cjs +18 -6
- package/dist/topology.d.ts +6 -1
- package/dist/topology.d.ts.map +1 -1
- package/dist/topology.js +7 -7
- package/dist/vectors.cjs +1 -1
- package/dist/vectors.js +1 -1
- package/package.json +1 -1
- package/dist/primitiveFns-BXufrcii.cjs +0 -1063
- package/dist/primitiveFns-u3Bbdvlw.js +0 -806
package/dist/query.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_helpers = require("./helpers-
|
|
3
|
-
const require_cornerFinder = require("./cornerFinder-
|
|
2
|
+
const require_helpers = require("./helpers-pQpV9Mwh.cjs");
|
|
3
|
+
const require_cornerFinder = require("./cornerFinder-SF-xmMO1.cjs");
|
|
4
4
|
exports.cornerFinder = require_cornerFinder.cornerFinder;
|
|
5
5
|
exports.edgeFinder = require_helpers.edgeFinder;
|
|
6
6
|
exports.faceFinder = require_helpers.faceFinder;
|
package/dist/query.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as edgeFinder, r as faceFinder, t as getSingleFace } from "./helpers-
|
|
2
|
-
import { t as cornerFinder } from "./cornerFinder-
|
|
1
|
+
import { n as edgeFinder, r as faceFinder, t as getSingleFace } from "./helpers-Rf0vhX6I.js";
|
|
2
|
+
import { t as cornerFinder } from "./cornerFinder-C7aDyYLJ.js";
|
|
3
3
|
export { cornerFinder, edgeFinder, faceFinder, getSingleFace };
|
package/dist/result.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_errors = require("./errors-
|
|
2
|
+
const require_errors = require("./errors-DupKEMqI.cjs");
|
|
3
3
|
exports.BrepBugError = require_errors.BrepBugError;
|
|
4
4
|
exports.BrepErrorCode = require_errors.BrepErrorCode;
|
|
5
5
|
exports.OK = require_errors.OK;
|
package/dist/result.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { B as unwrapOrElse, C as isErr, D as mapErr, F as tryCatch, I as tryCatchAsync, L as unwrap, M as pipeline, O as match, R as unwrapErr, T as map, _ as andThen, a as moduleInitError, b as flatMap, c as sketcherStateError, d as validationError, h as OK, i as kernelError, k as ok, l as typeCastError, m as bug, n as computationError, o as queryError, p as BrepBugError, r as ioError, t as BrepErrorCode, v as collect, w as isOk, y as err, z as unwrapOr } from "./errors-
|
|
1
|
+
import { B as unwrapOrElse, C as isErr, D as mapErr, F as tryCatch, I as tryCatchAsync, L as unwrap, M as pipeline, O as match, R as unwrapErr, T as map, _ as andThen, a as moduleInitError, b as flatMap, c as sketcherStateError, d as validationError, h as OK, i as kernelError, k as ok, l as typeCastError, m as bug, n as computationError, o as queryError, p as BrepBugError, r as ioError, t as BrepErrorCode, v as collect, w as isOk, y as err, z as unwrapOr } from "./errors-B_T0aMQF.js";
|
|
2
2
|
export { BrepBugError, BrepErrorCode, OK, andThen, bug, collect, computationError, err, flatMap, ioError, isErr, isOk, kernelError, map, mapErr, match, moduleInitError, ok, pipeline, queryError, sketcherStateError, tryCatch, tryCatchAsync, typeCastError, unwrap, unwrapErr, unwrapOr, unwrapOrElse, validationError };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_errors = require("./errors-
|
|
1
|
+
const require_errors = require("./errors-DupKEMqI.cjs");
|
|
2
2
|
//#region src/kernel/kernel2dTypes.ts
|
|
3
3
|
/** Check if the kernel supports 2D geometry operations. */
|
|
4
4
|
function supportsKernel2D(kernel) {
|
|
@@ -709,6 +709,42 @@ function cutAll$1(oc, shape, tools, options = {}) {
|
|
|
709
709
|
toolCompound.delete();
|
|
710
710
|
return result;
|
|
711
711
|
}
|
|
712
|
+
/**
|
|
713
|
+
* Pre-validate operands before a boolean operation.
|
|
714
|
+
*
|
|
715
|
+
* Checks that both shapes are non-null and topologically valid.
|
|
716
|
+
*/
|
|
717
|
+
function checkBoolean$1(_oc, shape, tool, _op, isValid) {
|
|
718
|
+
const issues = [];
|
|
719
|
+
if (shape.IsNull()) issues.push({
|
|
720
|
+
operand: "base",
|
|
721
|
+
issue: "null-shape",
|
|
722
|
+
message: "Base shape is null"
|
|
723
|
+
});
|
|
724
|
+
if (tool.IsNull()) issues.push({
|
|
725
|
+
operand: "tool",
|
|
726
|
+
issue: "null-shape",
|
|
727
|
+
message: "Tool shape is null"
|
|
728
|
+
});
|
|
729
|
+
if (issues.length > 0) return {
|
|
730
|
+
valid: false,
|
|
731
|
+
issues
|
|
732
|
+
};
|
|
733
|
+
if (!isValid(shape)) issues.push({
|
|
734
|
+
operand: "base",
|
|
735
|
+
issue: "not-valid",
|
|
736
|
+
message: "Base shape fails BRepCheck validation. Try autoHeal() first."
|
|
737
|
+
});
|
|
738
|
+
if (!isValid(tool)) issues.push({
|
|
739
|
+
operand: "tool",
|
|
740
|
+
issue: "not-valid",
|
|
741
|
+
message: "Tool shape fails BRepCheck validation. Try autoHeal() first."
|
|
742
|
+
});
|
|
743
|
+
return {
|
|
744
|
+
valid: issues.length === 0,
|
|
745
|
+
issues
|
|
746
|
+
};
|
|
747
|
+
}
|
|
712
748
|
//#endregion
|
|
713
749
|
//#region src/kernel/occt/meshOps.ts
|
|
714
750
|
/** Slice a Float32Array from the WASM heap, or return empty if size is 0. */
|
|
@@ -3436,11 +3472,16 @@ function transformWithEvolution(oc, shape, trsf, inputFaceHashes, hashUpperBound
|
|
|
3436
3472
|
/**
|
|
3437
3473
|
* Wrap a boolean operation with shape evolution tracking.
|
|
3438
3474
|
*/
|
|
3439
|
-
function booleanWithEvolution(oc, boolOp, inputShapes, inputFaceHashes, hashUpperBound, simplify) {
|
|
3475
|
+
function booleanWithEvolution(oc, boolOp, inputShapes, inputFaceHashes, hashUpperBound, simplify, diagnostics) {
|
|
3440
3476
|
if (simplify) boolOp.SimplifyResult(true, true, .001);
|
|
3441
3477
|
return {
|
|
3442
3478
|
shape: boolOp.Shape(),
|
|
3443
|
-
evolution: buildEvolution(oc, boolOp, inputShapes, inputFaceHashes, hashUpperBound)
|
|
3479
|
+
evolution: buildEvolution(oc, boolOp, inputShapes, inputFaceHashes, hashUpperBound),
|
|
3480
|
+
diagnostics: diagnostics ?? {
|
|
3481
|
+
hasErrors: false,
|
|
3482
|
+
hasWarnings: false,
|
|
3483
|
+
messages: []
|
|
3484
|
+
}
|
|
3444
3485
|
};
|
|
3445
3486
|
}
|
|
3446
3487
|
/**
|
|
@@ -4246,13 +4287,21 @@ function generalTransformWithHistory(oc, shape, linear, translation, _isOrthogon
|
|
|
4246
4287
|
trsf.delete();
|
|
4247
4288
|
return result;
|
|
4248
4289
|
}
|
|
4290
|
+
function extractDiagnostics(op) {
|
|
4291
|
+
return {
|
|
4292
|
+
hasErrors: op.HasErrors(),
|
|
4293
|
+
hasWarnings: op.HasWarnings(),
|
|
4294
|
+
messages: []
|
|
4295
|
+
};
|
|
4296
|
+
}
|
|
4249
4297
|
function fuseWithHistory(oc, shape, tool, inputFaceHashes, hashUpperBound, options = {}) {
|
|
4250
4298
|
const progress = new oc.Message_ProgressRange_1();
|
|
4251
4299
|
const fuseOp = new oc.BRepAlgoAPI_Fuse_3(shape, tool, progress);
|
|
4252
4300
|
applyGlue(oc, fuseOp, options.optimisation);
|
|
4253
4301
|
applyBooleanDefaults(fuseOp, options.fuzzyValue);
|
|
4254
4302
|
fuseOp.Build(progress);
|
|
4255
|
-
const
|
|
4303
|
+
const diagnostics = extractDiagnostics(fuseOp);
|
|
4304
|
+
const result = booleanWithEvolution(oc, fuseOp, [shape, tool], inputFaceHashes, hashUpperBound, options.simplify ?? false, diagnostics);
|
|
4256
4305
|
fuseOp.delete();
|
|
4257
4306
|
progress.delete();
|
|
4258
4307
|
return result;
|
|
@@ -4263,7 +4312,8 @@ function cutWithHistory(oc, shape, tool, inputFaceHashes, hashUpperBound, option
|
|
|
4263
4312
|
applyGlue(oc, cutOp, options.optimisation);
|
|
4264
4313
|
applyBooleanDefaults(cutOp, options.fuzzyValue);
|
|
4265
4314
|
cutOp.Build(progress);
|
|
4266
|
-
const
|
|
4315
|
+
const diagnostics = extractDiagnostics(cutOp);
|
|
4316
|
+
const result = booleanWithEvolution(oc, cutOp, [shape, tool], inputFaceHashes, hashUpperBound, options.simplify ?? false, diagnostics);
|
|
4267
4317
|
cutOp.delete();
|
|
4268
4318
|
progress.delete();
|
|
4269
4319
|
return result;
|
|
@@ -4274,7 +4324,8 @@ function intersectWithHistory(oc, shape, tool, inputFaceHashes, hashUpperBound,
|
|
|
4274
4324
|
applyGlue(oc, intOp, options.optimisation);
|
|
4275
4325
|
applyBooleanDefaults(intOp, options.fuzzyValue);
|
|
4276
4326
|
intOp.Build(progress);
|
|
4277
|
-
const
|
|
4327
|
+
const diagnostics = extractDiagnostics(intOp);
|
|
4328
|
+
const result = booleanWithEvolution(oc, intOp, [shape, tool], inputFaceHashes, hashUpperBound, options.simplify ?? false, diagnostics);
|
|
4278
4329
|
intOp.delete();
|
|
4279
4330
|
progress.delete();
|
|
4280
4331
|
return result;
|
|
@@ -4408,6 +4459,9 @@ var DefaultAdapter = class {
|
|
|
4408
4459
|
cutAll(shape, tools, options = {}) {
|
|
4409
4460
|
return cutAll$1(this.oc, shape, tools, options);
|
|
4410
4461
|
}
|
|
4462
|
+
checkBoolean(shape, tool, op) {
|
|
4463
|
+
return checkBoolean$1(this.oc, shape, tool, op, (s) => this.isValid(s));
|
|
4464
|
+
}
|
|
4411
4465
|
hull(shapes, tolerance) {
|
|
4412
4466
|
return hull$1(this.oc, shapes, tolerance);
|
|
4413
4467
|
}
|
|
@@ -6258,6 +6312,42 @@ function meshBoolean(bk, positionsA, indicesA, positionsB, indicesB, op, toleran
|
|
|
6258
6312
|
}]
|
|
6259
6313
|
};
|
|
6260
6314
|
}
|
|
6315
|
+
/**
|
|
6316
|
+
* Pre-validate operands before a boolean operation.
|
|
6317
|
+
*
|
|
6318
|
+
* Checks that both shapes are non-null and topologically valid.
|
|
6319
|
+
*/
|
|
6320
|
+
function checkBoolean(_bk, shape, tool, _op, isValid) {
|
|
6321
|
+
const issues = [];
|
|
6322
|
+
if (!isBrepkitHandle$1(shape) || shape.IsNull()) issues.push({
|
|
6323
|
+
operand: "base",
|
|
6324
|
+
issue: "null-shape",
|
|
6325
|
+
message: "Base shape is null"
|
|
6326
|
+
});
|
|
6327
|
+
if (!isBrepkitHandle$1(tool) || tool.IsNull()) issues.push({
|
|
6328
|
+
operand: "tool",
|
|
6329
|
+
issue: "null-shape",
|
|
6330
|
+
message: "Tool shape is null"
|
|
6331
|
+
});
|
|
6332
|
+
if (issues.length > 0) return {
|
|
6333
|
+
valid: false,
|
|
6334
|
+
issues
|
|
6335
|
+
};
|
|
6336
|
+
if (!isValid(shape)) issues.push({
|
|
6337
|
+
operand: "base",
|
|
6338
|
+
issue: "not-valid",
|
|
6339
|
+
message: "Base shape fails BRepCheck validation. Try autoHeal() first."
|
|
6340
|
+
});
|
|
6341
|
+
if (!isValid(tool)) issues.push({
|
|
6342
|
+
operand: "tool",
|
|
6343
|
+
issue: "not-valid",
|
|
6344
|
+
message: "Tool shape fails BRepCheck validation. Try autoHeal() first."
|
|
6345
|
+
});
|
|
6346
|
+
return {
|
|
6347
|
+
valid: issues.length === 0,
|
|
6348
|
+
issues
|
|
6349
|
+
};
|
|
6350
|
+
}
|
|
6261
6351
|
function hull(bk, shapes, _tolerance) {
|
|
6262
6352
|
const coords = [];
|
|
6263
6353
|
for (const shape of shapes) {
|
|
@@ -8237,6 +8327,9 @@ var BrepkitAdapter = class BrepkitAdapter {
|
|
|
8237
8327
|
split(shape, tools) {
|
|
8238
8328
|
return split(this.bk, shape, tools);
|
|
8239
8329
|
}
|
|
8330
|
+
checkBoolean(shape, tool, op) {
|
|
8331
|
+
return checkBoolean(this.bk, shape, tool, op, (s) => this.isValid(s));
|
|
8332
|
+
}
|
|
8240
8333
|
hull(shapes, _tolerance) {
|
|
8241
8334
|
return hull(this.bk, shapes, _tolerance);
|
|
8242
8335
|
}
|
|
@@ -8649,12 +8742,20 @@ var BrepkitAdapter = class BrepkitAdapter {
|
|
|
8649
8742
|
return this.buildEvolution(this.generalTransform(shape, linear, translation, isOrthogonal), inputFaceHashes, hashUpperBound, true);
|
|
8650
8743
|
}
|
|
8651
8744
|
booleanWithHistoryImpl(shape, tool, inputFaceHashes, hashUpperBound, options, nativeFn, fallbackFn, _label) {
|
|
8745
|
+
const noDiagnostics = {
|
|
8746
|
+
hasErrors: false,
|
|
8747
|
+
hasWarnings: false,
|
|
8748
|
+
messages: []
|
|
8749
|
+
};
|
|
8652
8750
|
const sh = shape;
|
|
8653
8751
|
const th = tool;
|
|
8654
8752
|
if (inputFaceHashes.length > 0 && sh.type === "solid") {
|
|
8655
8753
|
if (th.type === "solid") {
|
|
8656
8754
|
const json = nativeFn(sh.id, th.id);
|
|
8657
|
-
return
|
|
8755
|
+
return {
|
|
8756
|
+
...this.parseNativeEvolution(json, hashUpperBound),
|
|
8757
|
+
diagnostics: noDiagnostics
|
|
8758
|
+
};
|
|
8658
8759
|
}
|
|
8659
8760
|
if (th.type === "compound") {
|
|
8660
8761
|
const childSolidIds = toArray(this.bk.getCompoundSolids(th.id));
|
|
@@ -8685,12 +8786,16 @@ var BrepkitAdapter = class BrepkitAdapter {
|
|
|
8685
8786
|
modified: combinedModified,
|
|
8686
8787
|
generated: combinedGenerated,
|
|
8687
8788
|
deleted: combinedDeleted
|
|
8688
|
-
}
|
|
8789
|
+
},
|
|
8790
|
+
diagnostics: noDiagnostics
|
|
8689
8791
|
};
|
|
8690
8792
|
}
|
|
8691
8793
|
}
|
|
8692
8794
|
const fallbackResult = fallbackFn(shape, tool, options);
|
|
8693
|
-
return
|
|
8795
|
+
return {
|
|
8796
|
+
...this.buildEvolution(fallbackResult, inputFaceHashes, hashUpperBound, false, shape),
|
|
8797
|
+
diagnostics: noDiagnostics
|
|
8798
|
+
};
|
|
8694
8799
|
}
|
|
8695
8800
|
fuseWithHistory(shape, tool, inputFaceHashes, hashUpperBound, options) {
|
|
8696
8801
|
return this.booleanWithHistoryImpl(shape, tool, inputFaceHashes, hashUpperBound, options, (a, b) => this.bk.fuseWithEvolution(a, b), (s, t, o) => this.fuse(s, t, o), "fuseWithHistory");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k as ok, y as err } from "./errors-
|
|
1
|
+
import { k as ok, y as err } from "./errors-B_T0aMQF.js";
|
|
2
2
|
//#region src/kernel/kernel2dTypes.ts
|
|
3
3
|
/** Check if the kernel supports 2D geometry operations. */
|
|
4
4
|
function supportsKernel2D(kernel) {
|
|
@@ -709,6 +709,42 @@ function cutAll$1(oc, shape, tools, options = {}) {
|
|
|
709
709
|
toolCompound.delete();
|
|
710
710
|
return result;
|
|
711
711
|
}
|
|
712
|
+
/**
|
|
713
|
+
* Pre-validate operands before a boolean operation.
|
|
714
|
+
*
|
|
715
|
+
* Checks that both shapes are non-null and topologically valid.
|
|
716
|
+
*/
|
|
717
|
+
function checkBoolean$1(_oc, shape, tool, _op, isValid) {
|
|
718
|
+
const issues = [];
|
|
719
|
+
if (shape.IsNull()) issues.push({
|
|
720
|
+
operand: "base",
|
|
721
|
+
issue: "null-shape",
|
|
722
|
+
message: "Base shape is null"
|
|
723
|
+
});
|
|
724
|
+
if (tool.IsNull()) issues.push({
|
|
725
|
+
operand: "tool",
|
|
726
|
+
issue: "null-shape",
|
|
727
|
+
message: "Tool shape is null"
|
|
728
|
+
});
|
|
729
|
+
if (issues.length > 0) return {
|
|
730
|
+
valid: false,
|
|
731
|
+
issues
|
|
732
|
+
};
|
|
733
|
+
if (!isValid(shape)) issues.push({
|
|
734
|
+
operand: "base",
|
|
735
|
+
issue: "not-valid",
|
|
736
|
+
message: "Base shape fails BRepCheck validation. Try autoHeal() first."
|
|
737
|
+
});
|
|
738
|
+
if (!isValid(tool)) issues.push({
|
|
739
|
+
operand: "tool",
|
|
740
|
+
issue: "not-valid",
|
|
741
|
+
message: "Tool shape fails BRepCheck validation. Try autoHeal() first."
|
|
742
|
+
});
|
|
743
|
+
return {
|
|
744
|
+
valid: issues.length === 0,
|
|
745
|
+
issues
|
|
746
|
+
};
|
|
747
|
+
}
|
|
712
748
|
//#endregion
|
|
713
749
|
//#region src/kernel/occt/meshOps.ts
|
|
714
750
|
/** Slice a Float32Array from the WASM heap, or return empty if size is 0. */
|
|
@@ -3436,11 +3472,16 @@ function transformWithEvolution(oc, shape, trsf, inputFaceHashes, hashUpperBound
|
|
|
3436
3472
|
/**
|
|
3437
3473
|
* Wrap a boolean operation with shape evolution tracking.
|
|
3438
3474
|
*/
|
|
3439
|
-
function booleanWithEvolution(oc, boolOp, inputShapes, inputFaceHashes, hashUpperBound, simplify) {
|
|
3475
|
+
function booleanWithEvolution(oc, boolOp, inputShapes, inputFaceHashes, hashUpperBound, simplify, diagnostics) {
|
|
3440
3476
|
if (simplify) boolOp.SimplifyResult(true, true, .001);
|
|
3441
3477
|
return {
|
|
3442
3478
|
shape: boolOp.Shape(),
|
|
3443
|
-
evolution: buildEvolution(oc, boolOp, inputShapes, inputFaceHashes, hashUpperBound)
|
|
3479
|
+
evolution: buildEvolution(oc, boolOp, inputShapes, inputFaceHashes, hashUpperBound),
|
|
3480
|
+
diagnostics: diagnostics ?? {
|
|
3481
|
+
hasErrors: false,
|
|
3482
|
+
hasWarnings: false,
|
|
3483
|
+
messages: []
|
|
3484
|
+
}
|
|
3444
3485
|
};
|
|
3445
3486
|
}
|
|
3446
3487
|
/**
|
|
@@ -4246,13 +4287,21 @@ function generalTransformWithHistory(oc, shape, linear, translation, _isOrthogon
|
|
|
4246
4287
|
trsf.delete();
|
|
4247
4288
|
return result;
|
|
4248
4289
|
}
|
|
4290
|
+
function extractDiagnostics(op) {
|
|
4291
|
+
return {
|
|
4292
|
+
hasErrors: op.HasErrors(),
|
|
4293
|
+
hasWarnings: op.HasWarnings(),
|
|
4294
|
+
messages: []
|
|
4295
|
+
};
|
|
4296
|
+
}
|
|
4249
4297
|
function fuseWithHistory(oc, shape, tool, inputFaceHashes, hashUpperBound, options = {}) {
|
|
4250
4298
|
const progress = new oc.Message_ProgressRange_1();
|
|
4251
4299
|
const fuseOp = new oc.BRepAlgoAPI_Fuse_3(shape, tool, progress);
|
|
4252
4300
|
applyGlue(oc, fuseOp, options.optimisation);
|
|
4253
4301
|
applyBooleanDefaults(fuseOp, options.fuzzyValue);
|
|
4254
4302
|
fuseOp.Build(progress);
|
|
4255
|
-
const
|
|
4303
|
+
const diagnostics = extractDiagnostics(fuseOp);
|
|
4304
|
+
const result = booleanWithEvolution(oc, fuseOp, [shape, tool], inputFaceHashes, hashUpperBound, options.simplify ?? false, diagnostics);
|
|
4256
4305
|
fuseOp.delete();
|
|
4257
4306
|
progress.delete();
|
|
4258
4307
|
return result;
|
|
@@ -4263,7 +4312,8 @@ function cutWithHistory(oc, shape, tool, inputFaceHashes, hashUpperBound, option
|
|
|
4263
4312
|
applyGlue(oc, cutOp, options.optimisation);
|
|
4264
4313
|
applyBooleanDefaults(cutOp, options.fuzzyValue);
|
|
4265
4314
|
cutOp.Build(progress);
|
|
4266
|
-
const
|
|
4315
|
+
const diagnostics = extractDiagnostics(cutOp);
|
|
4316
|
+
const result = booleanWithEvolution(oc, cutOp, [shape, tool], inputFaceHashes, hashUpperBound, options.simplify ?? false, diagnostics);
|
|
4267
4317
|
cutOp.delete();
|
|
4268
4318
|
progress.delete();
|
|
4269
4319
|
return result;
|
|
@@ -4274,7 +4324,8 @@ function intersectWithHistory(oc, shape, tool, inputFaceHashes, hashUpperBound,
|
|
|
4274
4324
|
applyGlue(oc, intOp, options.optimisation);
|
|
4275
4325
|
applyBooleanDefaults(intOp, options.fuzzyValue);
|
|
4276
4326
|
intOp.Build(progress);
|
|
4277
|
-
const
|
|
4327
|
+
const diagnostics = extractDiagnostics(intOp);
|
|
4328
|
+
const result = booleanWithEvolution(oc, intOp, [shape, tool], inputFaceHashes, hashUpperBound, options.simplify ?? false, diagnostics);
|
|
4278
4329
|
intOp.delete();
|
|
4279
4330
|
progress.delete();
|
|
4280
4331
|
return result;
|
|
@@ -4408,6 +4459,9 @@ var DefaultAdapter = class {
|
|
|
4408
4459
|
cutAll(shape, tools, options = {}) {
|
|
4409
4460
|
return cutAll$1(this.oc, shape, tools, options);
|
|
4410
4461
|
}
|
|
4462
|
+
checkBoolean(shape, tool, op) {
|
|
4463
|
+
return checkBoolean$1(this.oc, shape, tool, op, (s) => this.isValid(s));
|
|
4464
|
+
}
|
|
4411
4465
|
hull(shapes, tolerance) {
|
|
4412
4466
|
return hull$1(this.oc, shapes, tolerance);
|
|
4413
4467
|
}
|
|
@@ -6258,6 +6312,42 @@ function meshBoolean(bk, positionsA, indicesA, positionsB, indicesB, op, toleran
|
|
|
6258
6312
|
}]
|
|
6259
6313
|
};
|
|
6260
6314
|
}
|
|
6315
|
+
/**
|
|
6316
|
+
* Pre-validate operands before a boolean operation.
|
|
6317
|
+
*
|
|
6318
|
+
* Checks that both shapes are non-null and topologically valid.
|
|
6319
|
+
*/
|
|
6320
|
+
function checkBoolean(_bk, shape, tool, _op, isValid) {
|
|
6321
|
+
const issues = [];
|
|
6322
|
+
if (!isBrepkitHandle$1(shape) || shape.IsNull()) issues.push({
|
|
6323
|
+
operand: "base",
|
|
6324
|
+
issue: "null-shape",
|
|
6325
|
+
message: "Base shape is null"
|
|
6326
|
+
});
|
|
6327
|
+
if (!isBrepkitHandle$1(tool) || tool.IsNull()) issues.push({
|
|
6328
|
+
operand: "tool",
|
|
6329
|
+
issue: "null-shape",
|
|
6330
|
+
message: "Tool shape is null"
|
|
6331
|
+
});
|
|
6332
|
+
if (issues.length > 0) return {
|
|
6333
|
+
valid: false,
|
|
6334
|
+
issues
|
|
6335
|
+
};
|
|
6336
|
+
if (!isValid(shape)) issues.push({
|
|
6337
|
+
operand: "base",
|
|
6338
|
+
issue: "not-valid",
|
|
6339
|
+
message: "Base shape fails BRepCheck validation. Try autoHeal() first."
|
|
6340
|
+
});
|
|
6341
|
+
if (!isValid(tool)) issues.push({
|
|
6342
|
+
operand: "tool",
|
|
6343
|
+
issue: "not-valid",
|
|
6344
|
+
message: "Tool shape fails BRepCheck validation. Try autoHeal() first."
|
|
6345
|
+
});
|
|
6346
|
+
return {
|
|
6347
|
+
valid: issues.length === 0,
|
|
6348
|
+
issues
|
|
6349
|
+
};
|
|
6350
|
+
}
|
|
6261
6351
|
function hull(bk, shapes, _tolerance) {
|
|
6262
6352
|
const coords = [];
|
|
6263
6353
|
for (const shape of shapes) {
|
|
@@ -8237,6 +8327,9 @@ var BrepkitAdapter = class BrepkitAdapter {
|
|
|
8237
8327
|
split(shape, tools) {
|
|
8238
8328
|
return split(this.bk, shape, tools);
|
|
8239
8329
|
}
|
|
8330
|
+
checkBoolean(shape, tool, op) {
|
|
8331
|
+
return checkBoolean(this.bk, shape, tool, op, (s) => this.isValid(s));
|
|
8332
|
+
}
|
|
8240
8333
|
hull(shapes, _tolerance) {
|
|
8241
8334
|
return hull(this.bk, shapes, _tolerance);
|
|
8242
8335
|
}
|
|
@@ -8649,12 +8742,20 @@ var BrepkitAdapter = class BrepkitAdapter {
|
|
|
8649
8742
|
return this.buildEvolution(this.generalTransform(shape, linear, translation, isOrthogonal), inputFaceHashes, hashUpperBound, true);
|
|
8650
8743
|
}
|
|
8651
8744
|
booleanWithHistoryImpl(shape, tool, inputFaceHashes, hashUpperBound, options, nativeFn, fallbackFn, _label) {
|
|
8745
|
+
const noDiagnostics = {
|
|
8746
|
+
hasErrors: false,
|
|
8747
|
+
hasWarnings: false,
|
|
8748
|
+
messages: []
|
|
8749
|
+
};
|
|
8652
8750
|
const sh = shape;
|
|
8653
8751
|
const th = tool;
|
|
8654
8752
|
if (inputFaceHashes.length > 0 && sh.type === "solid") {
|
|
8655
8753
|
if (th.type === "solid") {
|
|
8656
8754
|
const json = nativeFn(sh.id, th.id);
|
|
8657
|
-
return
|
|
8755
|
+
return {
|
|
8756
|
+
...this.parseNativeEvolution(json, hashUpperBound),
|
|
8757
|
+
diagnostics: noDiagnostics
|
|
8758
|
+
};
|
|
8658
8759
|
}
|
|
8659
8760
|
if (th.type === "compound") {
|
|
8660
8761
|
const childSolidIds = toArray(this.bk.getCompoundSolids(th.id));
|
|
@@ -8685,12 +8786,16 @@ var BrepkitAdapter = class BrepkitAdapter {
|
|
|
8685
8786
|
modified: combinedModified,
|
|
8686
8787
|
generated: combinedGenerated,
|
|
8687
8788
|
deleted: combinedDeleted
|
|
8688
|
-
}
|
|
8789
|
+
},
|
|
8790
|
+
diagnostics: noDiagnostics
|
|
8689
8791
|
};
|
|
8690
8792
|
}
|
|
8691
8793
|
}
|
|
8692
8794
|
const fallbackResult = fallbackFn(shape, tool, options);
|
|
8693
|
-
return
|
|
8795
|
+
return {
|
|
8796
|
+
...this.buildEvolution(fallbackResult, inputFaceHashes, hashUpperBound, false, shape),
|
|
8797
|
+
diagnostics: noDiagnostics
|
|
8798
|
+
};
|
|
8694
8799
|
}
|
|
8695
8800
|
fuseWithHistory(shape, tool, inputFaceHashes, hashUpperBound, options) {
|
|
8696
8801
|
return this.booleanWithHistoryImpl(shape, tool, inputFaceHashes, hashUpperBound, options, (a, b) => this.bk.fuseWithEvolution(a, b), (s, t, o) => this.fuse(s, t, o), "fuseWithHistory");
|
package/dist/sketching.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_drawFns = require("./drawFns-
|
|
3
|
-
const require_boolean2D = require("./boolean2D-
|
|
2
|
+
const require_drawFns = require("./drawFns-DknEB-Qs.cjs");
|
|
3
|
+
const require_boolean2D = require("./boolean2D-CtB21ajK.cjs");
|
|
4
4
|
//#region src/sketching.ts
|
|
5
5
|
/**
|
|
6
6
|
* brepjs/sketching — Sketcher, Drawing, and sketch-to-shape operations.
|
package/dist/sketching.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as FaceSketcher, f as Sketch, l as BaseSketcher2d, u as BlueprintSketcher } from "./boolean2D-
|
|
2
|
-
import { $ as sketchFaceOffset, A as DrawingPen, B as drawSingleCircle, F as drawParametricFunction, H as drawText, I as drawPointsInterpolation, L as drawPolysides, M as draw, N as drawCircle, P as drawEllipse, Q as sketchEllipse, R as drawRectangle, S as drawProjection, V as drawSingleEllipse, X as polysideInnerRadius, Y as makeBaseBox, Z as sketchCircle, _ as sketchLoft, a as drawingIntersect, at as Sketcher, b as sketchWires, c as rotateDrawing, d as compoundSketchExtrude, et as sketchHelix, f as compoundSketchFace, g as sketchFace, h as sketchExtrude, i as drawingFuse, it as sketchRoundedRectangle, j as deserializeDrawing, k as Drawing, l as scaleDrawing, m as compoundSketchRevolve, n as drawingCut, nt as sketchPolysides, o as drawingToSketchOnPlane, ot as Sketches, p as compoundSketchLoft, r as drawingFillet, rt as sketchRectangle, s as mirrorDrawing, st as CompoundSketch, t as drawingChamfer, tt as sketchParametricFunction, u as translateDrawing, v as sketchRevolve, x as drawFaceOutline, y as sketchSweep, z as drawRoundedRectangle } from "./drawFns-
|
|
1
|
+
import { d as FaceSketcher, f as Sketch, l as BaseSketcher2d, u as BlueprintSketcher } from "./boolean2D-52qVCooY.js";
|
|
2
|
+
import { $ as sketchFaceOffset, A as DrawingPen, B as drawSingleCircle, F as drawParametricFunction, H as drawText, I as drawPointsInterpolation, L as drawPolysides, M as draw, N as drawCircle, P as drawEllipse, Q as sketchEllipse, R as drawRectangle, S as drawProjection, V as drawSingleEllipse, X as polysideInnerRadius, Y as makeBaseBox, Z as sketchCircle, _ as sketchLoft, a as drawingIntersect, at as Sketcher, b as sketchWires, c as rotateDrawing, d as compoundSketchExtrude, et as sketchHelix, f as compoundSketchFace, g as sketchFace, h as sketchExtrude, i as drawingFuse, it as sketchRoundedRectangle, j as deserializeDrawing, k as Drawing, l as scaleDrawing, m as compoundSketchRevolve, n as drawingCut, nt as sketchPolysides, o as drawingToSketchOnPlane, ot as Sketches, p as compoundSketchLoft, r as drawingFillet, rt as sketchRectangle, s as mirrorDrawing, st as CompoundSketch, t as drawingChamfer, tt as sketchParametricFunction, u as translateDrawing, v as sketchRevolve, x as drawFaceOutline, y as sketchSweep, z as drawRoundedRectangle } from "./drawFns-D-0p86Lf.js";
|
|
3
3
|
//#region src/sketching.ts
|
|
4
4
|
/**
|
|
5
5
|
* brepjs/sketching — Sketcher, Drawing, and sketch-to-shape operations.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Y as getKernel, _ as isSolid, c as createSolid, g as isShell, h as isShape3D, i as createCompound, l as createVertex } from "./shapeTypes-
|
|
2
|
-
import { L as unwrap, _ as andThen, k as ok, l as typeCastError, y as err } from "./errors-
|
|
3
|
-
import { _ as downcast, g as cast } from "./faceFns-
|
|
1
|
+
import { Y as getKernel, _ as isSolid, c as createSolid, g as isShell, h as isShape3D, i as createCompound, l as createVertex } from "./shapeTypes-CYb8Byqj.js";
|
|
2
|
+
import { L as unwrap, _ as andThen, k as ok, l as typeCastError, y as err } from "./errors-B_T0aMQF.js";
|
|
3
|
+
import { _ as downcast, g as cast } from "./faceFns-EnGcKFAr.js";
|
|
4
4
|
//#region src/topology/shapeUtils.ts
|
|
5
5
|
/**
|
|
6
6
|
* Shape assembly utilities — welding and sewing operations.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
3
|
-
const require_faceFns = require("./faceFns-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-CElaawp7.cjs");
|
|
2
|
+
const require_errors = require("./errors-DupKEMqI.cjs");
|
|
3
|
+
const require_faceFns = require("./faceFns-8dGb8q3J.cjs");
|
|
4
4
|
//#region src/topology/shapeUtils.ts
|
|
5
5
|
/**
|
|
6
6
|
* Shape assembly utilities — welding and sewing operations.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Y as getKernel, a as createEdge, o as createFace, p as isFace, u as createWire, w as isPlanarFace } from "./shapeTypes-
|
|
2
|
-
import { _ as andThen, d as validationError, i as kernelError, k as ok, y as err } from "./errors-
|
|
3
|
-
import { g as cast, l as outerWire } from "./faceFns-
|
|
1
|
+
import { Y as getKernel, a as createEdge, o as createFace, p as isFace, u as createWire, w as isPlanarFace } from "./shapeTypes-CYb8Byqj.js";
|
|
2
|
+
import { _ as andThen, d as validationError, i as kernelError, k as ok, y as err } from "./errors-B_T0aMQF.js";
|
|
3
|
+
import { g as cast, l as outerWire } from "./faceFns-EnGcKFAr.js";
|
|
4
4
|
//#region src/utils/range.ts
|
|
5
5
|
/** Generate an array of integers `[0, 1, …, len - 1]`. */
|
|
6
6
|
function range(len) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
3
|
-
const require_faceFns = require("./faceFns-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-CElaawp7.cjs");
|
|
2
|
+
const require_errors = require("./errors-DupKEMqI.cjs");
|
|
3
|
+
const require_faceFns = require("./faceFns-8dGb8q3J.cjs");
|
|
4
4
|
//#region src/utils/range.ts
|
|
5
5
|
/** Generate an array of integers `[0, 1, …, len - 1]`. */
|
|
6
6
|
function range(len) {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Shape3D } from '../core/shapeTypes.js';
|
|
2
|
+
import { BooleanOpType, CheckBooleanResult } from '../kernel/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Pre-validate operands before a boolean operation.
|
|
5
|
+
*
|
|
6
|
+
* Checks that both shapes are non-null and topologically valid.
|
|
7
|
+
* Returns a structured report of any issues found.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const check = checkBoolean(base, tool, 'fuse');
|
|
12
|
+
* if (!check.valid) {
|
|
13
|
+
* console.warn('Boolean will likely fail:', check.issues);
|
|
14
|
+
* }
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare function checkBoolean(base: Shape3D, tool: Shape3D, op: BooleanOpType): CheckBooleanResult;
|
|
18
|
+
//# sourceMappingURL=booleanDiagnosticFns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"booleanDiagnosticFns.d.ts","sourceRoot":"","sources":["../../src/topology/booleanDiagnosticFns.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE3E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,aAAa,GAAG,kBAAkB,CAGhG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"booleanFns.d.ts","sourceRoot":"","sources":["../../src/topology/booleanFns.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACV,QAAQ,EAER,SAAS,EAET,YAAY,EAEZ,OAAO,EAGR,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,KA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C,QAAQ,CAAC,SAAS,CAAC,CAAC,CA4B7B;AA4ID;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,EAC1B,KAAK,EAAE,UAAU,EACjB,OAAO,GAAE;IAAE,aAAa,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GAC5D,MAAM,CAAC,YAAY,CAAC,CA0CtB;AAMD;;;GAGG;AACH,wBAAgB,KAAK,CACnB,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,EAC1B,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,GAC3B,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAmC7B;AAMD;;;GAGG;AACH,wBAAgB,KAAK,CACnB,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,EAC1B,MAAM,EAAE,UAAU,EAAE,EACpB,OAAO,GAAE;IAAE,aAAa,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GAC5D,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,CAQ/B"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Edge, Face, Shape3D } from '../core/shapeTypes.js';
|
|
2
|
+
import { ValidSolid } from '../core/validityTypes.js';
|
|
3
|
+
import { Result } from '../core/result.js';
|
|
4
|
+
import { BooleanOptions, ShapeEvolution } from '../kernel/types.js';
|
|
5
|
+
/** Result of an operation with face evolution tracking. */
|
|
6
|
+
export interface EvolutionResult<T> {
|
|
7
|
+
readonly shape: T;
|
|
8
|
+
readonly evolution: ShapeEvolution;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Fuse two 3D shapes together (boolean union), returning both the result
|
|
12
|
+
* shape and the face evolution data.
|
|
13
|
+
*
|
|
14
|
+
* @param a - The first operand.
|
|
15
|
+
* @param b - The second operand.
|
|
16
|
+
* @param options - Boolean operation options.
|
|
17
|
+
* @returns Ok with the fused shape and evolution, or Err on failure.
|
|
18
|
+
*/
|
|
19
|
+
export declare function fuseWithEvolution(a: ValidSolid, b: ValidSolid, options?: BooleanOptions): Result<EvolutionResult<ValidSolid>>;
|
|
20
|
+
export declare function fuseWithEvolution(a: Shape3D, b: Shape3D, options?: BooleanOptions): Result<EvolutionResult<Shape3D>>;
|
|
21
|
+
/**
|
|
22
|
+
* Cut a tool shape from a base shape (boolean subtraction), returning both
|
|
23
|
+
* the result shape and the face evolution data.
|
|
24
|
+
*
|
|
25
|
+
* @param base - The shape to cut from.
|
|
26
|
+
* @param tool - The shape to subtract.
|
|
27
|
+
* @param options - Boolean operation options.
|
|
28
|
+
* @returns Ok with the cut shape and evolution, or Err on failure.
|
|
29
|
+
*/
|
|
30
|
+
export declare function cutWithEvolution(base: ValidSolid, tool: ValidSolid, options?: BooleanOptions): Result<EvolutionResult<ValidSolid>>;
|
|
31
|
+
export declare function cutWithEvolution(base: Shape3D, tool: Shape3D, options?: BooleanOptions): Result<EvolutionResult<Shape3D>>;
|
|
32
|
+
/**
|
|
33
|
+
* Compute the intersection of two shapes (boolean common), returning both
|
|
34
|
+
* the result shape and the face evolution data.
|
|
35
|
+
*
|
|
36
|
+
* @param a - The first operand.
|
|
37
|
+
* @param b - The second operand.
|
|
38
|
+
* @param options - Boolean operation options.
|
|
39
|
+
* @returns Ok with the intersection and evolution, or Err on failure.
|
|
40
|
+
*/
|
|
41
|
+
export declare function intersectWithEvolution(a: ValidSolid, b: ValidSolid, options?: BooleanOptions): Result<EvolutionResult<ValidSolid>>;
|
|
42
|
+
export declare function intersectWithEvolution(a: Shape3D, b: Shape3D, options?: BooleanOptions): Result<EvolutionResult<Shape3D>>;
|
|
43
|
+
/**
|
|
44
|
+
* Apply a fillet (rounded edge) to selected edges, returning both
|
|
45
|
+
* the result shape and the face evolution data.
|
|
46
|
+
*
|
|
47
|
+
* @param shape - The shape to modify.
|
|
48
|
+
* @param edges - Edges to fillet. Pass `undefined` to fillet all edges.
|
|
49
|
+
* @param radius - Constant radius, variable radius `[r1, r2]`, or per-edge callback.
|
|
50
|
+
*/
|
|
51
|
+
export declare function filletWithEvolution(shape: ValidSolid, edges: ReadonlyArray<Edge> | undefined, radius: number | [number, number] | ((edge: Edge) => number | [number, number] | null)): Result<EvolutionResult<ValidSolid>>;
|
|
52
|
+
/**
|
|
53
|
+
* Apply a chamfer (beveled edge) to selected edges, returning both
|
|
54
|
+
* the result shape and the face evolution data.
|
|
55
|
+
*
|
|
56
|
+
* @param shape - The shape to modify.
|
|
57
|
+
* @param edges - Edges to chamfer. Pass `undefined` to chamfer all edges.
|
|
58
|
+
* @param distance - Symmetric distance, asymmetric `[d1, d2]`, or per-edge callback.
|
|
59
|
+
*/
|
|
60
|
+
export declare function chamferWithEvolution(shape: ValidSolid, edges: ReadonlyArray<Edge> | undefined, distance: number | [number, number] | ((edge: Edge) => number | [number, number] | null)): Result<EvolutionResult<ValidSolid>>;
|
|
61
|
+
/**
|
|
62
|
+
* Create a hollow shell by removing faces and offsetting remaining walls,
|
|
63
|
+
* returning both the result shape and the face evolution data.
|
|
64
|
+
*
|
|
65
|
+
* @param shape - The solid to hollow out.
|
|
66
|
+
* @param faces - Faces to remove.
|
|
67
|
+
* @param thickness - Wall thickness.
|
|
68
|
+
* @param tolerance - Shell operation tolerance (default 1e-3).
|
|
69
|
+
*/
|
|
70
|
+
export declare function shellWithEvolution(shape: ValidSolid, faces: ReadonlyArray<Face>, thickness: number, tolerance?: number): Result<EvolutionResult<Shape3D>>;
|
|
71
|
+
//# sourceMappingURL=evolutionFns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evolutionFns.d.ts","sourceRoot":"","sources":["../../src/topology/evolutionFns.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAChE,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