brepjs 20.12.6 → 20.12.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/2d/blueprints/booleanHelpers.d.ts +0 -5
- package/dist/2d/blueprints/intersectionSegments.d.ts +6 -5
- package/dist/2d.cjs +6 -6
- package/dist/2d.js +6 -6
- package/dist/{adjacencyFns-BFJfaUwX.cjs → adjacencyFns-BfgFo-Rh.cjs} +3 -3
- package/dist/{adjacencyFns--KmBIKYJ.js → adjacencyFns-Bl109A3Z.js} +3 -3
- package/dist/{blueprint-D83DDDPb.cjs → blueprint-DTDSztfd.cjs} +5 -5
- package/dist/{blueprint-BhIk9Pvm.js → blueprint-RqemOtg5.js} +5 -5
- package/dist/{blueprintFns-eULVgkq9.js → blueprintFns-B9_PhTr8.js} +2 -2
- package/dist/{blueprintFns-C4TQn-x_.cjs → blueprintFns-C7E5R89N.cjs} +2 -2
- package/dist/{blueprintSketcher-D_Faf0GO.js → blueprintSketcher-B15522Kr.js} +3 -3
- package/dist/{blueprintSketcher-Di376t-0.cjs → blueprintSketcher-Brj4lXjj.cjs} +3 -3
- package/dist/{boolean2D-CNZFI_y8.cjs → boolean2D-DZ8aJbI-.cjs} +42 -50
- package/dist/{boolean2D-DqpCF72W.js → boolean2D-_eiIiNw1.js} +42 -50
- package/dist/{solidBuilders-iS5DDwg8.cjs → booleanFns-D5nQ1nWS.cjs} +11 -217
- package/dist/{solidBuilders-DT1gpVWM.js → booleanFns-cNfXGqMX.js} +10 -156
- package/dist/brepjs.cjs +325 -168
- package/dist/brepjs.js +282 -125
- package/dist/{cameraFns-RqraCXIc.cjs → cameraFns-6Er2lhp5.cjs} +3 -3
- package/dist/{cameraFns-CrClIkmV.js → cameraFns-YhB7A_Zc.js} +3 -3
- package/dist/core.cjs +2 -2
- package/dist/core.js +2 -2
- package/dist/{cornerFinder-CdOe1Wrb.cjs → cornerFinder-D9Wx3DWu.cjs} +1 -1
- package/dist/{cornerFinder-BZuQkRp2.js → cornerFinder-G1WkSkVl.js} +1 -1
- package/dist/{curveFns-CyIvQNYT.cjs → curveFns-B5_N-gMj.cjs} +1 -1
- package/dist/{curveFns-BP3srCfK.js → curveFns-C4CqthJp.js} +1 -1
- package/dist/{drawFns-DxDwJ5zZ.js → drawFns-DU5fewKl.js} +12 -12
- package/dist/{drawFns-71cOhWD-.cjs → drawFns-UPbO2heB.cjs} +12 -12
- package/dist/{faceFns-iVPbTxki.js → faceFns-BgRNa5vx.js} +2 -2
- package/dist/{faceFns-B7MiDYj1.cjs → faceFns-C4NOGZBg.cjs} +2 -2
- package/dist/{healingFns-BhP8zfp1.js → healingFns-BzOo0yyz.js} +5 -5
- package/dist/{healingFns-DWljGTNR.cjs → healingFns-i5gV3BMG.cjs} +29 -29
- package/dist/{helpers-DKEVm6Hu.cjs → helpers-DJQeDf_5.cjs} +6 -6
- package/dist/{helpers-D2hANLRu.js → helpers-DPHQt2Kr.js} +6 -6
- package/dist/{importFns-KEPAgbjj.cjs → importFns-BiRpt227.cjs} +319 -14
- package/dist/{importFns-DUzIkns7.js → importFns-CwrJsNvg.js} +314 -15
- package/dist/io/igesSupport.d.ts +6 -0
- package/dist/io/importFns.d.ts +15 -5
- package/dist/io/ioUtils.d.ts +15 -3
- package/dist/io/meshNesting.d.ts +11 -0
- package/dist/io/threemfImportFns.d.ts +6 -3
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
- package/dist/kernel/occtWasm/occtWasmTypes.d.ts +4 -2
- package/dist/{loftFns-D5AvfCGG.cjs → loftFns-DgkK4Kj_.cjs} +1 -1
- package/dist/{loftFns-D5NJpHLZ.js → loftFns-lwzTh1fI.js} +1 -1
- package/dist/{measureFns-CZHNWkiA.cjs → measureFns-D_RRjCZg.cjs} +3 -3
- package/dist/{measureFns-mxBdPiWa.js → measureFns-Q3K25IfN.js} +3 -3
- package/dist/measurement.cjs +2 -2
- package/dist/measurement.js +2 -2
- package/dist/{meshFns-DmjMzNbH.js → meshFns-BGoJU6_P.js} +20 -6
- package/dist/{meshFns-Czlt-GBJ.cjs → meshFns-Djbb4PUC.cjs} +25 -5
- package/dist/{occtWasmAdapter-B9d0Q0Vl.js → occtWasmAdapter-BCCwaYkq.js} +103 -40
- package/dist/{occtWasmAdapter-DVxLkjlJ.cjs → occtWasmAdapter-UcYZRi-w.cjs} +103 -40
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{primitiveFns-BVeBEaa4.cjs → primitiveFns-CfSnex9P.cjs} +19 -18
- package/dist/{primitiveFns-DeNl60Rw.js → primitiveFns-D-aYcwt2.js} +5 -4
- package/dist/{principalBoxFns-3mW_hA6z.js → principalBoxFns-Dcp9gg5e.js} +3 -3
- package/dist/{principalBoxFns-CG6kG7vT.cjs → principalBoxFns-IY8FfPVj.cjs} +3 -3
- 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/{refResolveFns-DHx1Y3GG.js → refResolveFns-BPge7T5w.js} +6 -6
- package/dist/{refResolveFns-BAs4p9z7.cjs → refResolveFns-gZQ1o5XK.cjs} +6 -6
- package/dist/{shapeFns-C0w8vvfb.cjs → shapeFns-Bs92VrZh.cjs} +2 -2
- package/dist/{shapeFns-CgqKICF_.js → shapeFns-TWdr4Dv4.js} +2 -2
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.js +1 -1
- package/dist/{shapeTypes-DwvQUp9M.js → shapeTypes-CIH-8d_a.js} +1 -1
- package/dist/{shapeTypes-Dc7j-MYg.cjs → shapeTypes-DmThK_oa.cjs} +1 -1
- package/dist/sketching.cjs +3 -3
- package/dist/sketching.js +3 -3
- package/dist/{originTrackingFns-CHymOLLm.cjs → solidBuilders-DGskMugU.cjs} +209 -2
- package/dist/{originTrackingFns-CBnyKLm7.js → solidBuilders-q_hwYsdo.js} +150 -3
- package/dist/{surfaceBuilders-CPLe0bbk.js → surfaceBuilders-DXo4N7wQ.js} +3 -3
- package/dist/{surfaceBuilders-BvwSgD3C.cjs → surfaceBuilders-DeSLKg73.cjs} +3 -3
- package/dist/text.cjs +2 -2
- package/dist/text.js +2 -2
- package/dist/{textBlueprints-BU0Rhk54.js → textBlueprints-BYWZho_c.js} +8 -7
- package/dist/{textBlueprints-CNPCPJix.cjs → textBlueprints-Dz6wNgve.cjs} +9 -8
- package/dist/{textMetrics-C71g4TmO.cjs → textMetrics-bKoFTj3m.cjs} +1 -1
- package/dist/{textMetrics-Df9aLYK2.js → textMetrics-k_rGqib2.js} +1 -1
- package/dist/{threadFns-DESH7lcs.js → threadFns-BeB8s0tA.js} +7 -7
- package/dist/{threadFns-CzXEnnmo.cjs → threadFns-CoGAFHHt.cjs} +9 -9
- package/dist/topology/meshFns.d.ts +3 -0
- package/dist/topology.cjs +11 -11
- package/dist/topology.js +9 -9
- package/dist/{topologyQueryFns-5Frx8Y-0.cjs → topologyQueryFns-CXbCFaU2.cjs} +1 -1
- package/dist/{topologyQueryFns-LXV1nTaS.js → topologyQueryFns-Cp0yekBh.js} +1 -1
- package/dist/{validityTypes-DM-Iwe8N.js → validityTypes-DlrWkrSR.js} +1 -1
- package/dist/{validityTypes-C6rROGTP.cjs → validityTypes-m6eLRTYE.cjs} +1 -1
- package/package.json +1 -1
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-DmThK_oa.cjs");
|
|
2
2
|
const require_errors = require("./errors-O_blYTWT.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-CXbCFaU2.cjs");
|
|
4
4
|
const require_constants = require("./constants-oee0S_x6.cjs");
|
|
5
5
|
const require_vecOps = require("./vecOps-CrGEPPQM.cjs");
|
|
6
6
|
const require_planeOps = require("./planeOps-DZfLToKZ.cjs");
|
|
7
|
-
const
|
|
8
|
-
const require_originTrackingFns = require("./originTrackingFns-CHymOLLm.cjs");
|
|
7
|
+
const require_solidBuilders = require("./solidBuilders-DGskMugU.cjs");
|
|
9
8
|
const require_faceRoleFns = require("./faceRoleFns-Db5bYj4Q.cjs");
|
|
10
9
|
const require_arrayAccess = require("./arrayAccess-DpJYARwv.cjs");
|
|
11
|
-
const require_surfaceBuilders = require("./surfaceBuilders-
|
|
10
|
+
const require_surfaceBuilders = require("./surfaceBuilders-DeSLKg73.cjs");
|
|
12
11
|
// src/topology/metadata/faceTagFns.ts
|
|
13
12
|
var shapeTagStore = /* @__PURE__ */ new WeakMap();
|
|
14
13
|
var tagMetadataStore = /* @__PURE__ */ new WeakMap();
|
|
@@ -242,7 +241,7 @@ function propagateColorsFromEvolution(evolution, inputs, result) {
|
|
|
242
241
|
* metadata-preserving slow paths when there's nothing to preserve.
|
|
243
242
|
*/
|
|
244
243
|
function hasAnyMetadata(shape) {
|
|
245
|
-
return
|
|
244
|
+
return require_solidBuilders.getFaceOrigins(shape) !== void 0 || hasFaceTags(shape) || hasColorMetadata(shape) || require_faceRoleFns.hasFaceRoles(shape);
|
|
246
245
|
}
|
|
247
246
|
function collectInputFaceHashes(inputs) {
|
|
248
247
|
if (!inputs.some(hasAnyMetadata)) return [];
|
|
@@ -258,7 +257,7 @@ function collectInputFaceHashes(inputs) {
|
|
|
258
257
|
* `{ shape, evolution }` from a WithHistory kernel method.
|
|
259
258
|
*/
|
|
260
259
|
function propagateAllMetadata(evolution, inputs, result) {
|
|
261
|
-
|
|
260
|
+
require_solidBuilders.propagateOriginsFromEvolution(evolution, inputs, result);
|
|
262
261
|
propagateFaceTagsFromEvolution(evolution, inputs, result);
|
|
263
262
|
propagateColorsFromEvolution(evolution, inputs, result);
|
|
264
263
|
require_faceRoleFns.propagateFaceRolesFromEvolution(evolution, inputs, result);
|
|
@@ -275,7 +274,7 @@ function propagateAllMetadata(evolution, inputs, result) {
|
|
|
275
274
|
* have weaker metadata guarantees than pairwise booleans (`fuse`, `cut`).
|
|
276
275
|
*/
|
|
277
276
|
function propagateMetadataByHash(inputs, result) {
|
|
278
|
-
|
|
277
|
+
require_solidBuilders.propagateOriginsByHash(inputs, result);
|
|
279
278
|
}
|
|
280
279
|
/**
|
|
281
280
|
* Propagate all metadata through a *rigid relocation* (a `locate` re-tag).
|
|
@@ -293,10 +292,10 @@ function propagateMetadataByHash(inputs, result) {
|
|
|
293
292
|
*/
|
|
294
293
|
function propagateMetadataThroughRelocation(source, moved) {
|
|
295
294
|
try {
|
|
296
|
-
var _usingCtx$
|
|
295
|
+
var _usingCtx$1 = require_shapeTypes._usingCtx();
|
|
297
296
|
const kernel = require_shapeTypes.getKernel();
|
|
298
297
|
const faces = [];
|
|
299
|
-
_usingCtx$
|
|
298
|
+
_usingCtx$1.u({ [Symbol.dispose]() {
|
|
300
299
|
const failures = [];
|
|
301
300
|
for (const face of faces) try {
|
|
302
301
|
kernel.dispose(face);
|
|
@@ -333,9 +332,9 @@ function propagateMetadataThroughRelocation(source, moved) {
|
|
|
333
332
|
deleted: /* @__PURE__ */ new Set()
|
|
334
333
|
}, [source], moved);
|
|
335
334
|
} catch (_) {
|
|
336
|
-
_usingCtx$
|
|
335
|
+
_usingCtx$1.e = _;
|
|
337
336
|
} finally {
|
|
338
|
-
_usingCtx$
|
|
337
|
+
_usingCtx$1.d();
|
|
339
338
|
}
|
|
340
339
|
}
|
|
341
340
|
// src/topology/booleanFns.ts
|
|
@@ -863,151 +862,6 @@ function booleanPipelineFallback(base, steps, options) {
|
|
|
863
862
|
}
|
|
864
863
|
return require_errors.ok(current);
|
|
865
864
|
}
|
|
866
|
-
// src/topology/shapeUtils.ts
|
|
867
|
-
/**
|
|
868
|
-
* Shape assembly utilities — welding and sewing operations.
|
|
869
|
-
*/
|
|
870
|
-
/** Sew faces/shells into a single shape using the kernel's sewing algorithm. */
|
|
871
|
-
function weldShapes(facesOrShells) {
|
|
872
|
-
const sewn = require_shapeTypes.getKernel().sew(facesOrShells.map((s) => s.wrapped));
|
|
873
|
-
return require_shapeTypes.castResultShape(sewn);
|
|
874
|
-
}
|
|
875
|
-
/**
|
|
876
|
-
* Welds faces and shells into a single shell.
|
|
877
|
-
*
|
|
878
|
-
* @param facesOrShells - An array of faces and shells to be welded.
|
|
879
|
-
* @param ignoreType - If true, the function will not check if the result is a shell.
|
|
880
|
-
* @returns A shell that contains all the faces and shells.
|
|
881
|
-
*/
|
|
882
|
-
function weldShellsAndFaces(facesOrShells, ignoreType = false) {
|
|
883
|
-
const shell = weldShapes(facesOrShells);
|
|
884
|
-
if (!ignoreType && !require_shapeTypes.isShell(shell)) return require_errors.err(require_errors.typeCastError("WELD_NOT_SHELL", "Could not make a shell from faces and shells"));
|
|
885
|
-
return require_errors.ok(shell);
|
|
886
|
-
}
|
|
887
|
-
// src/topology/solidBuilders.ts
|
|
888
|
-
/**
|
|
889
|
-
* Solid and primitive construction helpers — boxes, cylinders, spheres, cones,
|
|
890
|
-
* tori, ellipsoids, vertices, compounds, and offsets.
|
|
891
|
-
*/
|
|
892
|
-
/**
|
|
893
|
-
* Creates a cylinder with the given radius and height.
|
|
894
|
-
*
|
|
895
|
-
* @category Solids
|
|
896
|
-
*/
|
|
897
|
-
function makeCylinder(radius, height, location = [
|
|
898
|
-
0,
|
|
899
|
-
0,
|
|
900
|
-
0
|
|
901
|
-
], direction = [
|
|
902
|
-
0,
|
|
903
|
-
0,
|
|
904
|
-
1
|
|
905
|
-
]) {
|
|
906
|
-
return require_shapeTypes.createSolid(require_shapeTypes.getKernel().makeCylinder(radius, height, [...location], [...direction]));
|
|
907
|
-
}
|
|
908
|
-
/**
|
|
909
|
-
* Creates a sphere with the given radius.
|
|
910
|
-
*
|
|
911
|
-
* @category Solids
|
|
912
|
-
*/
|
|
913
|
-
function makeSphere(radius) {
|
|
914
|
-
return require_shapeTypes.createSolid(require_shapeTypes.getKernel().makeSphere(radius));
|
|
915
|
-
}
|
|
916
|
-
/**
|
|
917
|
-
* Creates a cone (or frustum) with the given radii and height.
|
|
918
|
-
*
|
|
919
|
-
* @category Solids
|
|
920
|
-
*/
|
|
921
|
-
function makeCone(radius1, radius2, height, location = [
|
|
922
|
-
0,
|
|
923
|
-
0,
|
|
924
|
-
0
|
|
925
|
-
], direction = [
|
|
926
|
-
0,
|
|
927
|
-
0,
|
|
928
|
-
1
|
|
929
|
-
]) {
|
|
930
|
-
return require_shapeTypes.createSolid(require_shapeTypes.getKernel().makeCone(radius1, radius2, height, [...location], [...direction]));
|
|
931
|
-
}
|
|
932
|
-
/**
|
|
933
|
-
* Creates a torus with the given major and minor radii.
|
|
934
|
-
*
|
|
935
|
-
* @category Solids
|
|
936
|
-
*/
|
|
937
|
-
function makeTorus(majorRadius, minorRadius, location = [
|
|
938
|
-
0,
|
|
939
|
-
0,
|
|
940
|
-
0
|
|
941
|
-
], direction = [
|
|
942
|
-
0,
|
|
943
|
-
0,
|
|
944
|
-
1
|
|
945
|
-
]) {
|
|
946
|
-
return require_shapeTypes.createSolid(require_shapeTypes.getKernel().makeTorus(majorRadius, minorRadius, [...location], [...direction]));
|
|
947
|
-
}
|
|
948
|
-
/**
|
|
949
|
-
* Creates an ellipsoid with the given axis lengths.
|
|
950
|
-
*
|
|
951
|
-
* The algorithm creates a unit BSpline sphere surface, transforms its
|
|
952
|
-
* control-point poles with an affinity matrix to match the requested
|
|
953
|
-
* axis half-lengths, then sews the result into a solid.
|
|
954
|
-
*
|
|
955
|
-
* @category Solids
|
|
956
|
-
*/
|
|
957
|
-
function makeEllipsoid(aLength, bLength, cLength) {
|
|
958
|
-
return require_shapeTypes.createSolid(require_shapeTypes.getKernel().makeEllipsoid(aLength, bLength, cLength));
|
|
959
|
-
}
|
|
960
|
-
/** Create a vertex at a 3D point. */
|
|
961
|
-
function makeVertex(point) {
|
|
962
|
-
return require_shapeTypes.createVertex(require_shapeTypes.getKernel().makeVertex(point[0], point[1], point[2]));
|
|
963
|
-
}
|
|
964
|
-
/**
|
|
965
|
-
* Create an offset shape from a face.
|
|
966
|
-
*
|
|
967
|
-
* @param offset - Signed offset distance (positive = outward).
|
|
968
|
-
* @param tolerance - Geometric tolerance for the offset algorithm.
|
|
969
|
-
* @returns An error if the result is not a valid 3D shape.
|
|
970
|
-
*/
|
|
971
|
-
function makeOffset(face, offset, tolerance = 1e-6) {
|
|
972
|
-
const resultShape = require_shapeTypes.getKernel().offset(face.wrapped, offset, tolerance);
|
|
973
|
-
return require_errors.andThen(require_faceFns.downcast(resultShape), (downcasted) => require_errors.andThen(require_faceFns.cast(downcasted), (newShape) => {
|
|
974
|
-
if (!require_shapeTypes.isShape3D(newShape)) return require_errors.err(require_errors.typeCastError("OFFSET_NOT_3D", "Could not offset to a 3d shape"));
|
|
975
|
-
return require_errors.ok(newShape);
|
|
976
|
-
}));
|
|
977
|
-
}
|
|
978
|
-
/**
|
|
979
|
-
* Build a compound from multiple shapes.
|
|
980
|
-
*
|
|
981
|
-
* @param shapeArray - Shapes to group into a single compound.
|
|
982
|
-
* @returns A new Compound containing all input shapes.
|
|
983
|
-
*/
|
|
984
|
-
function makeCompound(shapeArray) {
|
|
985
|
-
return require_shapeTypes.createCompound(require_shapeTypes.getKernel().makeCompound(shapeArray.map((s) => s.wrapped)));
|
|
986
|
-
}
|
|
987
|
-
/**
|
|
988
|
-
* Welds faces and shells into a single shell and then makes a solid.
|
|
989
|
-
*
|
|
990
|
-
* @param facesOrShells - An array of faces and shells to be welded.
|
|
991
|
-
* @returns A solid that contains all the faces and shells.
|
|
992
|
-
*
|
|
993
|
-
* @category Solids
|
|
994
|
-
*/
|
|
995
|
-
function makeSolid(facesOrShells) {
|
|
996
|
-
try {
|
|
997
|
-
var _usingCtx$1 = require_shapeTypes._usingCtx();
|
|
998
|
-
const shell = _usingCtx$1.u(weldShapes(facesOrShells));
|
|
999
|
-
const solid = require_shapeTypes.castResultShape(require_shapeTypes.getKernel().solidFromShell(shell.wrapped));
|
|
1000
|
-
if (!require_shapeTypes.isSolid(solid)) {
|
|
1001
|
-
require_shapeTypes.disposeResultShape(solid);
|
|
1002
|
-
return require_errors.err(require_errors.typeCastError("SOLID_BUILD_FAILED", "Could not make a solid of faces and shells"));
|
|
1003
|
-
}
|
|
1004
|
-
return require_errors.ok(solid);
|
|
1005
|
-
} catch (_) {
|
|
1006
|
-
_usingCtx$1.e = _;
|
|
1007
|
-
} finally {
|
|
1008
|
-
_usingCtx$1.d();
|
|
1009
|
-
}
|
|
1010
|
-
}
|
|
1011
865
|
Object.defineProperty(exports, "booleanPipeline", {
|
|
1012
866
|
enumerable: true,
|
|
1013
867
|
get: function() {
|
|
@@ -1098,60 +952,6 @@ Object.defineProperty(exports, "intersect", {
|
|
|
1098
952
|
return intersect;
|
|
1099
953
|
}
|
|
1100
954
|
});
|
|
1101
|
-
Object.defineProperty(exports, "makeCompound", {
|
|
1102
|
-
enumerable: true,
|
|
1103
|
-
get: function() {
|
|
1104
|
-
return makeCompound;
|
|
1105
|
-
}
|
|
1106
|
-
});
|
|
1107
|
-
Object.defineProperty(exports, "makeCone", {
|
|
1108
|
-
enumerable: true,
|
|
1109
|
-
get: function() {
|
|
1110
|
-
return makeCone;
|
|
1111
|
-
}
|
|
1112
|
-
});
|
|
1113
|
-
Object.defineProperty(exports, "makeCylinder", {
|
|
1114
|
-
enumerable: true,
|
|
1115
|
-
get: function() {
|
|
1116
|
-
return makeCylinder;
|
|
1117
|
-
}
|
|
1118
|
-
});
|
|
1119
|
-
Object.defineProperty(exports, "makeEllipsoid", {
|
|
1120
|
-
enumerable: true,
|
|
1121
|
-
get: function() {
|
|
1122
|
-
return makeEllipsoid;
|
|
1123
|
-
}
|
|
1124
|
-
});
|
|
1125
|
-
Object.defineProperty(exports, "makeOffset", {
|
|
1126
|
-
enumerable: true,
|
|
1127
|
-
get: function() {
|
|
1128
|
-
return makeOffset;
|
|
1129
|
-
}
|
|
1130
|
-
});
|
|
1131
|
-
Object.defineProperty(exports, "makeSolid", {
|
|
1132
|
-
enumerable: true,
|
|
1133
|
-
get: function() {
|
|
1134
|
-
return makeSolid;
|
|
1135
|
-
}
|
|
1136
|
-
});
|
|
1137
|
-
Object.defineProperty(exports, "makeSphere", {
|
|
1138
|
-
enumerable: true,
|
|
1139
|
-
get: function() {
|
|
1140
|
-
return makeSphere;
|
|
1141
|
-
}
|
|
1142
|
-
});
|
|
1143
|
-
Object.defineProperty(exports, "makeTorus", {
|
|
1144
|
-
enumerable: true,
|
|
1145
|
-
get: function() {
|
|
1146
|
-
return makeTorus;
|
|
1147
|
-
}
|
|
1148
|
-
});
|
|
1149
|
-
Object.defineProperty(exports, "makeVertex", {
|
|
1150
|
-
enumerable: true,
|
|
1151
|
-
get: function() {
|
|
1152
|
-
return makeVertex;
|
|
1153
|
-
}
|
|
1154
|
-
});
|
|
1155
955
|
Object.defineProperty(exports, "parseColor", {
|
|
1156
956
|
enumerable: true,
|
|
1157
957
|
get: function() {
|
|
@@ -1212,9 +1012,3 @@ Object.defineProperty(exports, "tagFaces", {
|
|
|
1212
1012
|
return tagFaces;
|
|
1213
1013
|
}
|
|
1214
1014
|
});
|
|
1215
|
-
Object.defineProperty(exports, "weldShellsAndFaces", {
|
|
1216
|
-
enumerable: true,
|
|
1217
|
-
get: function() {
|
|
1218
|
-
return weldShellsAndFaces;
|
|
1219
|
-
}
|
|
1220
|
-
});
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { E as ok, P as unwrap, b as isErr, d as validationError, g as err, i as kernelError, l as typeCastError,
|
|
3
|
-
import { C as subShapeHashes, c as getFaces, f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-
|
|
1
|
+
import { D as getShapeKind, E as GeometryCleanupError, G as _usingCtx, h as disposeResultShape, n as castResultShape, q as getKernel, x as isShape3D } from "./shapeTypes-CIH-8d_a.js";
|
|
2
|
+
import { E as ok, P as unwrap, b as isErr, d as validationError, g as err, i as kernelError, l as typeCastError, t as BrepErrorCode } from "./errors-BTccWbtE.js";
|
|
3
|
+
import { C as subShapeHashes, c as getFaces, f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-Cp0yekBh.js";
|
|
4
4
|
import { n as HASH_CODE_MAX } from "./constants-iraOnb2p.js";
|
|
5
5
|
import { a as vecDot, g as vecSub, h as vecScale, t as vecAdd } from "./vecOps-S-m9H_fe.js";
|
|
6
6
|
import { o as resolvePlane } from "./planeOps-D3yDuMux.js";
|
|
7
|
-
import {
|
|
8
|
-
import { n as propagateOriginsByHash, r as propagateOriginsFromEvolution, t as getFaceOrigins } from "./originTrackingFns-CBnyKLm7.js";
|
|
7
|
+
import { d as getFaceOrigins, f as propagateOriginsByHash, p as propagateOriginsFromEvolution } from "./solidBuilders-q_hwYsdo.js";
|
|
9
8
|
import { n as hasFaceRoles, r as propagateFaceRolesFromEvolution } from "./faceRoleFns-BPxzQF-n.js";
|
|
10
9
|
import { n as getAtOrThrow, t as firstOrThrow } from "./arrayAccess-BpgouNir.js";
|
|
11
|
-
import { r as makeFace } from "./surfaceBuilders-
|
|
10
|
+
import { r as makeFace } from "./surfaceBuilders-DXo4N7wQ.js";
|
|
12
11
|
// src/topology/metadata/faceTagFns.ts
|
|
13
12
|
var shapeTagStore = /* @__PURE__ */ new WeakMap();
|
|
14
13
|
var tagMetadataStore = /* @__PURE__ */ new WeakMap();
|
|
@@ -293,10 +292,10 @@ function propagateMetadataByHash(inputs, result) {
|
|
|
293
292
|
*/
|
|
294
293
|
function propagateMetadataThroughRelocation(source, moved) {
|
|
295
294
|
try {
|
|
296
|
-
var _usingCtx$
|
|
295
|
+
var _usingCtx$1 = _usingCtx();
|
|
297
296
|
const kernel = getKernel();
|
|
298
297
|
const faces = [];
|
|
299
|
-
_usingCtx$
|
|
298
|
+
_usingCtx$1.u({ [Symbol.dispose]() {
|
|
300
299
|
const failures = [];
|
|
301
300
|
for (const face of faces) try {
|
|
302
301
|
kernel.dispose(face);
|
|
@@ -333,9 +332,9 @@ function propagateMetadataThroughRelocation(source, moved) {
|
|
|
333
332
|
deleted: /* @__PURE__ */ new Set()
|
|
334
333
|
}, [source], moved);
|
|
335
334
|
} catch (_) {
|
|
336
|
-
_usingCtx$
|
|
335
|
+
_usingCtx$1.e = _;
|
|
337
336
|
} finally {
|
|
338
|
-
_usingCtx$
|
|
337
|
+
_usingCtx$1.d();
|
|
339
338
|
}
|
|
340
339
|
}
|
|
341
340
|
// src/topology/booleanFns.ts
|
|
@@ -863,149 +862,4 @@ function booleanPipelineFallback(base, steps, options) {
|
|
|
863
862
|
}
|
|
864
863
|
return ok(current);
|
|
865
864
|
}
|
|
866
|
-
|
|
867
|
-
/**
|
|
868
|
-
* Shape assembly utilities — welding and sewing operations.
|
|
869
|
-
*/
|
|
870
|
-
/** Sew faces/shells into a single shape using the kernel's sewing algorithm. */
|
|
871
|
-
function weldShapes(facesOrShells) {
|
|
872
|
-
const sewn = getKernel().sew(facesOrShells.map((s) => s.wrapped));
|
|
873
|
-
return castResultShape(sewn);
|
|
874
|
-
}
|
|
875
|
-
/**
|
|
876
|
-
* Welds faces and shells into a single shell.
|
|
877
|
-
*
|
|
878
|
-
* @param facesOrShells - An array of faces and shells to be welded.
|
|
879
|
-
* @param ignoreType - If true, the function will not check if the result is a shell.
|
|
880
|
-
* @returns A shell that contains all the faces and shells.
|
|
881
|
-
*/
|
|
882
|
-
function weldShellsAndFaces(facesOrShells, ignoreType = false) {
|
|
883
|
-
const shell = weldShapes(facesOrShells);
|
|
884
|
-
if (!ignoreType && !isShell(shell)) return err(typeCastError("WELD_NOT_SHELL", "Could not make a shell from faces and shells"));
|
|
885
|
-
return ok(shell);
|
|
886
|
-
}
|
|
887
|
-
// src/topology/solidBuilders.ts
|
|
888
|
-
/**
|
|
889
|
-
* Solid and primitive construction helpers — boxes, cylinders, spheres, cones,
|
|
890
|
-
* tori, ellipsoids, vertices, compounds, and offsets.
|
|
891
|
-
*/
|
|
892
|
-
/**
|
|
893
|
-
* Creates a cylinder with the given radius and height.
|
|
894
|
-
*
|
|
895
|
-
* @category Solids
|
|
896
|
-
*/
|
|
897
|
-
function makeCylinder(radius, height, location = [
|
|
898
|
-
0,
|
|
899
|
-
0,
|
|
900
|
-
0
|
|
901
|
-
], direction = [
|
|
902
|
-
0,
|
|
903
|
-
0,
|
|
904
|
-
1
|
|
905
|
-
]) {
|
|
906
|
-
return createSolid(getKernel().makeCylinder(radius, height, [...location], [...direction]));
|
|
907
|
-
}
|
|
908
|
-
/**
|
|
909
|
-
* Creates a sphere with the given radius.
|
|
910
|
-
*
|
|
911
|
-
* @category Solids
|
|
912
|
-
*/
|
|
913
|
-
function makeSphere(radius) {
|
|
914
|
-
return createSolid(getKernel().makeSphere(radius));
|
|
915
|
-
}
|
|
916
|
-
/**
|
|
917
|
-
* Creates a cone (or frustum) with the given radii and height.
|
|
918
|
-
*
|
|
919
|
-
* @category Solids
|
|
920
|
-
*/
|
|
921
|
-
function makeCone(radius1, radius2, height, location = [
|
|
922
|
-
0,
|
|
923
|
-
0,
|
|
924
|
-
0
|
|
925
|
-
], direction = [
|
|
926
|
-
0,
|
|
927
|
-
0,
|
|
928
|
-
1
|
|
929
|
-
]) {
|
|
930
|
-
return createSolid(getKernel().makeCone(radius1, radius2, height, [...location], [...direction]));
|
|
931
|
-
}
|
|
932
|
-
/**
|
|
933
|
-
* Creates a torus with the given major and minor radii.
|
|
934
|
-
*
|
|
935
|
-
* @category Solids
|
|
936
|
-
*/
|
|
937
|
-
function makeTorus(majorRadius, minorRadius, location = [
|
|
938
|
-
0,
|
|
939
|
-
0,
|
|
940
|
-
0
|
|
941
|
-
], direction = [
|
|
942
|
-
0,
|
|
943
|
-
0,
|
|
944
|
-
1
|
|
945
|
-
]) {
|
|
946
|
-
return createSolid(getKernel().makeTorus(majorRadius, minorRadius, [...location], [...direction]));
|
|
947
|
-
}
|
|
948
|
-
/**
|
|
949
|
-
* Creates an ellipsoid with the given axis lengths.
|
|
950
|
-
*
|
|
951
|
-
* The algorithm creates a unit BSpline sphere surface, transforms its
|
|
952
|
-
* control-point poles with an affinity matrix to match the requested
|
|
953
|
-
* axis half-lengths, then sews the result into a solid.
|
|
954
|
-
*
|
|
955
|
-
* @category Solids
|
|
956
|
-
*/
|
|
957
|
-
function makeEllipsoid(aLength, bLength, cLength) {
|
|
958
|
-
return createSolid(getKernel().makeEllipsoid(aLength, bLength, cLength));
|
|
959
|
-
}
|
|
960
|
-
/** Create a vertex at a 3D point. */
|
|
961
|
-
function makeVertex(point) {
|
|
962
|
-
return createVertex(getKernel().makeVertex(point[0], point[1], point[2]));
|
|
963
|
-
}
|
|
964
|
-
/**
|
|
965
|
-
* Create an offset shape from a face.
|
|
966
|
-
*
|
|
967
|
-
* @param offset - Signed offset distance (positive = outward).
|
|
968
|
-
* @param tolerance - Geometric tolerance for the offset algorithm.
|
|
969
|
-
* @returns An error if the result is not a valid 3D shape.
|
|
970
|
-
*/
|
|
971
|
-
function makeOffset(face, offset, tolerance = 1e-6) {
|
|
972
|
-
const resultShape = getKernel().offset(face.wrapped, offset, tolerance);
|
|
973
|
-
return andThen(downcast(resultShape), (downcasted) => andThen(cast(downcasted), (newShape) => {
|
|
974
|
-
if (!isShape3D(newShape)) return err(typeCastError("OFFSET_NOT_3D", "Could not offset to a 3d shape"));
|
|
975
|
-
return ok(newShape);
|
|
976
|
-
}));
|
|
977
|
-
}
|
|
978
|
-
/**
|
|
979
|
-
* Build a compound from multiple shapes.
|
|
980
|
-
*
|
|
981
|
-
* @param shapeArray - Shapes to group into a single compound.
|
|
982
|
-
* @returns A new Compound containing all input shapes.
|
|
983
|
-
*/
|
|
984
|
-
function makeCompound(shapeArray) {
|
|
985
|
-
return createCompound(getKernel().makeCompound(shapeArray.map((s) => s.wrapped)));
|
|
986
|
-
}
|
|
987
|
-
/**
|
|
988
|
-
* Welds faces and shells into a single shell and then makes a solid.
|
|
989
|
-
*
|
|
990
|
-
* @param facesOrShells - An array of faces and shells to be welded.
|
|
991
|
-
* @returns A solid that contains all the faces and shells.
|
|
992
|
-
*
|
|
993
|
-
* @category Solids
|
|
994
|
-
*/
|
|
995
|
-
function makeSolid(facesOrShells) {
|
|
996
|
-
try {
|
|
997
|
-
var _usingCtx$1 = _usingCtx();
|
|
998
|
-
const shell = _usingCtx$1.u(weldShapes(facesOrShells));
|
|
999
|
-
const solid = castResultShape(getKernel().solidFromShell(shell.wrapped));
|
|
1000
|
-
if (!isSolid(solid)) {
|
|
1001
|
-
disposeResultShape(solid);
|
|
1002
|
-
return err(typeCastError("SOLID_BUILD_FAILED", "Could not make a solid of faces and shells"));
|
|
1003
|
-
}
|
|
1004
|
-
return ok(solid);
|
|
1005
|
-
} catch (_) {
|
|
1006
|
-
_usingCtx$1.e = _;
|
|
1007
|
-
} finally {
|
|
1008
|
-
_usingCtx$1.d();
|
|
1009
|
-
}
|
|
1010
|
-
}
|
|
1011
|
-
export { parseColor as A, propagateAllMetadata as C, colorShape as D, colorFaces as E, tagFaces as F, getFaceTags as M, getTagMetadata as N, getFaceColor as O, setTagMetadata as P, hasAnyMetadata as S, propagateMetadataThroughRelocation as T, section as _, makeOffset as a, split as b, makeTorus as c, booleanPipeline as d, cut as f, intersect as g, fuseAll as h, makeEllipsoid as i, findFacesByTag as j, getShapeColor as k, makeVertex as l, fuse as m, makeCone as n, makeSolid as o, cutAll as p, makeCylinder as r, makeSphere as s, makeCompound as t, weldShellsAndFaces as u, sectionToFace as v, propagateMetadataByHash as w, collectInputFaceHashes as x, slice as y };
|
|
865
|
+
export { getTagMetadata as C, getFaceTags as S, tagFaces as T, colorShape as _, fuseAll as a, parseColor as b, sectionToFace as c, collectInputFaceHashes as d, hasAnyMetadata as f, colorFaces as g, propagateMetadataThroughRelocation as h, fuse as i, slice as l, propagateMetadataByHash as m, cut as n, intersect as o, propagateAllMetadata as p, cutAll as r, section as s, booleanPipeline as t, split as u, getFaceColor as v, setTagMetadata as w, findFacesByTag as x, getShapeColor as y };
|