brepjs 18.18.0 → 18.20.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/README.md +24 -14
- package/dist/2d.cjs +7 -7
- package/dist/2d.js +7 -7
- package/dist/{blueprint-Dz0LPfbm.cjs → blueprint-Bl0YQjkk.cjs} +7 -7
- package/dist/{blueprint-Dod3Pucj.js → blueprint-Cy5veXS3.js} +7 -7
- package/dist/{blueprintFns-BKCwR41V.js → blueprintFns-CSB51aXT.js} +3 -3
- package/dist/{blueprintFns-BFFIJd1K.cjs → blueprintFns-Dkccxo6d.cjs} +3 -3
- package/dist/{blueprintSketcher-BBWw_BeX.cjs → blueprintSketcher-Cr9A-R8I.cjs} +4 -4
- package/dist/{blueprintSketcher-mujcO3uV.js → blueprintSketcher-DeEogKbs.js} +4 -4
- package/dist/{boolean2D-Bx0_gvCS.cjs → boolean2D-BZ1UjpjX.cjs} +5 -5
- package/dist/{boolean2D-CdSpNYuw.js → boolean2D-lE2uy4Mm.js} +5 -5
- package/dist/{booleanFns-CipkzoSX.cjs → booleanFns-CD25YZGm.cjs} +6 -6
- package/dist/{booleanFns-D4r10eG8.js → booleanFns-CtvYfQZq.js} +6 -6
- package/dist/brepjs.cjs +1725 -34
- package/dist/brepjs.js +1737 -54
- package/dist/{cameraFns-BbgWV9ea.cjs → cameraFns-CR2inEBU.cjs} +3 -3
- package/dist/{cameraFns-DfqWQ17C.js → cameraFns-Dg1lQP0S.js} +3 -3
- package/dist/core/errors.d.ts +1 -0
- package/dist/core.cjs +3 -3
- package/dist/core.js +3 -3
- package/dist/{cornerFinder-ATn5SKjb.cjs → cornerFinder-CXN1IxPg.cjs} +1 -1
- package/dist/{cornerFinder-KEk4VpTe.js → cornerFinder-tfWhcA2M.js} +1 -1
- package/dist/csg/builders.d.ts +36 -0
- package/dist/csg/edit.d.ts +5 -0
- package/dist/csg/evaluate.d.ts +52 -0
- package/dist/csg/evaluators/booleans.d.ts +11 -0
- package/dist/csg/evaluators/compound.d.ts +8 -0
- package/dist/csg/evaluators/context.d.ts +9 -0
- package/dist/csg/evaluators/primitives.d.ts +15 -0
- package/dist/csg/evaluators/transforms.d.ts +10 -0
- package/dist/csg/expressions.d.ts +72 -0
- package/dist/csg/hash.d.ts +9 -0
- package/dist/csg/index.d.ts +15 -0
- package/dist/csg/optimize.d.ts +4 -0
- package/dist/csg/serialize.d.ts +9 -0
- package/dist/csg/types.d.ts +128 -0
- package/dist/{curveFns-DkpbzRtv.js → curveFns-BEF8t7XY.js} +2 -2
- package/dist/{curveFns-DhQVXMK0.cjs → curveFns-CcheHkr4.cjs} +2 -2
- package/dist/{drawFns-1JQUg7iu.js → drawFns-CEjshioX.js} +14 -14
- package/dist/{drawFns-N-BXk82r.cjs → drawFns-CuzUHFyD.cjs} +14 -14
- package/dist/{errors-0fYW_YnO.js → errors-8GZS3vy9.js} +1 -0
- package/dist/{errors-Dv6pfNct.cjs → errors-BiY8-q1s.cjs} +1 -0
- package/dist/{extrudeFns-DmNzWF1a.cjs → extrudeFns-BwU4ng1V.cjs} +2 -2
- package/dist/{extrudeFns-hUNicYgI.js → extrudeFns-gcWJSK9T.js} +2 -2
- package/dist/{faceFns-C9tfTZwq.js → faceFns-BNhFoEII.js} +3 -3
- package/dist/{faceFns-UQacl82e.cjs → faceFns-BbESdudy.cjs} +3 -3
- package/dist/{helpers-D4gm8z-T.cjs → helpers-BU3ANziG.cjs} +7 -7
- package/dist/{helpers-D3JzEtZl.js → helpers-D1J5VHbk.js} +7 -7
- package/dist/{historyFns-C3iimEbF.cjs → historyFns-DHOoBh6G.cjs} +5 -5
- package/dist/{historyFns-B4M2dl-F.js → historyFns-XZp1D_aA.js} +5 -5
- package/dist/{importFns-Cu1aMSAb.cjs → importFns-CsRJ9lbm.cjs} +3 -3
- package/dist/{importFns-CJd7ltsW.js → importFns-D1oB3yU8.js} +3 -3
- package/dist/index.d.ts +4 -1
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/kernel/index.d.ts +6 -0
- package/dist/{measureFns-DkNQXgnh.cjs → measureFns-BkoPw5JT.cjs} +4 -4
- package/dist/{measureFns-BTip3Aiz.js → measureFns-C3y_WX_E.js} +4 -4
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-BEGSUUSa.cjs → meshFns-CFMr9FBb.cjs} +3 -3
- package/dist/{meshFns-DWsgfwE8.js → meshFns-k0BdoBGR.js} +3 -3
- package/dist/ns/booleans.d.ts +1 -0
- package/dist/ns/csg.d.ts +4 -0
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{planeOps-CH4ruLuj.cjs → planeOps-2EyPq0tU.cjs} +1 -1
- package/dist/{planeOps-4i2qEraD.js → planeOps-Bea3T3mc.js} +1 -1
- package/dist/{primitiveFns-BLIDnaB4.js → primitiveFns-BsO-feBX.js} +133 -8
- package/dist/{primitiveFns-BLyZbYzv.cjs → primitiveFns-CkMua35m.cjs} +144 -7
- package/dist/projection.cjs +1 -1
- package/dist/projection.js +1 -1
- 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/{shapeFns-CsFHf3W8.cjs → shapeFns-CHTLdb_n.cjs} +3 -3
- package/dist/{shapeFns-DaqT_8dv.js → shapeFns-x8vqq2fR.js} +3 -3
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.js +1 -1
- package/dist/{shapeRefFns-WwBIiDUH.cjs → shapeRefFns-CDRLEUik.cjs} +4 -4
- package/dist/{shapeRefFns-BEsxgYOo.js → shapeRefFns-CE0yS0EB.js} +4 -4
- package/dist/{shapeTypes-BcAUN8Jp.cjs → shapeTypes-BpKhed-9.cjs} +15 -1
- package/dist/{shapeTypes-Dqjd8VMv.js → shapeTypes-DGtDTS9s.js} +10 -2
- package/dist/sketching.cjs +3 -3
- package/dist/sketching.js +3 -3
- package/dist/{solidBuilders-C8wxbX4w.cjs → solidBuilders-BlBaFSCS.cjs} +3 -3
- package/dist/{solidBuilders-CYtiaHtQ.js → solidBuilders-Cot05qzs.js} +3 -3
- package/dist/{surfaceBuilders-D60F6RHs.cjs → surfaceBuilders-frj7YRrD.cjs} +3 -3
- package/dist/{surfaceBuilders-CuChXov6.js → surfaceBuilders-zJyikeav.js} +3 -3
- package/dist/text.cjs +2 -2
- package/dist/text.js +2 -2
- package/dist/{textBlueprints-Cm_gPjjQ.js → textBlueprints-Bv6zhEyn.js} +9 -9
- package/dist/{textBlueprints-Cg2IOa7K.cjs → textBlueprints-CHh9SChA.cjs} +9 -9
- package/dist/{textMetrics-BExS67Zh.cjs → textMetrics-CKNdQX02.cjs} +2 -2
- package/dist/{textMetrics-Dbgikkim.js → textMetrics-vUJTTEFi.js} +2 -2
- package/dist/topology/booleanBatchFns.d.ts +55 -0
- package/dist/topology.cjs +9 -7
- package/dist/topology.d.ts +1 -0
- package/dist/topology.js +8 -8
- package/dist/{topologyQueryFns-C_rxyeER.cjs → topologyQueryFns-CHsPXNbI.cjs} +2 -2
- package/dist/{topologyQueryFns-DHbFP_6r.js → topologyQueryFns-CcWaCxeb.js} +2 -2
- package/dist/vectors.cjs +1 -1
- package/dist/vectors.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as ok, R as unwrap, b as err, l as typeCastError } from "./errors-
|
|
3
|
-
import { a as getCachedSurfaceType } from "./topologyQueryFns-
|
|
1
|
+
import { Z as getKernel, t as castShape } from "./shapeTypes-DGtDTS9s.js";
|
|
2
|
+
import { A as ok, R as unwrap, b as err, l as typeCastError } from "./errors-8GZS3vy9.js";
|
|
3
|
+
import { a as getCachedSurfaceType } from "./topologyQueryFns-CcWaCxeb.js";
|
|
4
4
|
import { r as toVec3 } from "./types-BIdk_GJY.js";
|
|
5
5
|
//#region src/topology/cast.ts
|
|
6
6
|
var TOPO_ENUM = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BpKhed-9.cjs");
|
|
2
|
+
const require_errors = require("./errors-BiY8-q1s.cjs");
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-CHsPXNbI.cjs");
|
|
4
4
|
const require_types = require("./types-CDkxah-M.cjs");
|
|
5
5
|
//#region src/topology/cast.ts
|
|
6
6
|
var TOPO_ENUM = {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BpKhed-9.cjs");
|
|
2
|
+
const require_errors = require("./errors-BiY8-q1s.cjs");
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-CHsPXNbI.cjs");
|
|
4
4
|
const require_constants = require("./constants-DTorLmes.cjs");
|
|
5
5
|
const require_vecOps = require("./vecOps-D7xplSx8.cjs");
|
|
6
|
-
const require_faceFns = require("./faceFns-
|
|
7
|
-
const require_shapeFns = require("./shapeFns-
|
|
8
|
-
const require_curveFns = require("./curveFns-
|
|
9
|
-
const require_measureFns = require("./measureFns-
|
|
6
|
+
const require_faceFns = require("./faceFns-BbESdudy.cjs");
|
|
7
|
+
const require_shapeFns = require("./shapeFns-CHTLdb_n.cjs");
|
|
8
|
+
const require_curveFns = require("./curveFns-CcheHkr4.cjs");
|
|
9
|
+
const require_measureFns = require("./measureFns-BkoPw5JT.cjs");
|
|
10
10
|
//#region src/utils/vec2d.ts
|
|
11
11
|
/** Precision for curve intersection and parameter operations. */
|
|
12
12
|
var PRECISION_INTERSECTION = 1e-9;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as ok, T as isOk, b as err, h as bug, o as queryError } from "./errors-
|
|
3
|
-
import { l as getVertices, o as getEdges, s as getFaces, u as getWires } from "./topologyQueryFns-
|
|
1
|
+
import { Z as getKernel, p as isFace } from "./shapeTypes-DGtDTS9s.js";
|
|
2
|
+
import { A as ok, T as isOk, b as err, h as bug, o as queryError } from "./errors-8GZS3vy9.js";
|
|
3
|
+
import { l as getVertices, o as getEdges, s as getFaces, u as getWires } from "./topologyQueryFns-CcWaCxeb.js";
|
|
4
4
|
import { t as DEG2RAD } from "./constants-Ci5CA3aZ.js";
|
|
5
5
|
import { a as vecDot, d as vecNormalize } from "./vecOps-DVROrqTV.js";
|
|
6
|
-
import { c as normalAt, o as getSurfaceType } from "./faceFns-
|
|
7
|
-
import { a as isSameShape, n as getHashCode } from "./shapeFns-
|
|
8
|
-
import { a as curveLength, d as getCurveType, r as curveIsClosed } from "./curveFns-
|
|
9
|
-
import { n as measureArea } from "./measureFns-
|
|
6
|
+
import { c as normalAt, o as getSurfaceType } from "./faceFns-BNhFoEII.js";
|
|
7
|
+
import { a as isSameShape, n as getHashCode } from "./shapeFns-x8vqq2fR.js";
|
|
8
|
+
import { a as curveLength, d as getCurveType, r as curveIsClosed } from "./curveFns-BEF8t7XY.js";
|
|
9
|
+
import { n as measureArea } from "./measureFns-C3y_WX_E.js";
|
|
10
10
|
//#region src/utils/vec2d.ts
|
|
11
11
|
/** Precision for curve intersection and parameter operations. */
|
|
12
12
|
var PRECISION_INTERSECTION = 1e-9;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BpKhed-9.cjs");
|
|
2
|
+
const require_errors = require("./errors-BiY8-q1s.cjs");
|
|
3
3
|
const require_vecOps = require("./vecOps-D7xplSx8.cjs");
|
|
4
|
-
const require_faceFns = require("./faceFns-
|
|
5
|
-
const require_shapeFns = require("./shapeFns-
|
|
6
|
-
const require_booleanFns = require("./booleanFns-
|
|
4
|
+
const require_faceFns = require("./faceFns-BbESdudy.cjs");
|
|
5
|
+
const require_shapeFns = require("./shapeFns-CHTLdb_n.cjs");
|
|
6
|
+
const require_booleanFns = require("./booleanFns-CD25YZGm.cjs");
|
|
7
7
|
//#region src/utils/uuid.ts
|
|
8
8
|
/** Generate a v4-style UUID string using `crypto.getRandomValues`. */
|
|
9
9
|
function uuidv() {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { B as createKernelHandle,
|
|
2
|
-
import { A as ok, b as err, d as validationError, n as computationError, r as ioError } from "./errors-
|
|
1
|
+
import { B as createKernelHandle, Z as getKernel, t as castShape } from "./shapeTypes-DGtDTS9s.js";
|
|
2
|
+
import { A as ok, b as err, d as validationError, n as computationError, r as ioError } from "./errors-8GZS3vy9.js";
|
|
3
3
|
import { d as vecNormalize, s as vecIsZero } from "./vecOps-DVROrqTV.js";
|
|
4
|
-
import { v as fromBREP } from "./faceFns-
|
|
5
|
-
import { s as toBREP } from "./shapeFns-
|
|
6
|
-
import { a as fuseAll } from "./booleanFns-
|
|
4
|
+
import { v as fromBREP } from "./faceFns-BNhFoEII.js";
|
|
5
|
+
import { s as toBREP } from "./shapeFns-x8vqq2fR.js";
|
|
6
|
+
import { a as fuseAll } from "./booleanFns-CtvYfQZq.js";
|
|
7
7
|
//#region src/utils/uuid.ts
|
|
8
8
|
/** Generate a v4-style UUID string using `crypto.getRandomValues`. */
|
|
9
9
|
function uuidv() {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BpKhed-9.cjs");
|
|
2
2
|
const require_vec3 = require("./vec3-S4Oh59IX.cjs");
|
|
3
|
-
const require_errors = require("./errors-
|
|
3
|
+
const require_errors = require("./errors-BiY8-q1s.cjs");
|
|
4
4
|
const require_arrayAccess = require("./arrayAccess-7pTWqkJu.cjs");
|
|
5
|
-
const require_blueprint = require("./blueprint-
|
|
5
|
+
const require_blueprint = require("./blueprint-Bl0YQjkk.cjs");
|
|
6
6
|
//#region src/io/objExportFns.ts
|
|
7
7
|
/** Read a vec3 from a typed array at the given vertex index. */
|
|
8
8
|
function vec3At(arr, i) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Z as getKernel, t as castShape } from "./shapeTypes-DGtDTS9s.js";
|
|
2
2
|
import { n as wasmIndex, t as vec3At$1 } from "./vec3-BRj3eI54.js";
|
|
3
|
-
import { A as ok, b as err, r as ioError, t as BrepErrorCode } from "./errors-
|
|
3
|
+
import { A as ok, b as err, r as ioError, t as BrepErrorCode } from "./errors-8GZS3vy9.js";
|
|
4
4
|
import { n as getAtOrThrow } from "./arrayAccess-C5IWcxs9.js";
|
|
5
|
-
import { f as make2dSegmentCurve, m as make2dThreePointArc, s as make2dBezierCurve, t as Blueprint } from "./blueprint-
|
|
5
|
+
import { f as make2dSegmentCurve, m as make2dThreePointArc, s as make2dBezierCurve, t as Blueprint } from "./blueprint-Cy5veXS3.js";
|
|
6
6
|
//#region src/io/objExportFns.ts
|
|
7
7
|
/** Read a vec3 from a typed array at the given vertex index. */
|
|
8
8
|
function vec3At(arr, i) {
|
package/dist/index.d.ts
CHANGED
|
@@ -85,7 +85,9 @@ export { getSurfaceType, faceGeomType, faceOrientation, flipFaceOrientation, uvB
|
|
|
85
85
|
export { exportSTEP, exportSTL, exportIGES, meshMultiLOD, type ShapeMesh, type EdgeMesh, type MeshOptions, type MultiLODMesh, } from './topology/meshFns.js';
|
|
86
86
|
export { clearMeshCache, createMeshCache, type MeshCacheContext } from './topology/meshCache.js';
|
|
87
87
|
export { toBufferGeometryData, toLineGeometryData, toGroupedBufferGeometryData, type BufferGeometryData, type LineGeometryData, type GroupedBufferGeometryData, type BufferGeometryGroup, toLODGeometryData, type LODGeometryData, } from './topology/threeHelpers.js';
|
|
88
|
-
export { fuseAll, cutAll, booleanPipeline, type BooleanOptions, type BooleanPipelineStep,
|
|
88
|
+
export { fuseAll, cutAll, booleanPipeline, type BooleanOptions, type BooleanPipelineStep, } from './topology/booleanFns.js';
|
|
89
|
+
export { fuseAllBisect, cutAllBisect, type BatchBisectResult, type BatchBisectTelemetry, } from './topology/booleanBatchFns.js';
|
|
90
|
+
export { type PipelineOp } from './topology/booleanFns.js';
|
|
89
91
|
export { checkBoolean } from './topology/booleanDiagnosticFns.js';
|
|
90
92
|
export type { CheckBooleanResult, BooleanIssue, BooleanOpType, BooleanDiagnostics, } from './kernel/types.js';
|
|
91
93
|
export { fuseWithEvolution, cutWithEvolution, intersectWithEvolution, filletWithEvolution, chamferWithEvolution, shellWithEvolution, type EvolutionResult, } from './topology/evolutionFns.js';
|
|
@@ -140,3 +142,4 @@ export * as io from './ns/ioNs.js';
|
|
|
140
142
|
export * as query from './ns/query.js';
|
|
141
143
|
export * as construction from './ns/construction.js';
|
|
142
144
|
export * as patterns from './ns/patterns.js';
|
|
145
|
+
export * as csg from './ns/csg.js';
|
package/dist/io.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_meshFns = require("./meshFns-
|
|
3
|
-
const require_importFns = require("./importFns-
|
|
2
|
+
const require_meshFns = require("./meshFns-CFMr9FBb.cjs");
|
|
3
|
+
const require_importFns = require("./importFns-CsRJ9lbm.cjs");
|
|
4
4
|
exports.blueprintToDXF = require_importFns.blueprintToDXF;
|
|
5
5
|
exports.exportDXF = require_importFns.exportDXF;
|
|
6
6
|
exports.exportGlb = require_importFns.exportGlb;
|
package/dist/io.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as exportSTEP, r as exportSTL, t as exportIGES } from "./meshFns-
|
|
2
|
-
import { a as importSVG, c as blueprintToDXF, d as exportGltf, f as exportOBJ, i as exportSTEPConfigured, l as exportDXF, n as importSTEP, o as importSVGPathD, r as importSTL, s as exportThreeMF, t as importIGES, u as exportGlb } from "./importFns-
|
|
1
|
+
import { n as exportSTEP, r as exportSTL, t as exportIGES } from "./meshFns-k0BdoBGR.js";
|
|
2
|
+
import { a as importSVG, c as blueprintToDXF, d as exportGltf, f as exportOBJ, i as exportSTEPConfigured, l as exportDXF, n as importSTEP, o as importSVGPathD, r as importSTL, s as exportThreeMF, t as importIGES, u as exportGlb } from "./importFns-D1oB3yU8.js";
|
|
3
3
|
export { blueprintToDXF, exportDXF, exportGlb, exportGltf, exportIGES, exportOBJ, exportSTEP, exportSTEPConfigured, exportSTL, exportThreeMF, importIGES, importSTEP, importSTL, importSVG, importSVGPathD };
|
package/dist/kernel/index.d.ts
CHANGED
|
@@ -25,6 +25,12 @@ export declare function getKernel2D(id?: string): KernelAdapter & Kernel2DCapabi
|
|
|
25
25
|
* restored synchronously in `finally`, so any `getKernel()` call after
|
|
26
26
|
* the first `await` inside `fn` would observe the wrong kernel.
|
|
27
27
|
*/
|
|
28
|
+
/**
|
|
29
|
+
* Return the id of the currently active default kernel, or `null` if none is
|
|
30
|
+
* registered yet. Useful for code that needs a stable identifier (e.g.
|
|
31
|
+
* cache keys) but doesn't want to ship the actual adapter.
|
|
32
|
+
*/
|
|
33
|
+
export declare function getActiveKernelId(): string | null;
|
|
28
34
|
export declare function withKernel<T extends Exclude<unknown, Promise<unknown>>>(id: string, fn: () => T): T;
|
|
29
35
|
/** Initialise the brepjs kernel from a loaded WASM instance. */
|
|
30
36
|
export declare function initFromOC(oc: KernelInstance): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
4
|
-
const require_faceFns = require("./faceFns-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BpKhed-9.cjs");
|
|
2
|
+
const require_errors = require("./errors-BiY8-q1s.cjs");
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-CHsPXNbI.cjs");
|
|
4
|
+
const require_faceFns = require("./faceFns-BbESdudy.cjs");
|
|
5
5
|
//#region src/measurement/measureCache.ts
|
|
6
6
|
var cache = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
function getCachedMeasurement(shape, key) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as ok, b as err, d as validationError, t as BrepErrorCode } from "./errors-
|
|
3
|
-
import { v as kernelCallRaw } from "./topologyQueryFns-
|
|
4
|
-
import { p as uvBounds } from "./faceFns-
|
|
1
|
+
import { Z as getKernel } from "./shapeTypes-DGtDTS9s.js";
|
|
2
|
+
import { A as ok, b as err, d as validationError, t as BrepErrorCode } from "./errors-8GZS3vy9.js";
|
|
3
|
+
import { v as kernelCallRaw } from "./topologyQueryFns-CcWaCxeb.js";
|
|
4
|
+
import { p as uvBounds } from "./faceFns-BNhFoEII.js";
|
|
5
5
|
//#region src/measurement/measureCache.ts
|
|
6
6
|
var cache = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
function getCachedMeasurement(shape, key) {
|
package/dist/measurement.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_measureFns = require("./measureFns-
|
|
2
|
+
const require_measureFns = require("./measureFns-BkoPw5JT.cjs");
|
|
3
3
|
exports.createDistanceQuery = require_measureFns.createDistanceQuery;
|
|
4
4
|
exports.measureArea = require_measureFns.measureArea;
|
|
5
5
|
exports.measureDistance = require_measureFns.measureDistance;
|
package/dist/measurement.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as measureDistance, c as measureLinearProps, d as measureVolumeProps, l as measureSurfaceProps, n as measureArea, o as measureDistanceProps, s as measureLength, t as createDistanceQuery, u as measureVolume } from "./measureFns-
|
|
1
|
+
import { a as measureDistance, c as measureLinearProps, d as measureVolumeProps, l as measureSurfaceProps, n as measureArea, o as measureDistanceProps, s as measureLength, t as createDistanceQuery, u as measureVolume } from "./measureFns-C3y_WX_E.js";
|
|
2
2
|
export { createDistanceQuery, measureArea, measureDistance, measureDistanceProps, measureLength, measureLinearProps, measureSurfaceProps, measureVolume, measureVolumeProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
3
|
-
const require_shapeFns = require("./shapeFns-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BpKhed-9.cjs");
|
|
2
|
+
const require_errors = require("./errors-BiY8-q1s.cjs");
|
|
3
|
+
const require_shapeFns = require("./shapeFns-CHTLdb_n.cjs");
|
|
4
4
|
//#region src/topology/meshCache.ts
|
|
5
5
|
/**
|
|
6
6
|
* Build a parameter key for the inner cache map (excludes shape identity).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as ok, b as err, r as ioError } from "./errors-
|
|
3
|
-
import { O as getFaceOrigins } from "./shapeFns-
|
|
1
|
+
import { Z as getKernel } from "./shapeTypes-DGtDTS9s.js";
|
|
2
|
+
import { A as ok, b as err, r as ioError } from "./errors-8GZS3vy9.js";
|
|
3
|
+
import { O as getFaceOrigins } from "./shapeFns-x8vqq2fR.js";
|
|
4
4
|
//#region src/topology/meshCache.ts
|
|
5
5
|
/**
|
|
6
6
|
* Build a parameter key for the inner cache map (excludes shape identity).
|
package/dist/ns/booleans.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export { fuse, cut, intersect, section, sectionToFace, split, slice } from '../topology/api.js';
|
|
5
5
|
export { fuseAll, cutAll } from '../topology/booleanFns.js';
|
|
6
|
+
export { fuseAllBisect, cutAllBisect } from '../topology/booleanBatchFns.js';
|
|
6
7
|
export { checkBoolean } from '../topology/booleanDiagnosticFns.js';
|
|
7
8
|
export { hull } from '../topology/hullFns.js';
|
|
8
9
|
export { convexHull } from '../operations/convexHullFns.js';
|
package/dist/ns/csg.d.ts
ADDED
package/dist/operations.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_historyFns = require("./historyFns-
|
|
3
|
-
const require_extrudeFns = require("./extrudeFns-
|
|
2
|
+
const require_historyFns = require("./historyFns-DHOoBh6G.cjs");
|
|
3
|
+
const require_extrudeFns = require("./extrudeFns-BwU4ng1V.cjs");
|
|
4
4
|
exports.addChild = require_historyFns.addChild;
|
|
5
5
|
exports.addStep = require_historyFns.addStep;
|
|
6
6
|
exports.circularPattern = require_historyFns.circularPattern;
|
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 sweep, i as complexExtrude, l as twistExtrude, s as supportExtrude } 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-XZp1D_aA.js";
|
|
2
|
+
import { c as sweep, i as complexExtrude, l as twistExtrude, s as supportExtrude } from "./extrudeFns-gcWJSK9T.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,4 +1,4 @@
|
|
|
1
|
-
const require_errors = require("./errors-
|
|
1
|
+
const require_errors = require("./errors-BiY8-q1s.cjs");
|
|
2
2
|
const require_constants = require("./constants-DTorLmes.cjs");
|
|
3
3
|
const require_types = require("./types-CDkxah-M.cjs");
|
|
4
4
|
const require_vecOps = require("./vecOps-D7xplSx8.cjs");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as ok, R as unwrap, b as err, d as validationError } from "./errors-
|
|
1
|
+
import { A as ok, R as unwrap, b as err, d as validationError } from "./errors-8GZS3vy9.js";
|
|
2
2
|
import { t as DEG2RAD } from "./constants-Ci5CA3aZ.js";
|
|
3
3
|
import { r as toVec3 } from "./types-BIdk_GJY.js";
|
|
4
4
|
import { d as vecNormalize, h as vecScale, m as vecRotate, r as vecCross, s as vecIsZero, t as vecAdd } from "./vecOps-DVROrqTV.js";
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as ok, T as isOk, b as err, d as validationError, i as kernelError, l as typeCastError, t as BrepErrorCode, v as andThen, w as isErr } from "./errors-
|
|
3
|
-
import { c as getOrCreateCache, d as invalidateShapeCache, i as getCachedIsValid, o as getEdges, s as getFaces, u as getWires } from "./topologyQueryFns-
|
|
1
|
+
import { Z 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-DGtDTS9s.js";
|
|
2
|
+
import { A as ok, T as isOk, b as err, d as validationError, i as kernelError, l as typeCastError, t as BrepErrorCode, v as andThen, w as isErr } from "./errors-8GZS3vy9.js";
|
|
3
|
+
import { c as getOrCreateCache, d as invalidateShapeCache, i as getCachedIsValid, o as getEdges, s as getFaces, u as getWires } from "./topologyQueryFns-CcWaCxeb.js";
|
|
4
4
|
import { n as HASH_CODE_MAX, t as DEG2RAD } from "./constants-Ci5CA3aZ.js";
|
|
5
|
-
import { _ as downcast } from "./faceFns-
|
|
6
|
-
import { _ as propagateAllMetadata, g as collectInputFaceHashes, h as translate } from "./shapeFns-
|
|
7
|
-
import {
|
|
8
|
-
import { a as
|
|
5
|
+
import { _ as downcast } from "./faceFns-BNhFoEII.js";
|
|
6
|
+
import { _ as propagateAllMetadata, g as collectInputFaceHashes, h as translate } from "./shapeFns-x8vqq2fR.js";
|
|
7
|
+
import { t as firstOrThrow } from "./arrayAccess-C5IWcxs9.js";
|
|
8
|
+
import { _ as makeThreePointArc, a as makeNonPlanarFace, c as makeBSplineApproximation, d as makeCircle, f as makeEllipse, g as makeTangentArc, h as makeLine, i as makeNewFaceWithinFace, m as makeHelix, o as makePolygon, p as makeEllipseArc, r as makeFace, s as assembleWire, t as addHolesInFace, u as makeBezierCurve } from "./surfaceBuilders-zJyikeav.js";
|
|
9
|
+
import { a as fuseAll, i as fuse, n as cut, r as cutAll } from "./booleanFns-CtvYfQZq.js";
|
|
10
|
+
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-Cot05qzs.js";
|
|
9
11
|
//#region src/topology/threeHelpers.ts
|
|
10
12
|
/**
|
|
11
13
|
* Convert a ShapeMesh into BufferGeometry-compatible typed arrays.
|
|
@@ -334,6 +336,129 @@ function getNurbsSurfaceData(face) {
|
|
|
334
336
|
return kernel.getNurbsSurfaceData(face.wrapped);
|
|
335
337
|
}
|
|
336
338
|
//#endregion
|
|
339
|
+
//#region src/topology/booleanBatchFns.ts
|
|
340
|
+
var REAL_OPS = {
|
|
341
|
+
cut,
|
|
342
|
+
cutAll,
|
|
343
|
+
fuse,
|
|
344
|
+
fuseAll
|
|
345
|
+
};
|
|
346
|
+
function freezeTelemetry(t) {
|
|
347
|
+
return {
|
|
348
|
+
totalInputs: t.totalInputs,
|
|
349
|
+
batchAttempts: t.batchAttempts,
|
|
350
|
+
batchSucceeded: t.batchSucceeded,
|
|
351
|
+
singletonFallbacks: t.singletonFallbacks,
|
|
352
|
+
failedInputs: [...t.failedInputs].sort((a, b) => a - b)
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
function cutAllBisect(base, tools, options = {}) {
|
|
356
|
+
return cutAllBisectWith(REAL_OPS, base, tools, options);
|
|
357
|
+
}
|
|
358
|
+
/** @internal — testable variant accepting injected kernel ops. */
|
|
359
|
+
function cutAllBisectWith(ops, base, tools, options = {}) {
|
|
360
|
+
if (options.signal?.aborted) throw options.signal.reason;
|
|
361
|
+
const telemetry = {
|
|
362
|
+
totalInputs: tools.length,
|
|
363
|
+
batchAttempts: 0,
|
|
364
|
+
batchSucceeded: 0,
|
|
365
|
+
singletonFallbacks: 0,
|
|
366
|
+
failedInputs: /* @__PURE__ */ new Set()
|
|
367
|
+
};
|
|
368
|
+
const result = bisectCut(ops, base, tools, 0, options, telemetry);
|
|
369
|
+
if (isErr(result)) return result;
|
|
370
|
+
return ok({
|
|
371
|
+
shape: result.value,
|
|
372
|
+
telemetry: freezeTelemetry(telemetry)
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
function bisectCut(ops, base, tools, startIdx, options, telemetry) {
|
|
376
|
+
if (tools.length === 0) return ok(base);
|
|
377
|
+
if (tools.length === 1) return applySingletonCut(ops, base, tools, startIdx, options, telemetry);
|
|
378
|
+
telemetry.batchAttempts++;
|
|
379
|
+
const batchResult = tryBatch(() => ops.cutAll(base, tools, options));
|
|
380
|
+
if (batchResult && batchResult.ok) {
|
|
381
|
+
telemetry.batchSucceeded++;
|
|
382
|
+
return batchResult;
|
|
383
|
+
}
|
|
384
|
+
if (options.signal?.aborted) throw options.signal.reason;
|
|
385
|
+
const mid = Math.floor(tools.length / 2);
|
|
386
|
+
const left = bisectCut(ops, base, tools.slice(0, mid), startIdx, options, telemetry);
|
|
387
|
+
if (!left.ok) return left;
|
|
388
|
+
return bisectCut(ops, left.value, tools.slice(mid), startIdx + mid, options, telemetry);
|
|
389
|
+
}
|
|
390
|
+
function applySingletonCut(ops, base, tools, startIdx, options, telemetry) {
|
|
391
|
+
telemetry.singletonFallbacks++;
|
|
392
|
+
const tool = firstOrThrow(tools);
|
|
393
|
+
const pairResult = tryBatch(() => ops.cut(base, tool, options));
|
|
394
|
+
if (pairResult && pairResult.ok) return pairResult;
|
|
395
|
+
if (options.signal?.aborted) throw options.signal.reason;
|
|
396
|
+
telemetry.failedInputs.add(startIdx);
|
|
397
|
+
return ok(base);
|
|
398
|
+
}
|
|
399
|
+
function fuseAllBisect(shapes, options = {}) {
|
|
400
|
+
return fuseAllBisectWith(REAL_OPS, shapes, options);
|
|
401
|
+
}
|
|
402
|
+
/** @internal — testable variant accepting injected kernel ops. */
|
|
403
|
+
function fuseAllBisectWith(ops, shapes, options = {}) {
|
|
404
|
+
if (options.signal?.aborted) throw options.signal.reason;
|
|
405
|
+
if (shapes.length === 0) return err(validationError(BrepErrorCode.FUSE_ALL_EMPTY, "fuseAllBisect requires at least one shape"));
|
|
406
|
+
const telemetry = {
|
|
407
|
+
totalInputs: shapes.length,
|
|
408
|
+
batchAttempts: 0,
|
|
409
|
+
batchSucceeded: 0,
|
|
410
|
+
singletonFallbacks: 0,
|
|
411
|
+
failedInputs: /* @__PURE__ */ new Set()
|
|
412
|
+
};
|
|
413
|
+
const result = bisectFuse(ops, shapes, 0, options, telemetry);
|
|
414
|
+
if (isErr(result)) return result;
|
|
415
|
+
return ok({
|
|
416
|
+
shape: result.value,
|
|
417
|
+
telemetry: freezeTelemetry(telemetry)
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
function bisectFuse(ops, shapes, startIdx, options, telemetry) {
|
|
421
|
+
if (shapes.length === 1) return ok(firstOrThrow(shapes));
|
|
422
|
+
telemetry.batchAttempts++;
|
|
423
|
+
const batchResult = tryBatch(() => ops.fuseAll(shapes, options));
|
|
424
|
+
if (batchResult && batchResult.ok) {
|
|
425
|
+
telemetry.batchSucceeded++;
|
|
426
|
+
return batchResult;
|
|
427
|
+
}
|
|
428
|
+
if (options.signal?.aborted) throw options.signal.reason;
|
|
429
|
+
const mid = Math.floor(shapes.length / 2);
|
|
430
|
+
return combineFuseHalves(ops, bisectFuse(ops, shapes.slice(0, mid), startIdx, options, telemetry), bisectFuse(ops, shapes.slice(mid), startIdx + mid, options, telemetry), shapes, startIdx, mid, options, telemetry);
|
|
431
|
+
}
|
|
432
|
+
function combineFuseHalves(ops, left, right, shapes, startIdx, mid, options, telemetry) {
|
|
433
|
+
if (left.ok && right.ok) {
|
|
434
|
+
telemetry.singletonFallbacks++;
|
|
435
|
+
const merged = tryBatch(() => ops.fuse(left.value, right.value, options));
|
|
436
|
+
if (merged && merged.ok) return merged;
|
|
437
|
+
for (let i = mid; i < shapes.length; i++) telemetry.failedInputs.add(startIdx + i);
|
|
438
|
+
return left;
|
|
439
|
+
}
|
|
440
|
+
if (left.ok) {
|
|
441
|
+
for (let i = mid; i < shapes.length; i++) telemetry.failedInputs.add(startIdx + i);
|
|
442
|
+
return left;
|
|
443
|
+
}
|
|
444
|
+
if (right.ok) {
|
|
445
|
+
for (let i = 0; i < mid; i++) telemetry.failedInputs.add(startIdx + i);
|
|
446
|
+
return right;
|
|
447
|
+
}
|
|
448
|
+
return left;
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* Run a batch boolean op, returning null on kernel throw (signal-aborts
|
|
452
|
+
* propagate). The caller checks for null and bisects.
|
|
453
|
+
*/
|
|
454
|
+
function tryBatch(fn) {
|
|
455
|
+
try {
|
|
456
|
+
return fn();
|
|
457
|
+
} catch {
|
|
458
|
+
return null;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
//#endregion
|
|
337
462
|
//#region src/topology/booleanDiagnosticFns.ts
|
|
338
463
|
/**
|
|
339
464
|
* Boolean pre-validation diagnostics.
|
|
@@ -1502,4 +1627,4 @@ function addHoles(f, holes) {
|
|
|
1502
1627
|
return addHolesInFace(f, holes);
|
|
1503
1628
|
}
|
|
1504
1629
|
//#endregion
|
|
1505
|
-
export {
|
|
1630
|
+
export { fuseAllBisect 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, cutAllBisect 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, sharedEdges as at, sphere as b, cylinder as c, chamferDistAngle as ct, ellipsoid as d, toLODGeometryData as dt, getNurbsCurveData as et, face as f, toLineGeometryData as ft, offsetFace as g, line as h, bsplineApprox as i, facesOfEdge as it, heal as j, fixSelfIntersection as k, ellipse as l, toBufferGeometryData as lt, helix as m, bezier as n, adjacentFaces as nt, compound as o, verticesOfEdge as ot, filledFace as p, filletWithEvolution as q, box as r, edgesOfFace as rt, cone as s, wiresOfFace as st, addHoles as t, getNurbsSurfaceData as tt, ellipseArc as u, toGroupedBufferGeometryData as ut, sewShells as v, torus as w, subFace as x, solid as y, fillet as z };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BpKhed-9.cjs");
|
|
2
|
+
const require_errors = require("./errors-BiY8-q1s.cjs");
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-CHsPXNbI.cjs");
|
|
4
4
|
const require_constants = require("./constants-DTorLmes.cjs");
|
|
5
|
-
const require_faceFns = require("./faceFns-
|
|
6
|
-
const require_shapeFns = require("./shapeFns-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
5
|
+
const require_faceFns = require("./faceFns-BbESdudy.cjs");
|
|
6
|
+
const require_shapeFns = require("./shapeFns-CHTLdb_n.cjs");
|
|
7
|
+
const require_arrayAccess = require("./arrayAccess-7pTWqkJu.cjs");
|
|
8
|
+
const require_surfaceBuilders = require("./surfaceBuilders-frj7YRrD.cjs");
|
|
9
|
+
const require_booleanFns = require("./booleanFns-CD25YZGm.cjs");
|
|
10
|
+
const require_solidBuilders = require("./solidBuilders-BlBaFSCS.cjs");
|
|
9
11
|
//#region src/topology/threeHelpers.ts
|
|
10
12
|
/**
|
|
11
13
|
* Convert a ShapeMesh into BufferGeometry-compatible typed arrays.
|
|
@@ -334,6 +336,129 @@ function getNurbsSurfaceData(face) {
|
|
|
334
336
|
return kernel.getNurbsSurfaceData(face.wrapped);
|
|
335
337
|
}
|
|
336
338
|
//#endregion
|
|
339
|
+
//#region src/topology/booleanBatchFns.ts
|
|
340
|
+
var REAL_OPS = {
|
|
341
|
+
cut: require_booleanFns.cut,
|
|
342
|
+
cutAll: require_booleanFns.cutAll,
|
|
343
|
+
fuse: require_booleanFns.fuse,
|
|
344
|
+
fuseAll: require_booleanFns.fuseAll
|
|
345
|
+
};
|
|
346
|
+
function freezeTelemetry(t) {
|
|
347
|
+
return {
|
|
348
|
+
totalInputs: t.totalInputs,
|
|
349
|
+
batchAttempts: t.batchAttempts,
|
|
350
|
+
batchSucceeded: t.batchSucceeded,
|
|
351
|
+
singletonFallbacks: t.singletonFallbacks,
|
|
352
|
+
failedInputs: [...t.failedInputs].sort((a, b) => a - b)
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
function cutAllBisect(base, tools, options = {}) {
|
|
356
|
+
return cutAllBisectWith(REAL_OPS, base, tools, options);
|
|
357
|
+
}
|
|
358
|
+
/** @internal — testable variant accepting injected kernel ops. */
|
|
359
|
+
function cutAllBisectWith(ops, base, tools, options = {}) {
|
|
360
|
+
if (options.signal?.aborted) throw options.signal.reason;
|
|
361
|
+
const telemetry = {
|
|
362
|
+
totalInputs: tools.length,
|
|
363
|
+
batchAttempts: 0,
|
|
364
|
+
batchSucceeded: 0,
|
|
365
|
+
singletonFallbacks: 0,
|
|
366
|
+
failedInputs: /* @__PURE__ */ new Set()
|
|
367
|
+
};
|
|
368
|
+
const result = bisectCut(ops, base, tools, 0, options, telemetry);
|
|
369
|
+
if (require_errors.isErr(result)) return result;
|
|
370
|
+
return require_errors.ok({
|
|
371
|
+
shape: result.value,
|
|
372
|
+
telemetry: freezeTelemetry(telemetry)
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
function bisectCut(ops, base, tools, startIdx, options, telemetry) {
|
|
376
|
+
if (tools.length === 0) return require_errors.ok(base);
|
|
377
|
+
if (tools.length === 1) return applySingletonCut(ops, base, tools, startIdx, options, telemetry);
|
|
378
|
+
telemetry.batchAttempts++;
|
|
379
|
+
const batchResult = tryBatch(() => ops.cutAll(base, tools, options));
|
|
380
|
+
if (batchResult && batchResult.ok) {
|
|
381
|
+
telemetry.batchSucceeded++;
|
|
382
|
+
return batchResult;
|
|
383
|
+
}
|
|
384
|
+
if (options.signal?.aborted) throw options.signal.reason;
|
|
385
|
+
const mid = Math.floor(tools.length / 2);
|
|
386
|
+
const left = bisectCut(ops, base, tools.slice(0, mid), startIdx, options, telemetry);
|
|
387
|
+
if (!left.ok) return left;
|
|
388
|
+
return bisectCut(ops, left.value, tools.slice(mid), startIdx + mid, options, telemetry);
|
|
389
|
+
}
|
|
390
|
+
function applySingletonCut(ops, base, tools, startIdx, options, telemetry) {
|
|
391
|
+
telemetry.singletonFallbacks++;
|
|
392
|
+
const tool = require_arrayAccess.firstOrThrow(tools);
|
|
393
|
+
const pairResult = tryBatch(() => ops.cut(base, tool, options));
|
|
394
|
+
if (pairResult && pairResult.ok) return pairResult;
|
|
395
|
+
if (options.signal?.aborted) throw options.signal.reason;
|
|
396
|
+
telemetry.failedInputs.add(startIdx);
|
|
397
|
+
return require_errors.ok(base);
|
|
398
|
+
}
|
|
399
|
+
function fuseAllBisect(shapes, options = {}) {
|
|
400
|
+
return fuseAllBisectWith(REAL_OPS, shapes, options);
|
|
401
|
+
}
|
|
402
|
+
/** @internal — testable variant accepting injected kernel ops. */
|
|
403
|
+
function fuseAllBisectWith(ops, shapes, options = {}) {
|
|
404
|
+
if (options.signal?.aborted) throw options.signal.reason;
|
|
405
|
+
if (shapes.length === 0) return require_errors.err(require_errors.validationError(require_errors.BrepErrorCode.FUSE_ALL_EMPTY, "fuseAllBisect requires at least one shape"));
|
|
406
|
+
const telemetry = {
|
|
407
|
+
totalInputs: shapes.length,
|
|
408
|
+
batchAttempts: 0,
|
|
409
|
+
batchSucceeded: 0,
|
|
410
|
+
singletonFallbacks: 0,
|
|
411
|
+
failedInputs: /* @__PURE__ */ new Set()
|
|
412
|
+
};
|
|
413
|
+
const result = bisectFuse(ops, shapes, 0, options, telemetry);
|
|
414
|
+
if (require_errors.isErr(result)) return result;
|
|
415
|
+
return require_errors.ok({
|
|
416
|
+
shape: result.value,
|
|
417
|
+
telemetry: freezeTelemetry(telemetry)
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
function bisectFuse(ops, shapes, startIdx, options, telemetry) {
|
|
421
|
+
if (shapes.length === 1) return require_errors.ok(require_arrayAccess.firstOrThrow(shapes));
|
|
422
|
+
telemetry.batchAttempts++;
|
|
423
|
+
const batchResult = tryBatch(() => ops.fuseAll(shapes, options));
|
|
424
|
+
if (batchResult && batchResult.ok) {
|
|
425
|
+
telemetry.batchSucceeded++;
|
|
426
|
+
return batchResult;
|
|
427
|
+
}
|
|
428
|
+
if (options.signal?.aborted) throw options.signal.reason;
|
|
429
|
+
const mid = Math.floor(shapes.length / 2);
|
|
430
|
+
return combineFuseHalves(ops, bisectFuse(ops, shapes.slice(0, mid), startIdx, options, telemetry), bisectFuse(ops, shapes.slice(mid), startIdx + mid, options, telemetry), shapes, startIdx, mid, options, telemetry);
|
|
431
|
+
}
|
|
432
|
+
function combineFuseHalves(ops, left, right, shapes, startIdx, mid, options, telemetry) {
|
|
433
|
+
if (left.ok && right.ok) {
|
|
434
|
+
telemetry.singletonFallbacks++;
|
|
435
|
+
const merged = tryBatch(() => ops.fuse(left.value, right.value, options));
|
|
436
|
+
if (merged && merged.ok) return merged;
|
|
437
|
+
for (let i = mid; i < shapes.length; i++) telemetry.failedInputs.add(startIdx + i);
|
|
438
|
+
return left;
|
|
439
|
+
}
|
|
440
|
+
if (left.ok) {
|
|
441
|
+
for (let i = mid; i < shapes.length; i++) telemetry.failedInputs.add(startIdx + i);
|
|
442
|
+
return left;
|
|
443
|
+
}
|
|
444
|
+
if (right.ok) {
|
|
445
|
+
for (let i = 0; i < mid; i++) telemetry.failedInputs.add(startIdx + i);
|
|
446
|
+
return right;
|
|
447
|
+
}
|
|
448
|
+
return left;
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* Run a batch boolean op, returning null on kernel throw (signal-aborts
|
|
452
|
+
* propagate). The caller checks for null and bisects.
|
|
453
|
+
*/
|
|
454
|
+
function tryBatch(fn) {
|
|
455
|
+
try {
|
|
456
|
+
return fn();
|
|
457
|
+
} catch {
|
|
458
|
+
return null;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
//#endregion
|
|
337
462
|
//#region src/topology/booleanDiagnosticFns.ts
|
|
338
463
|
/**
|
|
339
464
|
* Boolean pre-validation diagnostics.
|
|
@@ -1580,6 +1705,12 @@ Object.defineProperty(exports, "cone", {
|
|
|
1580
1705
|
return cone;
|
|
1581
1706
|
}
|
|
1582
1707
|
});
|
|
1708
|
+
Object.defineProperty(exports, "cutAllBisect", {
|
|
1709
|
+
enumerable: true,
|
|
1710
|
+
get: function() {
|
|
1711
|
+
return cutAllBisect;
|
|
1712
|
+
}
|
|
1713
|
+
});
|
|
1583
1714
|
Object.defineProperty(exports, "cutWithEvolution", {
|
|
1584
1715
|
enumerable: true,
|
|
1585
1716
|
get: function() {
|
|
@@ -1664,6 +1795,12 @@ Object.defineProperty(exports, "fixShape", {
|
|
|
1664
1795
|
return fixShape;
|
|
1665
1796
|
}
|
|
1666
1797
|
});
|
|
1798
|
+
Object.defineProperty(exports, "fuseAllBisect", {
|
|
1799
|
+
enumerable: true,
|
|
1800
|
+
get: function() {
|
|
1801
|
+
return fuseAllBisect;
|
|
1802
|
+
}
|
|
1803
|
+
});
|
|
1667
1804
|
Object.defineProperty(exports, "fuseWithEvolution", {
|
|
1668
1805
|
enumerable: true,
|
|
1669
1806
|
get: function() {
|
package/dist/projection.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_cameraFns = require("./cameraFns-
|
|
2
|
+
const require_cameraFns = require("./cameraFns-CR2inEBU.cjs");
|
|
3
3
|
exports.PROJECTION_PLANES = require_cameraFns.PROJECTION_PLANES;
|
|
4
4
|
exports.cameraFromPlane = require_cameraFns.cameraFromPlane;
|
|
5
5
|
exports.cameraLookAt = require_cameraFns.cameraLookAt;
|