brepjs 13.1.0 → 13.4.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/curve2dGeometryFns.d.ts +107 -0
- package/dist/2d/curve2dGeometryFns.d.ts.map +1 -0
- package/dist/2d.cjs +229 -3
- package/dist/2d.d.ts +2 -0
- package/dist/2d.d.ts.map +1 -1
- package/dist/2d.js +206 -4
- package/dist/{arrayAccess-Bz2OkAF_.js → arrayAccess-B5LgmXBo.js} +4 -4
- package/dist/{arrayAccess-FwdVX3Nh.cjs → arrayAccess-t2dlxGSK.cjs} +4 -4
- package/dist/{blueprint-Bpa-w3WF.js → blueprint-CB_85Lz_.js} +10 -10
- package/dist/{blueprint-YPV8lQqg.cjs → blueprint-CDnBM-tA.cjs} +10 -10
- package/dist/{blueprintFns-iQsyPfTY.cjs → blueprintFns-D4YucGaQ.cjs} +142 -3
- package/dist/{blueprintFns-D0RopDZS.js → blueprintFns-DVDommWB.js} +125 -4
- package/dist/{boolean2D-D_yuF0kT.js → boolean2D-Mzp-0g7o.js} +12 -12
- package/dist/{boolean2D-CMXMxTgD.cjs → boolean2D-lqfKJKUY.cjs} +12 -12
- package/dist/{booleanFns-omB4YLGU.js → booleanFns-B46fgObh.js} +26 -14
- package/dist/{booleanFns-o7EsqNGM.cjs → booleanFns-Bw8sAMgI.cjs} +26 -14
- package/dist/brepjs.cjs +28 -145
- package/dist/brepjs.js +23 -143
- package/dist/core/curve2dHandle.d.ts +27 -0
- package/dist/core/curve2dHandle.d.ts.map +1 -0
- package/dist/core/errors.d.ts +7 -0
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core.cjs +5 -5
- package/dist/core.js +5 -5
- package/dist/{cornerFinder-E2w1gRI3.cjs → cornerFinder-BszIcLqj.cjs} +3 -3
- package/dist/{cornerFinder-nn_mma6p.js → cornerFinder-aBLykolI.js} +3 -3
- package/dist/{curveFns-DHFAK2lD.cjs → curveFns-CZszKLQB.cjs} +2 -2
- package/dist/{curveFns-CzcOFFDX.js → curveFns-DY4dFcP-.js} +2 -2
- package/dist/{drawFns-DLPEVSbK.cjs → drawFns-BHNDF8hb.cjs} +15 -15
- package/dist/{drawFns-4x9wOpZ3.js → drawFns-l5CY2s-l.js} +15 -15
- package/dist/{errors-D7ZQfeqv.js → errors-BVOlxlIA.js} +7 -0
- package/dist/{errors-BDTFTJ22.cjs → errors-BlC5ZWv4.cjs} +7 -0
- package/dist/{extrudeFns-CqKzY5BT.cjs → extrudeFns-GpCB_Uzs.cjs} +3 -3
- package/dist/{extrudeFns-CDWViQSe.js → extrudeFns-b0uLn4E4.js} +3 -3
- package/dist/{faceFns-DSUZvptN.cjs → faceFns-BywUjlJ7.cjs} +3 -3
- package/dist/{faceFns-6mY9O_5h.js → faceFns-Cat-4X74.js} +3 -3
- package/dist/{helpers-BWZ7h12W.cjs → helpers-1iCCEElA.cjs} +7 -7
- package/dist/{helpers-C9PtrI6D.js → helpers-DgX1UucG.js} +7 -7
- package/dist/{historyFns-r1owwcvA.js → historyFns-BFwp8NLX.js} +6 -6
- package/dist/{historyFns-DIUNWvA3.cjs → historyFns-DqxDtXIZ.cjs} +6 -6
- package/dist/{importFns-xg7LSAv6.js → importFns-Cb8fcldB.js} +4 -4
- package/dist/{importFns-CeDf0HmX.cjs → importFns-ChXEJAvu.cjs} +4 -4
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- 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 +7 -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/curveOps.d.ts +3 -1
- package/dist/kernel/interfaces/curveOps.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/interfaces/surfaceOps.d.ts +3 -1
- package/dist/kernel/interfaces/surfaceOps.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 +7 -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/nurbsQueryOps.d.ts +12 -0
- package/dist/kernel/occt/nurbsQueryOps.d.ts.map +1 -0
- 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 +56 -0
- package/dist/kernel/types.d.ts.map +1 -1
- package/dist/{measureFns-Dp2Znpf_.cjs → measureFns-Bx-kl7_g.cjs} +3 -3
- package/dist/{measureFns-B7pm7ulJ.js → measureFns-D3rAp1X1.js} +3 -3
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-1ARDwoZ4.js → meshFns-BPi0bhm9.js} +3 -3
- package/dist/{meshFns-DHS9gepE.cjs → meshFns-D3KAZ_ma.cjs} +3 -3
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{planeOps-DA5DmML2.cjs → planeOps-BqLav0Ir.cjs} +3 -3
- package/dist/{planeOps-D4THn1al.js → planeOps-D88tfyJs.js} +3 -3
- package/dist/{primitiveFns-DtAy6t6n.cjs → primitiveFns-BGh9A9jR.cjs} +67 -7
- package/dist/{primitiveFns-CfCgkRwY.js → primitiveFns-CnZkW6Bi.js} +50 -8
- 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-Du2qyM2n.cjs → shapeTypes-8eK48l-X.cjs} +258 -9
- package/dist/{shapeTypes-Beo7ikOL.js → shapeTypes-Di6GlhPk.js} +258 -9
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.js +2 -2
- package/dist/{solidBuilders-BePRwqfJ.cjs → solidBuilders-D9KYP9sL.cjs} +3 -3
- package/dist/{solidBuilders-8CBjeBfT.js → solidBuilders-ctO_wFrm.js} +3 -3
- package/dist/{surfaceBuilders-BC0MvMK1.js → surfaceBuilders-BaqeZa0x.js} +3 -3
- package/dist/{surfaceBuilders-BCiMuuGV.cjs → surfaceBuilders-CZzipftq.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/nurbsFns.d.ts +13 -0
- package/dist/topology/nurbsFns.d.ts.map +1 -0
- package/dist/topology.cjs +9 -6
- package/dist/topology.d.ts +2 -0
- package/dist/topology.d.ts.map +1 -1
- package/dist/topology.js +7 -7
- package/dist/vectors.cjs +3 -3
- package/dist/vectors.js +3 -3
- package/package.json +1 -1
- /package/dist/{types-Bb4KK_iG.js → types-BWBlwp6w.js} +0 -0
- /package/dist/{types-BD-VVaWB.cjs → types-BjDcsS7l.cjs} +0 -0
- /package/dist/{vecOps-B9-MTeC8.js → vecOps-DFfUfsmc.js} +0 -0
- /package/dist/{vecOps-4iBMiet9.cjs → vecOps-DKGelwGL.cjs} +0 -0
package/dist/operations.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { C as walkAssembly, D as exportAssemblySTEP, E as linearPattern, O as createAssembly, S as updateNode, T as gridPattern, _ as collectShapes, a as findStep, b as findNode, c as registerOperation, d as replayHistory, g as addChild, h as undoLast, l as registerShape, m as stepsFrom, n as createHistory, o as getShape, p as stepCount, r as createRegistry, s as modifyStep, t as addStep, u as replayFrom, v as countNodes, w as circularPattern, x as removeChild, y as createAssemblyNode } from "./historyFns-
|
|
2
|
-
import { c as twistExtrude, o as supportExtrude, r as complexExtrude, s as sweep } from "./extrudeFns-
|
|
1
|
+
import { C as walkAssembly, D as exportAssemblySTEP, E as linearPattern, O as createAssembly, S as updateNode, T as gridPattern, _ as collectShapes, a as findStep, b as findNode, c as registerOperation, d as replayHistory, g as addChild, h as undoLast, l as registerShape, m as stepsFrom, n as createHistory, o as getShape, p as stepCount, r as createRegistry, s as modifyStep, t as addStep, u as replayFrom, v as countNodes, w as circularPattern, x as removeChild, y as createAssemblyNode } from "./historyFns-BFwp8NLX.js";
|
|
2
|
+
import { c as twistExtrude, o as supportExtrude, r as complexExtrude, s as sweep } from "./extrudeFns-b0uLn4E4.js";
|
|
3
3
|
export { addChild, addStep, circularPattern, collectShapes, complexExtrude, countNodes, createAssembly, createAssemblyNode, createHistory, createRegistry, exportAssemblySTEP, findNode, findStep, getShape as getHistoryShape, gridPattern, linearPattern, modifyStep, registerOperation, registerShape, removeChild, replayFrom, replayHistory, stepCount, stepsFrom, supportExtrude, sweep, twistExtrude, undoLast, updateNode, walkAssembly };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_errors = require("./errors-
|
|
2
|
-
const require_vecOps = require("./vecOps-
|
|
3
|
-
const require_types = require("./types-
|
|
1
|
+
const require_errors = require("./errors-BlC5ZWv4.cjs");
|
|
2
|
+
const require_vecOps = require("./vecOps-DKGelwGL.cjs");
|
|
3
|
+
const require_types = require("./types-BjDcsS7l.cjs");
|
|
4
4
|
//#region src/core/planeOps.ts
|
|
5
5
|
/**
|
|
6
6
|
* Create a {@link Plane} from an origin, optional X direction, and a normal.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { L as unwrap, d as validationError, k as ok, y as err } from "./errors-
|
|
2
|
-
import { _ as DEG2RAD, d as vecNormalize, h as vecScale, m as vecRotate, r as vecCross, s as vecIsZero, t as vecAdd } from "./vecOps-
|
|
3
|
-
import { r as toVec3 } from "./types-
|
|
1
|
+
import { L as unwrap, d as validationError, k as ok, y as err } from "./errors-BVOlxlIA.js";
|
|
2
|
+
import { _ as DEG2RAD, d as vecNormalize, h as vecScale, m as vecRotate, r as vecCross, s as vecIsZero, t as vecAdd } from "./vecOps-DFfUfsmc.js";
|
|
3
|
+
import { r as toVec3 } from "./types-BWBlwp6w.js";
|
|
4
4
|
//#region src/core/planeOps.ts
|
|
5
5
|
/**
|
|
6
6
|
* Create a {@link Plane} from an origin, optional X direction, and a normal.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
3
|
-
const require_vecOps = require("./vecOps-
|
|
4
|
-
const require_faceFns = require("./faceFns-
|
|
5
|
-
const require_arrayAccess = require("./arrayAccess-
|
|
6
|
-
const require_surfaceBuilders = require("./surfaceBuilders-
|
|
7
|
-
const require_solidBuilders = require("./solidBuilders-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-8eK48l-X.cjs");
|
|
2
|
+
const require_errors = require("./errors-BlC5ZWv4.cjs");
|
|
3
|
+
const require_vecOps = require("./vecOps-DKGelwGL.cjs");
|
|
4
|
+
const require_faceFns = require("./faceFns-BywUjlJ7.cjs");
|
|
5
|
+
const require_arrayAccess = require("./arrayAccess-t2dlxGSK.cjs");
|
|
6
|
+
const require_surfaceBuilders = require("./surfaceBuilders-CZzipftq.cjs");
|
|
7
|
+
const require_solidBuilders = require("./solidBuilders-D9KYP9sL.cjs");
|
|
8
8
|
//#region src/topology/threeHelpers.ts
|
|
9
9
|
/**
|
|
10
10
|
* Convert a ShapeMesh into BufferGeometry-compatible typed arrays.
|
|
@@ -294,6 +294,48 @@ function sharedEdges(face1, face2) {
|
|
|
294
294
|
return wrapAll(shared, "edge");
|
|
295
295
|
}
|
|
296
296
|
//#endregion
|
|
297
|
+
//#region src/topology/nurbsFns.ts
|
|
298
|
+
/**
|
|
299
|
+
* Extract NURBS data from a BSpline or Bezier edge.
|
|
300
|
+
* Returns null if the edge is not a NURBS curve (e.g., line, circle).
|
|
301
|
+
*/
|
|
302
|
+
function getNurbsCurveData(edge) {
|
|
303
|
+
const kernel = require_shapeTypes.getKernel();
|
|
304
|
+
if (!kernel.getNurbsCurveData) return null;
|
|
305
|
+
return kernel.getNurbsCurveData(edge.wrapped);
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Extract NURBS data from a BSpline face.
|
|
309
|
+
* Returns null if the face is not a BSpline surface (e.g., plane, cylinder).
|
|
310
|
+
*/
|
|
311
|
+
function getNurbsSurfaceData(face) {
|
|
312
|
+
const kernel = require_shapeTypes.getKernel();
|
|
313
|
+
if (!kernel.getNurbsSurfaceData) return null;
|
|
314
|
+
return kernel.getNurbsSurfaceData(face.wrapped);
|
|
315
|
+
}
|
|
316
|
+
//#endregion
|
|
317
|
+
//#region src/topology/booleanDiagnosticFns.ts
|
|
318
|
+
/**
|
|
319
|
+
* Boolean pre-validation diagnostics.
|
|
320
|
+
*/
|
|
321
|
+
/**
|
|
322
|
+
* Pre-validate operands before a boolean operation.
|
|
323
|
+
*
|
|
324
|
+
* Checks that both shapes are non-null and topologically valid.
|
|
325
|
+
* Returns a structured report of any issues found.
|
|
326
|
+
*
|
|
327
|
+
* @example
|
|
328
|
+
* ```typescript
|
|
329
|
+
* const check = checkBoolean(base, tool, 'fuse');
|
|
330
|
+
* if (!check.valid) {
|
|
331
|
+
* console.warn('Boolean will likely fail:', check.issues);
|
|
332
|
+
* }
|
|
333
|
+
* ```
|
|
334
|
+
*/
|
|
335
|
+
function checkBoolean(base, tool, op) {
|
|
336
|
+
return require_shapeTypes.getKernel().checkBoolean(base.wrapped, tool.wrapped, op);
|
|
337
|
+
}
|
|
338
|
+
//#endregion
|
|
297
339
|
//#region src/topology/evolutionFns.ts
|
|
298
340
|
/**
|
|
299
341
|
* Evolution-tracking variants of boolean and modifier operations.
|
|
@@ -1481,6 +1523,12 @@ Object.defineProperty(exports, "chamferWithEvolution", {
|
|
|
1481
1523
|
return chamferWithEvolution;
|
|
1482
1524
|
}
|
|
1483
1525
|
});
|
|
1526
|
+
Object.defineProperty(exports, "checkBoolean", {
|
|
1527
|
+
enumerable: true,
|
|
1528
|
+
get: function() {
|
|
1529
|
+
return checkBoolean;
|
|
1530
|
+
}
|
|
1531
|
+
});
|
|
1484
1532
|
Object.defineProperty(exports, "circle", {
|
|
1485
1533
|
enumerable: true,
|
|
1486
1534
|
get: function() {
|
|
@@ -1589,6 +1637,18 @@ Object.defineProperty(exports, "fuseWithEvolution", {
|
|
|
1589
1637
|
return fuseWithEvolution;
|
|
1590
1638
|
}
|
|
1591
1639
|
});
|
|
1640
|
+
Object.defineProperty(exports, "getNurbsCurveData", {
|
|
1641
|
+
enumerable: true,
|
|
1642
|
+
get: function() {
|
|
1643
|
+
return getNurbsCurveData;
|
|
1644
|
+
}
|
|
1645
|
+
});
|
|
1646
|
+
Object.defineProperty(exports, "getNurbsSurfaceData", {
|
|
1647
|
+
enumerable: true,
|
|
1648
|
+
get: function() {
|
|
1649
|
+
return getNurbsSurfaceData;
|
|
1650
|
+
}
|
|
1651
|
+
});
|
|
1592
1652
|
Object.defineProperty(exports, "heal", {
|
|
1593
1653
|
enumerable: true,
|
|
1594
1654
|
get: function() {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Y as getKernel, _ as isSolid, c as createSolid, h as isShape3D, p as isFace, r as castShapeWithKnownType, t as castShape, x as isClosedWire, y as isWire } from "./shapeTypes-
|
|
2
|
-
import { C as isErr, _ as andThen, d as validationError, i as kernelError, k as ok, l as typeCastError, t as BrepErrorCode, w as isOk, y as err } from "./errors-
|
|
3
|
-
import { _ as DEG2RAD, v as HASH_CODE_MAX } from "./vecOps-
|
|
4
|
-
import { _ as downcast } from "./faceFns-
|
|
5
|
-
import { F as getEdges, I as getFaces, L as getOrCreateCache, b as propagateAllMetadata, v as translate, y as collectInputFaceHashes, z as getWires } from "./arrayAccess-
|
|
6
|
-
import { a as makeNonPlanarFace, c as makeBSplineApproximation, d as makeEllipse, f as makeEllipseArc, g as makeThreePointArc, h as makeTangentArc, i as makeNewFaceWithinFace, l as makeBezierCurve, m as makeLine, o as makePolygon, p as makeHelix, r as makeFace, s as assembleWire, t as addHolesInFace, u as makeCircle } from "./surfaceBuilders-
|
|
7
|
-
import { a as makeOffset, c as makeTorus, i as makeEllipsoid, l as makeVertex, n as makeCone, o as makeSolid, r as makeCylinder, s as makeSphere, t as makeCompound, u as weldShellsAndFaces } from "./solidBuilders-
|
|
1
|
+
import { Y as getKernel, _ as isSolid, c as createSolid, h as isShape3D, p as isFace, r as castShapeWithKnownType, t as castShape, x as isClosedWire, y as isWire } from "./shapeTypes-Di6GlhPk.js";
|
|
2
|
+
import { C as isErr, _ as andThen, d as validationError, i as kernelError, k as ok, l as typeCastError, t as BrepErrorCode, w as isOk, y as err } from "./errors-BVOlxlIA.js";
|
|
3
|
+
import { _ as DEG2RAD, v as HASH_CODE_MAX } from "./vecOps-DFfUfsmc.js";
|
|
4
|
+
import { _ as downcast } from "./faceFns-Cat-4X74.js";
|
|
5
|
+
import { F as getEdges, I as getFaces, L as getOrCreateCache, b as propagateAllMetadata, v as translate, y as collectInputFaceHashes, z as getWires } from "./arrayAccess-B5LgmXBo.js";
|
|
6
|
+
import { a as makeNonPlanarFace, c as makeBSplineApproximation, d as makeEllipse, f as makeEllipseArc, g as makeThreePointArc, h as makeTangentArc, i as makeNewFaceWithinFace, l as makeBezierCurve, m as makeLine, o as makePolygon, p as makeHelix, r as makeFace, s as assembleWire, t as addHolesInFace, u as makeCircle } from "./surfaceBuilders-BaqeZa0x.js";
|
|
7
|
+
import { a as makeOffset, c as makeTorus, i as makeEllipsoid, l as makeVertex, n as makeCone, o as makeSolid, r as makeCylinder, s as makeSphere, t as makeCompound, u as weldShellsAndFaces } from "./solidBuilders-ctO_wFrm.js";
|
|
8
8
|
//#region src/topology/threeHelpers.ts
|
|
9
9
|
/**
|
|
10
10
|
* Convert a ShapeMesh into BufferGeometry-compatible typed arrays.
|
|
@@ -294,6 +294,48 @@ function sharedEdges(face1, face2) {
|
|
|
294
294
|
return wrapAll(shared, "edge");
|
|
295
295
|
}
|
|
296
296
|
//#endregion
|
|
297
|
+
//#region src/topology/nurbsFns.ts
|
|
298
|
+
/**
|
|
299
|
+
* Extract NURBS data from a BSpline or Bezier edge.
|
|
300
|
+
* Returns null if the edge is not a NURBS curve (e.g., line, circle).
|
|
301
|
+
*/
|
|
302
|
+
function getNurbsCurveData(edge) {
|
|
303
|
+
const kernel = getKernel();
|
|
304
|
+
if (!kernel.getNurbsCurveData) return null;
|
|
305
|
+
return kernel.getNurbsCurveData(edge.wrapped);
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Extract NURBS data from a BSpline face.
|
|
309
|
+
* Returns null if the face is not a BSpline surface (e.g., plane, cylinder).
|
|
310
|
+
*/
|
|
311
|
+
function getNurbsSurfaceData(face) {
|
|
312
|
+
const kernel = getKernel();
|
|
313
|
+
if (!kernel.getNurbsSurfaceData) return null;
|
|
314
|
+
return kernel.getNurbsSurfaceData(face.wrapped);
|
|
315
|
+
}
|
|
316
|
+
//#endregion
|
|
317
|
+
//#region src/topology/booleanDiagnosticFns.ts
|
|
318
|
+
/**
|
|
319
|
+
* Boolean pre-validation diagnostics.
|
|
320
|
+
*/
|
|
321
|
+
/**
|
|
322
|
+
* Pre-validate operands before a boolean operation.
|
|
323
|
+
*
|
|
324
|
+
* Checks that both shapes are non-null and topologically valid.
|
|
325
|
+
* Returns a structured report of any issues found.
|
|
326
|
+
*
|
|
327
|
+
* @example
|
|
328
|
+
* ```typescript
|
|
329
|
+
* const check = checkBoolean(base, tool, 'fuse');
|
|
330
|
+
* if (!check.valid) {
|
|
331
|
+
* console.warn('Boolean will likely fail:', check.issues);
|
|
332
|
+
* }
|
|
333
|
+
* ```
|
|
334
|
+
*/
|
|
335
|
+
function checkBoolean(base, tool, op) {
|
|
336
|
+
return getKernel().checkBoolean(base.wrapped, tool.wrapped, op);
|
|
337
|
+
}
|
|
338
|
+
//#endregion
|
|
297
339
|
//#region src/topology/evolutionFns.ts
|
|
298
340
|
/**
|
|
299
341
|
* Evolution-tracking variants of boolean and modifier operations.
|
|
@@ -1427,4 +1469,4 @@ function addHoles(f, holes) {
|
|
|
1427
1469
|
return addHolesInFace(f, holes);
|
|
1428
1470
|
}
|
|
1429
1471
|
//#endregion
|
|
1430
|
-
export {
|
|
1472
|
+
export { getNurbsSurfaceData as $, fixShape as A, offset as B, threePointArc as C, wireLoop as D, wire as E, isValid as F, chamferWithEvolution as G, thicken as H, solidFromShell as I, fuseWithEvolution as J, cutWithEvolution as K, chamfer as L, healFace as M, healSolid as N, autoHeal as O, healWire as P, getNurbsCurveData as Q, draft as R, tangentArc as S, vertex as T, variableFillet as U, shell as V, positionOnCurve as W, shellWithEvolution as X, intersectWithEvolution as Y, checkBoolean as Z, polygon as _, circle as a, wiresOfFace as at, sphere as b, cylinder as c, toGroupedBufferGeometryData as ct, ellipsoid as d, adjacentFaces as et, face as f, offsetFace as g, line as h, bsplineApprox as i, verticesOfEdge as it, heal as j, fixSelfIntersection as k, ellipse as l, toLineGeometryData as lt, helix as m, bezier as n, facesOfEdge as nt, compound as o, chamferDistAngle as ot, filledFace as p, filletWithEvolution as q, box as r, sharedEdges as rt, cone as s, toBufferGeometryData as st, addHoles as t, edgesOfFace as tt, ellipseArc as u, sewShells as v, torus as w, subFace as x, solid as y, fillet as z };
|
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-1iCCEElA.cjs");
|
|
3
|
+
const require_cornerFinder = require("./cornerFinder-BszIcLqj.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-DgX1UucG.js";
|
|
2
|
+
import { t as cornerFinder } from "./cornerFinder-aBLykolI.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-BlC5ZWv4.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-BVOlxlIA.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-BlC5ZWv4.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. */
|
|
@@ -2183,6 +2219,138 @@ function reverseSurfaceU(_oc, surface) {
|
|
|
2183
2219
|
return surface.get().UReversed();
|
|
2184
2220
|
}
|
|
2185
2221
|
//#endregion
|
|
2222
|
+
//#region src/kernel/occt/nurbsQueryOps.ts
|
|
2223
|
+
/**
|
|
2224
|
+
* Extract NURBS curve data from a BSpline or Bezier edge.
|
|
2225
|
+
* Returns null for non-BSpline curve types (line, circle, etc.).
|
|
2226
|
+
*/
|
|
2227
|
+
function getNurbsCurveData(oc, edge) {
|
|
2228
|
+
const adaptor = new oc.BRepAdaptor_Curve_2(edge);
|
|
2229
|
+
try {
|
|
2230
|
+
const curveTypeVal = adaptor.GetType();
|
|
2231
|
+
const curveIdx = typeof curveTypeVal === "number" ? curveTypeVal : Number(curveTypeVal?.value ?? curveTypeVal);
|
|
2232
|
+
const ct = oc.GeomAbs_CurveType;
|
|
2233
|
+
const bsplineCurveIdx = typeof ct.GeomAbs_BSplineCurve === "number" ? ct.GeomAbs_BSplineCurve : Number(ct.GeomAbs_BSplineCurve?.value ?? ct.GeomAbs_BSplineCurve);
|
|
2234
|
+
const bezierCurveIdx = typeof ct.GeomAbs_BezierCurve === "number" ? ct.GeomAbs_BezierCurve : Number(ct.GeomAbs_BezierCurve?.value ?? ct.GeomAbs_BezierCurve);
|
|
2235
|
+
if (curveIdx !== bsplineCurveIdx && curveIdx !== bezierCurveIdx) return null;
|
|
2236
|
+
const bsplineHandle = adaptor.BSpline();
|
|
2237
|
+
const bspline = bsplineHandle.get();
|
|
2238
|
+
const degree = bspline.Degree();
|
|
2239
|
+
const nbPoles = bspline.NbPoles();
|
|
2240
|
+
const nbKnots = bspline.NbKnots();
|
|
2241
|
+
const isPeriodic = bspline.IsPeriodic();
|
|
2242
|
+
const isRational = bspline.IsRational();
|
|
2243
|
+
const poles = [];
|
|
2244
|
+
for (let i = 1; i <= nbPoles; i++) {
|
|
2245
|
+
const pnt = bspline.Pole(i);
|
|
2246
|
+
poles.push([
|
|
2247
|
+
pnt.X(),
|
|
2248
|
+
pnt.Y(),
|
|
2249
|
+
pnt.Z()
|
|
2250
|
+
]);
|
|
2251
|
+
pnt.delete();
|
|
2252
|
+
}
|
|
2253
|
+
const weights = [];
|
|
2254
|
+
for (let i = 1; i <= nbPoles; i++) weights.push(bspline.Weight(i));
|
|
2255
|
+
const knots = [];
|
|
2256
|
+
const multiplicities = [];
|
|
2257
|
+
for (let i = 1; i <= nbKnots; i++) {
|
|
2258
|
+
knots.push(bspline.Knot(i));
|
|
2259
|
+
multiplicities.push(bspline.Multiplicity(i));
|
|
2260
|
+
}
|
|
2261
|
+
const result = {
|
|
2262
|
+
degree,
|
|
2263
|
+
poles,
|
|
2264
|
+
weights,
|
|
2265
|
+
knots,
|
|
2266
|
+
multiplicities,
|
|
2267
|
+
isPeriodic,
|
|
2268
|
+
isRational
|
|
2269
|
+
};
|
|
2270
|
+
bsplineHandle.delete();
|
|
2271
|
+
return result;
|
|
2272
|
+
} catch {
|
|
2273
|
+
return null;
|
|
2274
|
+
} finally {
|
|
2275
|
+
adaptor.delete();
|
|
2276
|
+
}
|
|
2277
|
+
}
|
|
2278
|
+
/**
|
|
2279
|
+
* Extract NURBS surface data from a BSpline face.
|
|
2280
|
+
* Returns null for non-BSpline surface types (plane, cylinder, Bezier, etc.).
|
|
2281
|
+
*/
|
|
2282
|
+
function getNurbsSurfaceData(oc, face) {
|
|
2283
|
+
const adaptor = new oc.BRepAdaptor_Surface_2(face, false);
|
|
2284
|
+
try {
|
|
2285
|
+
const surfTypeVal = adaptor.GetType();
|
|
2286
|
+
const surfIdx = typeof surfTypeVal === "number" ? surfTypeVal : Number(surfTypeVal?.value ?? surfTypeVal);
|
|
2287
|
+
const st = oc.GeomAbs_SurfaceType;
|
|
2288
|
+
if (surfIdx !== (typeof st.GeomAbs_BSplineSurface === "number" ? st.GeomAbs_BSplineSurface : Number(st.GeomAbs_BSplineSurface?.value ?? st.GeomAbs_BSplineSurface))) return null;
|
|
2289
|
+
const bsplineHandle = adaptor.BSpline();
|
|
2290
|
+
const bspline = bsplineHandle.get();
|
|
2291
|
+
const degreeU = bspline.UDegree();
|
|
2292
|
+
const degreeV = bspline.VDegree();
|
|
2293
|
+
const nbPolesU = bspline.NbUPoles();
|
|
2294
|
+
const nbPolesV = bspline.NbVPoles();
|
|
2295
|
+
const isPeriodicU = bspline.IsUPeriodic();
|
|
2296
|
+
const isPeriodicV = bspline.IsVPeriodic();
|
|
2297
|
+
const isRational = bspline.IsURational() || bspline.IsVRational();
|
|
2298
|
+
const poles = [];
|
|
2299
|
+
const weights = [];
|
|
2300
|
+
for (let u = 1; u <= nbPolesU; u++) {
|
|
2301
|
+
const poleRow = [];
|
|
2302
|
+
const weightRow = [];
|
|
2303
|
+
for (let v = 1; v <= nbPolesV; v++) {
|
|
2304
|
+
const pnt = bspline.Pole(u, v);
|
|
2305
|
+
poleRow.push([
|
|
2306
|
+
pnt.X(),
|
|
2307
|
+
pnt.Y(),
|
|
2308
|
+
pnt.Z()
|
|
2309
|
+
]);
|
|
2310
|
+
pnt.delete();
|
|
2311
|
+
weightRow.push(bspline.Weight(u, v));
|
|
2312
|
+
}
|
|
2313
|
+
poles.push(poleRow);
|
|
2314
|
+
weights.push(weightRow);
|
|
2315
|
+
}
|
|
2316
|
+
const nbUKnots = bspline.NbUKnots();
|
|
2317
|
+
const knotsU = [];
|
|
2318
|
+
const multiplicitiesU = [];
|
|
2319
|
+
for (let i = 1; i <= nbUKnots; i++) {
|
|
2320
|
+
knotsU.push(bspline.UKnot(i));
|
|
2321
|
+
multiplicitiesU.push(bspline.UMultiplicity(i));
|
|
2322
|
+
}
|
|
2323
|
+
const nbVKnots = bspline.NbVKnots();
|
|
2324
|
+
const knotsV = [];
|
|
2325
|
+
const multiplicitiesV = [];
|
|
2326
|
+
for (let i = 1; i <= nbVKnots; i++) {
|
|
2327
|
+
knotsV.push(bspline.VKnot(i));
|
|
2328
|
+
multiplicitiesV.push(bspline.VMultiplicity(i));
|
|
2329
|
+
}
|
|
2330
|
+
const result = {
|
|
2331
|
+
degreeU,
|
|
2332
|
+
degreeV,
|
|
2333
|
+
nbPolesU,
|
|
2334
|
+
nbPolesV,
|
|
2335
|
+
poles,
|
|
2336
|
+
weights,
|
|
2337
|
+
knotsU,
|
|
2338
|
+
knotsV,
|
|
2339
|
+
multiplicitiesU,
|
|
2340
|
+
multiplicitiesV,
|
|
2341
|
+
isPeriodicU,
|
|
2342
|
+
isPeriodicV,
|
|
2343
|
+
isRational
|
|
2344
|
+
};
|
|
2345
|
+
bsplineHandle.delete();
|
|
2346
|
+
return result;
|
|
2347
|
+
} catch {
|
|
2348
|
+
return null;
|
|
2349
|
+
} finally {
|
|
2350
|
+
adaptor.delete();
|
|
2351
|
+
}
|
|
2352
|
+
}
|
|
2353
|
+
//#endregion
|
|
2186
2354
|
//#region src/kernel/occt/exportOps.ts
|
|
2187
2355
|
/** Wrap a JS string as an OCCT TCollection_ExtendedString. */
|
|
2188
2356
|
function wrapString(oc, str) {
|
|
@@ -3436,11 +3604,16 @@ function transformWithEvolution(oc, shape, trsf, inputFaceHashes, hashUpperBound
|
|
|
3436
3604
|
/**
|
|
3437
3605
|
* Wrap a boolean operation with shape evolution tracking.
|
|
3438
3606
|
*/
|
|
3439
|
-
function booleanWithEvolution(oc, boolOp, inputShapes, inputFaceHashes, hashUpperBound, simplify) {
|
|
3607
|
+
function booleanWithEvolution(oc, boolOp, inputShapes, inputFaceHashes, hashUpperBound, simplify, diagnostics) {
|
|
3440
3608
|
if (simplify) boolOp.SimplifyResult(true, true, .001);
|
|
3441
3609
|
return {
|
|
3442
3610
|
shape: boolOp.Shape(),
|
|
3443
|
-
evolution: buildEvolution(oc, boolOp, inputShapes, inputFaceHashes, hashUpperBound)
|
|
3611
|
+
evolution: buildEvolution(oc, boolOp, inputShapes, inputFaceHashes, hashUpperBound),
|
|
3612
|
+
diagnostics: diagnostics ?? {
|
|
3613
|
+
hasErrors: false,
|
|
3614
|
+
hasWarnings: false,
|
|
3615
|
+
messages: []
|
|
3616
|
+
}
|
|
3444
3617
|
};
|
|
3445
3618
|
}
|
|
3446
3619
|
/**
|
|
@@ -4246,13 +4419,21 @@ function generalTransformWithHistory(oc, shape, linear, translation, _isOrthogon
|
|
|
4246
4419
|
trsf.delete();
|
|
4247
4420
|
return result;
|
|
4248
4421
|
}
|
|
4422
|
+
function extractDiagnostics(op) {
|
|
4423
|
+
return {
|
|
4424
|
+
hasErrors: op.HasErrors(),
|
|
4425
|
+
hasWarnings: op.HasWarnings(),
|
|
4426
|
+
messages: []
|
|
4427
|
+
};
|
|
4428
|
+
}
|
|
4249
4429
|
function fuseWithHistory(oc, shape, tool, inputFaceHashes, hashUpperBound, options = {}) {
|
|
4250
4430
|
const progress = new oc.Message_ProgressRange_1();
|
|
4251
4431
|
const fuseOp = new oc.BRepAlgoAPI_Fuse_3(shape, tool, progress);
|
|
4252
4432
|
applyGlue(oc, fuseOp, options.optimisation);
|
|
4253
4433
|
applyBooleanDefaults(fuseOp, options.fuzzyValue);
|
|
4254
4434
|
fuseOp.Build(progress);
|
|
4255
|
-
const
|
|
4435
|
+
const diagnostics = extractDiagnostics(fuseOp);
|
|
4436
|
+
const result = booleanWithEvolution(oc, fuseOp, [shape, tool], inputFaceHashes, hashUpperBound, options.simplify ?? false, diagnostics);
|
|
4256
4437
|
fuseOp.delete();
|
|
4257
4438
|
progress.delete();
|
|
4258
4439
|
return result;
|
|
@@ -4263,7 +4444,8 @@ function cutWithHistory(oc, shape, tool, inputFaceHashes, hashUpperBound, option
|
|
|
4263
4444
|
applyGlue(oc, cutOp, options.optimisation);
|
|
4264
4445
|
applyBooleanDefaults(cutOp, options.fuzzyValue);
|
|
4265
4446
|
cutOp.Build(progress);
|
|
4266
|
-
const
|
|
4447
|
+
const diagnostics = extractDiagnostics(cutOp);
|
|
4448
|
+
const result = booleanWithEvolution(oc, cutOp, [shape, tool], inputFaceHashes, hashUpperBound, options.simplify ?? false, diagnostics);
|
|
4267
4449
|
cutOp.delete();
|
|
4268
4450
|
progress.delete();
|
|
4269
4451
|
return result;
|
|
@@ -4274,7 +4456,8 @@ function intersectWithHistory(oc, shape, tool, inputFaceHashes, hashUpperBound,
|
|
|
4274
4456
|
applyGlue(oc, intOp, options.optimisation);
|
|
4275
4457
|
applyBooleanDefaults(intOp, options.fuzzyValue);
|
|
4276
4458
|
intOp.Build(progress);
|
|
4277
|
-
const
|
|
4459
|
+
const diagnostics = extractDiagnostics(intOp);
|
|
4460
|
+
const result = booleanWithEvolution(oc, intOp, [shape, tool], inputFaceHashes, hashUpperBound, options.simplify ?? false, diagnostics);
|
|
4278
4461
|
intOp.delete();
|
|
4279
4462
|
progress.delete();
|
|
4280
4463
|
return result;
|
|
@@ -4408,6 +4591,9 @@ var DefaultAdapter = class {
|
|
|
4408
4591
|
cutAll(shape, tools, options = {}) {
|
|
4409
4592
|
return cutAll$1(this.oc, shape, tools, options);
|
|
4410
4593
|
}
|
|
4594
|
+
checkBoolean(shape, tool, op) {
|
|
4595
|
+
return checkBoolean$1(this.oc, shape, tool, op, (s) => this.isValid(s));
|
|
4596
|
+
}
|
|
4411
4597
|
hull(shapes, tolerance) {
|
|
4412
4598
|
return hull$1(this.oc, shapes, tolerance);
|
|
4413
4599
|
}
|
|
@@ -4727,6 +4913,12 @@ var DefaultAdapter = class {
|
|
|
4727
4913
|
reverseSurfaceU(surface) {
|
|
4728
4914
|
return reverseSurfaceU(this.oc, surface);
|
|
4729
4915
|
}
|
|
4916
|
+
getNurbsCurveData(edge) {
|
|
4917
|
+
return getNurbsCurveData(this.oc, edge);
|
|
4918
|
+
}
|
|
4919
|
+
getNurbsSurfaceData(face) {
|
|
4920
|
+
return getNurbsSurfaceData(this.oc, face);
|
|
4921
|
+
}
|
|
4730
4922
|
simplify(shape) {
|
|
4731
4923
|
return simplify(this.oc, shape);
|
|
4732
4924
|
}
|
|
@@ -6258,6 +6450,42 @@ function meshBoolean(bk, positionsA, indicesA, positionsB, indicesB, op, toleran
|
|
|
6258
6450
|
}]
|
|
6259
6451
|
};
|
|
6260
6452
|
}
|
|
6453
|
+
/**
|
|
6454
|
+
* Pre-validate operands before a boolean operation.
|
|
6455
|
+
*
|
|
6456
|
+
* Checks that both shapes are non-null and topologically valid.
|
|
6457
|
+
*/
|
|
6458
|
+
function checkBoolean(_bk, shape, tool, _op, isValid) {
|
|
6459
|
+
const issues = [];
|
|
6460
|
+
if (!isBrepkitHandle$1(shape) || shape.IsNull()) issues.push({
|
|
6461
|
+
operand: "base",
|
|
6462
|
+
issue: "null-shape",
|
|
6463
|
+
message: "Base shape is null"
|
|
6464
|
+
});
|
|
6465
|
+
if (!isBrepkitHandle$1(tool) || tool.IsNull()) issues.push({
|
|
6466
|
+
operand: "tool",
|
|
6467
|
+
issue: "null-shape",
|
|
6468
|
+
message: "Tool shape is null"
|
|
6469
|
+
});
|
|
6470
|
+
if (issues.length > 0) return {
|
|
6471
|
+
valid: false,
|
|
6472
|
+
issues
|
|
6473
|
+
};
|
|
6474
|
+
if (!isValid(shape)) issues.push({
|
|
6475
|
+
operand: "base",
|
|
6476
|
+
issue: "not-valid",
|
|
6477
|
+
message: "Base shape fails BRepCheck validation. Try autoHeal() first."
|
|
6478
|
+
});
|
|
6479
|
+
if (!isValid(tool)) issues.push({
|
|
6480
|
+
operand: "tool",
|
|
6481
|
+
issue: "not-valid",
|
|
6482
|
+
message: "Tool shape fails BRepCheck validation. Try autoHeal() first."
|
|
6483
|
+
});
|
|
6484
|
+
return {
|
|
6485
|
+
valid: issues.length === 0,
|
|
6486
|
+
issues
|
|
6487
|
+
};
|
|
6488
|
+
}
|
|
6261
6489
|
function hull(bk, shapes, _tolerance) {
|
|
6262
6490
|
const coords = [];
|
|
6263
6491
|
for (const shape of shapes) {
|
|
@@ -8237,6 +8465,9 @@ var BrepkitAdapter = class BrepkitAdapter {
|
|
|
8237
8465
|
split(shape, tools) {
|
|
8238
8466
|
return split(this.bk, shape, tools);
|
|
8239
8467
|
}
|
|
8468
|
+
checkBoolean(shape, tool, op) {
|
|
8469
|
+
return checkBoolean(this.bk, shape, tool, op, (s) => this.isValid(s));
|
|
8470
|
+
}
|
|
8240
8471
|
hull(shapes, _tolerance) {
|
|
8241
8472
|
return hull(this.bk, shapes, _tolerance);
|
|
8242
8473
|
}
|
|
@@ -8649,12 +8880,20 @@ var BrepkitAdapter = class BrepkitAdapter {
|
|
|
8649
8880
|
return this.buildEvolution(this.generalTransform(shape, linear, translation, isOrthogonal), inputFaceHashes, hashUpperBound, true);
|
|
8650
8881
|
}
|
|
8651
8882
|
booleanWithHistoryImpl(shape, tool, inputFaceHashes, hashUpperBound, options, nativeFn, fallbackFn, _label) {
|
|
8883
|
+
const noDiagnostics = {
|
|
8884
|
+
hasErrors: false,
|
|
8885
|
+
hasWarnings: false,
|
|
8886
|
+
messages: []
|
|
8887
|
+
};
|
|
8652
8888
|
const sh = shape;
|
|
8653
8889
|
const th = tool;
|
|
8654
8890
|
if (inputFaceHashes.length > 0 && sh.type === "solid") {
|
|
8655
8891
|
if (th.type === "solid") {
|
|
8656
8892
|
const json = nativeFn(sh.id, th.id);
|
|
8657
|
-
return
|
|
8893
|
+
return {
|
|
8894
|
+
...this.parseNativeEvolution(json, hashUpperBound),
|
|
8895
|
+
diagnostics: noDiagnostics
|
|
8896
|
+
};
|
|
8658
8897
|
}
|
|
8659
8898
|
if (th.type === "compound") {
|
|
8660
8899
|
const childSolidIds = toArray(this.bk.getCompoundSolids(th.id));
|
|
@@ -8685,12 +8924,16 @@ var BrepkitAdapter = class BrepkitAdapter {
|
|
|
8685
8924
|
modified: combinedModified,
|
|
8686
8925
|
generated: combinedGenerated,
|
|
8687
8926
|
deleted: combinedDeleted
|
|
8688
|
-
}
|
|
8927
|
+
},
|
|
8928
|
+
diagnostics: noDiagnostics
|
|
8689
8929
|
};
|
|
8690
8930
|
}
|
|
8691
8931
|
}
|
|
8692
8932
|
const fallbackResult = fallbackFn(shape, tool, options);
|
|
8693
|
-
return
|
|
8933
|
+
return {
|
|
8934
|
+
...this.buildEvolution(fallbackResult, inputFaceHashes, hashUpperBound, false, shape),
|
|
8935
|
+
diagnostics: noDiagnostics
|
|
8936
|
+
};
|
|
8694
8937
|
}
|
|
8695
8938
|
fuseWithHistory(shape, tool, inputFaceHashes, hashUpperBound, options) {
|
|
8696
8939
|
return this.booleanWithHistoryImpl(shape, tool, inputFaceHashes, hashUpperBound, options, (a, b) => this.bk.fuseWithEvolution(a, b), (s, t, o) => this.fuse(s, t, o), "fuseWithHistory");
|
|
@@ -9840,6 +10083,12 @@ var BrepkitAdapter = class BrepkitAdapter {
|
|
|
9840
10083
|
reverseSurfaceU(surface) {
|
|
9841
10084
|
return surface;
|
|
9842
10085
|
}
|
|
10086
|
+
getNurbsCurveData(_edge) {
|
|
10087
|
+
return null;
|
|
10088
|
+
}
|
|
10089
|
+
getNurbsSurfaceData(_face) {
|
|
10090
|
+
return null;
|
|
10091
|
+
}
|
|
9843
10092
|
createPoint3d(x, y, z) {
|
|
9844
10093
|
return {
|
|
9845
10094
|
x,
|