brepjs 18.119.2 → 18.119.3

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.
Files changed (96) hide show
  1. package/dist/2d/lib/curve2D.d.ts +6 -1
  2. package/dist/2d/lib/curve2dFns.d.ts +6 -1
  3. package/dist/2d.cjs +7 -7
  4. package/dist/2d.js +7 -7
  5. package/dist/{adjacencyFns-BdM5p58J.js → adjacencyFns-DLityMyV.js} +2 -2
  6. package/dist/{adjacencyFns-Brrc7jlS.cjs → adjacencyFns-DSxuQYnb.cjs} +2 -2
  7. package/dist/{blueprint-DTNT4qYJ.cjs → blueprint-BGcBMy3b.cjs} +39 -9
  8. package/dist/{blueprint-DJJo8WkI.js → blueprint-CAG6jseD.js} +33 -9
  9. package/dist/{blueprintFns-CcpboZ80.js → blueprintFns-B4C3zH7N.js} +9 -4
  10. package/dist/{blueprintFns-2XDZfCxX.cjs → blueprintFns-CnoqynzI.cjs} +9 -4
  11. package/dist/{blueprintSketcher-C0EXFVb2.cjs → blueprintSketcher-BNz6f36D.cjs} +166 -61
  12. package/dist/{blueprintSketcher-DDPyypmC.js → blueprintSketcher-CKKxvxB-.js} +159 -54
  13. package/dist/{boolean2D-Ddfo_dd0.cjs → boolean2D-B-0xobBP.cjs} +5 -5
  14. package/dist/{boolean2D-C_PVz8xT.js → boolean2D-C_1gMcZ6.js} +5 -5
  15. package/dist/brepjs.cjs +105 -92
  16. package/dist/brepjs.js +39 -27
  17. package/dist/{cameraFns-Czr5vABD.cjs → cameraFns-2-haLzLi.cjs} +4 -4
  18. package/dist/{cameraFns-D9tdBYLM.js → cameraFns-CG_J66Hl.js} +4 -4
  19. package/dist/core.cjs +12 -11
  20. package/dist/core.js +4 -3
  21. package/dist/{cornerFinder-Cqg-Dz74.js → cornerFinder-CPFM7bA0.js} +1 -1
  22. package/dist/{cornerFinder-DETRDOMz.cjs → cornerFinder-mfsUMi5g.cjs} +1 -1
  23. package/dist/{curveFns-RENXKp64.js → curveFns-DX13KRh2.js} +2 -2
  24. package/dist/{curveFns-D7utcbnf.cjs → curveFns-GmFnqNo3.cjs} +2 -2
  25. package/dist/{drawFns-D9Rf4foW.cjs → drawFns-B14M5M68.cjs} +14 -14
  26. package/dist/{drawFns-B9HbtAoc.js → drawFns-BShGVVXW.js} +14 -14
  27. package/dist/{errors-B3CDG537.js → errors-MHLiNE-C.js} +1 -92
  28. package/dist/{errors-CJU8CHng.cjs → errors-RHkKO5bZ.cjs} +0 -103
  29. package/dist/{faceFns-CPswi9Cm.cjs → faceFns-BK4r7Dxk.cjs} +3 -3
  30. package/dist/{faceFns-CB6uzvOg.js → faceFns-DJj9Nb6T.js} +3 -3
  31. package/dist/{healingFns-BFTYLiAm.js → healingFns-DxcRyVCG.js} +5 -6
  32. package/dist/{healingFns-bhMxTTqw.cjs → healingFns-Hx4oTlq8.cjs} +27 -28
  33. package/dist/{helpers-Cu4ag5bh.cjs → helpers-BfkBvokP.cjs} +8 -24
  34. package/dist/{helpers-BiN4qQZP.js → helpers-Du_OdHuy.js} +9 -25
  35. package/dist/{importFns-X8vBhZI2.js → importFns-BHs19muu.js} +3 -3
  36. package/dist/{importFns-DS4J1xLv.cjs → importFns-GySbuvVv.cjs} +3 -3
  37. package/dist/io.cjs +2 -2
  38. package/dist/io.js +2 -2
  39. package/dist/{loftFns-ChHjzUK-.cjs → loftFns-BdpZ8FMN.cjs} +2 -125
  40. package/dist/{loftFns-BF5X7ltI.js → loftFns-BeGJ6dxx.js} +4 -109
  41. package/dist/{measureFns-B5Zzg1qM.cjs → measureFns-CJGrmhHT.cjs} +4 -4
  42. package/dist/{measureFns-CC7HhAH3.js → measureFns-CMnbcUZC.js} +4 -4
  43. package/dist/measurement.cjs +1 -1
  44. package/dist/measurement.js +1 -1
  45. package/dist/{meshFns-D57Fyqyf.js → meshFns-Cs5EBsf7.js} +4 -4
  46. package/dist/{meshFns-CaXmWmhe.cjs → meshFns-Dqf5QBhQ.cjs} +5 -5
  47. package/dist/operations.cjs +2 -2
  48. package/dist/operations.js +2 -2
  49. package/dist/originTrackingFns-DZmdiQ-O.js +203 -0
  50. package/dist/originTrackingFns-fpEgTIwV.cjs +226 -0
  51. package/dist/{planeOps-Cp6GQ23-.js → planeOps-CQahLrCx.js} +1 -1
  52. package/dist/{planeOps-Cr25KWWA.cjs → planeOps-VlFxtvzY.cjs} +1 -1
  53. package/dist/primitiveFns-B_rflH83.cjs +773 -0
  54. package/dist/primitiveFns-Cxo3xDKY.js +558 -0
  55. package/dist/projection.cjs +1 -1
  56. package/dist/projection.js +1 -1
  57. package/dist/query.cjs +2 -2
  58. package/dist/query.js +2 -2
  59. package/dist/{refResolveFns-3bw9-U-e.js → refResolveFns-BbRLD8LA.js} +6 -6
  60. package/dist/{refResolveFns-BxmgIhQM.cjs → refResolveFns-CVDLwh12.cjs} +6 -6
  61. package/dist/result.cjs +1 -1
  62. package/dist/result.js +1 -1
  63. package/dist/rolldown-runtime-DakpK96I.cjs +43 -0
  64. package/dist/shapeFns-BTFx-os7.js +43 -0
  65. package/dist/shapeFns-D_5TgiUi.cjs +84 -0
  66. package/dist/shapeRef.cjs +1 -1
  67. package/dist/shapeRef.js +1 -1
  68. package/dist/{shapeTypes-Bpsu5KJO.cjs → shapeTypes-CkcIL7zv.cjs} +1 -222
  69. package/dist/{shapeTypes-CnKFSfDT.js → shapeTypes-t49f64Dx.js} +2 -139
  70. package/dist/sketching.cjs +3 -3
  71. package/dist/sketching.js +3 -3
  72. package/dist/{solidBuilders-I8_V8qqU.js → solidBuilders-DTgqQC3W.js} +310 -8
  73. package/dist/{solidBuilders-Bp7lQW62.cjs → solidBuilders-IiIzjKAr.cjs} +401 -15
  74. package/dist/{surfaceBuilders-D8_08oOR.cjs → surfaceBuilders-Biqx51el.cjs} +6 -5
  75. package/dist/{surfaceBuilders-BNR7yMQO.js → surfaceBuilders-BryY-i0F.js} +4 -3
  76. package/dist/text.cjs +2 -2
  77. package/dist/text.js +2 -2
  78. package/dist/{textBlueprints-B5zcLGvJ.cjs → textBlueprints-8EcWreab.cjs} +138 -51
  79. package/dist/{textBlueprints-igbNvKcd.js → textBlueprints-rA1HT6j1.js} +116 -11
  80. package/dist/{textMetrics-CJvtpbc3.js → textMetrics-Bcbso1Ns.js} +2 -2
  81. package/dist/{textMetrics-08fF0QNf.cjs → textMetrics-GPBu9JKi.cjs} +2 -2
  82. package/dist/{threadFns-CqSMNyTZ.js → threadFns-BOtXTHZ9.js} +8 -8
  83. package/dist/{threadFns-Co6vWEWx.cjs → threadFns-DRrk9Qod.cjs} +8 -8
  84. package/dist/topology.cjs +9 -9
  85. package/dist/topology.js +9 -9
  86. package/dist/{topologyQueryFns-C3fhJndG.cjs → topologyQueryFns-Bia7o8l_.cjs} +97 -6
  87. package/dist/{topologyQueryFns-DNqT88yx.js → topologyQueryFns-BkQ6Q7gN.js} +93 -2
  88. package/dist/validityTypes-DiTgeCD9.js +129 -0
  89. package/dist/validityTypes-ZGMVlv7b.cjs +200 -0
  90. package/dist/vectors.cjs +1 -1
  91. package/dist/vectors.js +1 -1
  92. package/package.json +8 -8
  93. package/dist/primitiveFns-CRy_CUVg.cjs +0 -492
  94. package/dist/primitiveFns-DCIH-SBm.js +0 -331
  95. package/dist/shapeFns-BrHFNLMA.js +0 -771
  96. package/dist/shapeFns-qm9VRo4i.cjs +0 -962
@@ -0,0 +1,43 @@
1
+ import { K as getKernel } from "./shapeTypes-t49f64Dx.js";
2
+ import { t as BrepErrorCode } from "./errors-MHLiNE-C.js";
3
+ import { T as kernelCallRaw, w as kernelCall } from "./topologyQueryFns-BkQ6Q7gN.js";
4
+ import { n as HASH_CODE_MAX } from "./constants-ITRzCnCp.js";
5
+ //#region src/topology/shapeFns.ts
6
+ /**
7
+ * Shape identity, introspection, and serialization functions.
8
+ *
9
+ * Re-exports from focused modules for backward compatibility:
10
+ * - Transform functions from `./transformFns.js`
11
+ * - Topology query functions from `./topologyQueryFns.js`
12
+ * - Origin tracking functions from `./metadata/originTrackingFns.js`
13
+ */
14
+ /** Clone a shape (an independently-disposable deep copy). */
15
+ function clone(shape) {
16
+ return kernelCall(() => getKernel().copyShape(shape.wrapped), BrepErrorCode.CLONE_FAILED, "Failed to clone shape");
17
+ }
18
+ /** Serialize a shape to BREP string format. */
19
+ function toBREP(shape) {
20
+ return kernelCallRaw(() => getKernel().toBREP(shape.wrapped), BrepErrorCode.TO_BREP_FAILED, "Failed to serialize shape to BREP");
21
+ }
22
+ /** Get the topology hash code of a shape. */
23
+ function getHashCode(shape) {
24
+ return getKernel().hashCode(shape.wrapped, HASH_CODE_MAX);
25
+ }
26
+ /** Check if a shape is null. */
27
+ function isEmpty(shape) {
28
+ return getKernel().isNull(shape.wrapped);
29
+ }
30
+ /** Check if two shapes are the same topological entity. */
31
+ function isSameShape(a, b) {
32
+ return getKernel().isSame(a.wrapped, b.wrapped);
33
+ }
34
+ /** Check if two shapes are geometrically equal. */
35
+ function isEqualShape(a, b) {
36
+ return getKernel().isEqual(a.wrapped, b.wrapped);
37
+ }
38
+ /** Simplify a shape by merging same-domain faces/edges. Returns a new shape. */
39
+ function simplify(shape) {
40
+ return kernelCall(() => getKernel().simplify(shape.wrapped), BrepErrorCode.SIMPLIFY_FAILED, "Failed to simplify shape");
41
+ }
42
+ //#endregion
43
+ export { isSameShape as a, isEqualShape as i, getHashCode as n, simplify as o, isEmpty as r, toBREP as s, clone as t };
@@ -0,0 +1,84 @@
1
+ const require_shapeTypes = require("./shapeTypes-CkcIL7zv.cjs");
2
+ const require_errors = require("./errors-RHkKO5bZ.cjs");
3
+ const require_topologyQueryFns = require("./topologyQueryFns-Bia7o8l_.cjs");
4
+ const require_constants = require("./constants-BOVyEYGH.cjs");
5
+ //#region src/topology/shapeFns.ts
6
+ /**
7
+ * Shape identity, introspection, and serialization functions.
8
+ *
9
+ * Re-exports from focused modules for backward compatibility:
10
+ * - Transform functions from `./transformFns.js`
11
+ * - Topology query functions from `./topologyQueryFns.js`
12
+ * - Origin tracking functions from `./metadata/originTrackingFns.js`
13
+ */
14
+ /** Clone a shape (an independently-disposable deep copy). */
15
+ function clone(shape) {
16
+ return require_topologyQueryFns.kernelCall(() => require_shapeTypes.getKernel().copyShape(shape.wrapped), require_errors.BrepErrorCode.CLONE_FAILED, "Failed to clone shape");
17
+ }
18
+ /** Serialize a shape to BREP string format. */
19
+ function toBREP(shape) {
20
+ return require_topologyQueryFns.kernelCallRaw(() => require_shapeTypes.getKernel().toBREP(shape.wrapped), require_errors.BrepErrorCode.TO_BREP_FAILED, "Failed to serialize shape to BREP");
21
+ }
22
+ /** Get the topology hash code of a shape. */
23
+ function getHashCode(shape) {
24
+ return require_shapeTypes.getKernel().hashCode(shape.wrapped, require_constants.HASH_CODE_MAX);
25
+ }
26
+ /** Check if a shape is null. */
27
+ function isEmpty(shape) {
28
+ return require_shapeTypes.getKernel().isNull(shape.wrapped);
29
+ }
30
+ /** Check if two shapes are the same topological entity. */
31
+ function isSameShape(a, b) {
32
+ return require_shapeTypes.getKernel().isSame(a.wrapped, b.wrapped);
33
+ }
34
+ /** Check if two shapes are geometrically equal. */
35
+ function isEqualShape(a, b) {
36
+ return require_shapeTypes.getKernel().isEqual(a.wrapped, b.wrapped);
37
+ }
38
+ /** Simplify a shape by merging same-domain faces/edges. Returns a new shape. */
39
+ function simplify(shape) {
40
+ return require_topologyQueryFns.kernelCall(() => require_shapeTypes.getKernel().simplify(shape.wrapped), require_errors.BrepErrorCode.SIMPLIFY_FAILED, "Failed to simplify shape");
41
+ }
42
+ //#endregion
43
+ Object.defineProperty(exports, "clone", {
44
+ enumerable: true,
45
+ get: function() {
46
+ return clone;
47
+ }
48
+ });
49
+ Object.defineProperty(exports, "getHashCode", {
50
+ enumerable: true,
51
+ get: function() {
52
+ return getHashCode;
53
+ }
54
+ });
55
+ Object.defineProperty(exports, "isEmpty", {
56
+ enumerable: true,
57
+ get: function() {
58
+ return isEmpty;
59
+ }
60
+ });
61
+ Object.defineProperty(exports, "isEqualShape", {
62
+ enumerable: true,
63
+ get: function() {
64
+ return isEqualShape;
65
+ }
66
+ });
67
+ Object.defineProperty(exports, "isSameShape", {
68
+ enumerable: true,
69
+ get: function() {
70
+ return isSameShape;
71
+ }
72
+ });
73
+ Object.defineProperty(exports, "simplify", {
74
+ enumerable: true,
75
+ get: function() {
76
+ return simplify;
77
+ }
78
+ });
79
+ Object.defineProperty(exports, "toBREP", {
80
+ enumerable: true,
81
+ get: function() {
82
+ return toBREP;
83
+ }
84
+ });
package/dist/shapeRef.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_refResolveFns = require("./refResolveFns-BxmgIhQM.cjs");
2
+ const require_refResolveFns = require("./refResolveFns-CVDLwh12.cjs");
3
3
  exports.assignRoles = require_refResolveFns.assignRoles;
4
4
  exports.captureHint = require_refResolveFns.captureHint;
5
5
  exports.createDerivedFaceRef = require_refResolveFns.createDerivedFaceRef;
package/dist/shapeRef.js CHANGED
@@ -1,2 +1,2 @@
1
- import { _ as createRef, a as isVertexRef, b as defaultScorer, c as resolveRefParams, d as createVertexRef, f as resolveVertexRef, g as captureHint, h as assignRoles, i as isLineageRef, l as createDerivedFaceRef, m as resolveEdgeRef, n as isEdgeRef, o as resolveLineageRef, p as createEdgeRef, r as isFaceRef, s as resolveRefIn, t as isDerivedFaceRef, u as resolveDerivedFaceRef, v as resolveRef, y as updateRoles } from "./refResolveFns-3bw9-U-e.js";
1
+ import { _ as createRef, a as isVertexRef, b as defaultScorer, c as resolveRefParams, d as createVertexRef, f as resolveVertexRef, g as captureHint, h as assignRoles, i as isLineageRef, l as createDerivedFaceRef, m as resolveEdgeRef, n as isEdgeRef, o as resolveLineageRef, p as createEdgeRef, r as isFaceRef, s as resolveRefIn, t as isDerivedFaceRef, u as resolveDerivedFaceRef, v as resolveRef, y as updateRoles } from "./refResolveFns-BbRLD8LA.js";
2
2
  export { assignRoles, captureHint, createDerivedFaceRef, createEdgeRef, createRef, createVertexRef, defaultScorer, isDerivedFaceRef, isEdgeRef, isFaceRef, isLineageRef, isVertexRef, resolveDerivedFaceRef, resolveEdgeRef, resolveLineageRef, resolveRef, resolveRefIn, resolveRefParams, resolveVertexRef, updateRoles };
@@ -1,6 +1,5 @@
1
1
  const require_occtWasmAdapter = require("./occtWasmAdapter-BAzyxAJw.cjs");
2
2
  const require_bug = require("./bug-O02CsAmt.cjs");
3
- const require_errors = require("./errors-CJU8CHng.cjs");
4
3
  //#region src/kernel/quality.ts
5
4
  /**
6
5
  * Extract-time deflection per level. `'standard'` matches brepjs's historical
@@ -15342,16 +15341,6 @@ function importOptionalBackend(specifier) {
15342
15341
  );
15343
15342
  }
15344
15343
  //#endregion
15345
- //#region src/kernel/types.ts
15346
- /** Check if the kernel supports hidden-line-removal projection. */
15347
- function supportsProjection(kernel) {
15348
- return "projectEdges" in kernel;
15349
- }
15350
- /** Check if the kernel supports 2D constraint sketch solving. */
15351
- function supportsConstraintSketch(kernel) {
15352
- return "sketchNew" in kernel && "sketchDof" in kernel;
15353
- }
15354
- //#endregion
15355
15344
  //#region src/kernel/index.ts
15356
15345
  var _kernels = /* @__PURE__ */ new Map();
15357
15346
  var _defaultKernelId = null;
@@ -15542,7 +15531,7 @@ async function init() {
15542
15531
  throw new Error("brepjs: no kernel package found. Install one of:\n npm install occt-wasm (recommended, default)\n npm install brepjs-opencascade\n npm install brepkit-wasm");
15543
15532
  }
15544
15533
  //#endregion
15545
- //#region \0@oxc-project+runtime@0.138.0/helpers/esm/usingCtx.js
15534
+ //#region \0@oxc-project+runtime@0.139.0/helpers/esm/usingCtx.js
15546
15535
  function _usingCtx() {
15547
15536
  var r = "function" == typeof SuppressedError ? SuppressedError : function(r, e) {
15548
15537
  var n = Error();
@@ -15950,132 +15939,6 @@ function getShapeKind(shape) {
15950
15939
  return getOrQueryType(getKernel(), shape.wrapped);
15951
15940
  }
15952
15941
  //#endregion
15953
- //#region src/core/validityTypes.ts
15954
- /**
15955
- * Type guard — check if a wire is closed (forms a loop).
15956
- * Uses the kernel's `curveIsClosed` to verify at runtime.
15957
- */
15958
- function isClosedWire(wire) {
15959
- return getKernel().curveIsClosed(wire.wrapped);
15960
- }
15961
- /**
15962
- * Type guard — check if a face is valid and thus safe to use in operations.
15963
- *
15964
- * Uses kernel validity (BRepCheck_Analyzer) which verifies geometric and
15965
- * topological correctness. Faces produced by kernel operations (makeFace,
15966
- * extrude, revolve, boolean ops) are oriented by construction. For faces
15967
- * from STEP/IGES imports or external sources, validity does not guarantee
15968
- * consistent normal orientation — use with caution or re-orient first.
15969
- */
15970
- function isOrientedFace(face) {
15971
- return getKernel().isValid(face.wrapped);
15972
- }
15973
- /**
15974
- * Type guard — check if a shell is manifold (watertight, no dangling faces).
15975
- * Checks kernel validity, then attempts `solidFromShell` — if the shell
15976
- * can form a valid solid, it is manifold by definition.
15977
- *
15978
- * The temporary solid created for the proof is disposed immediately to avoid
15979
- * WASM memory leaks.
15980
- */
15981
- function isManifoldShell(shell) {
15982
- const kernel = getKernel();
15983
- if (!kernel.isValid(shell.wrapped)) return false;
15984
- const validate = kernel.isValidStrict?.bind(kernel) ?? kernel.isValid.bind(kernel);
15985
- try {
15986
- const solid = kernel.solidFromShell(shell.wrapped);
15987
- const valid = validate(solid);
15988
- try {
15989
- kernel.dispose(solid);
15990
- } catch {}
15991
- return valid;
15992
- } catch {
15993
- return false;
15994
- }
15995
- }
15996
- /**
15997
- * Type guard — check if a solid passes BRepCheck validation.
15998
- */
15999
- function isValidSolid(solid) {
16000
- return getKernel().isValid(solid.wrapped);
16001
- }
16002
- /**
16003
- * Prove that a wire is closed, returning a branded `ClosedWire` on success.
16004
- * This is the primary smart constructor for `ClosedWire`.
16005
- *
16006
- * @example
16007
- * ```ts
16008
- * const w = wire([e1, e2, e3]);
16009
- * const closed = closedWire(unwrap(w));
16010
- * if (isOk(closed)) {
16011
- * const f = face(closed.value); // ClosedWire accepted
16012
- * }
16013
- * ```
16014
- */
16015
- function closedWire(wire) {
16016
- if (isClosedWire(wire)) return require_errors.ok(wire);
16017
- return require_errors.err("Wire is not closed: start and end points do not coincide");
16018
- }
16019
- /**
16020
- * Prove that a face is oriented, returning a branded `OrientedFace` on success.
16021
- */
16022
- function orientedFace(face) {
16023
- if (isOrientedFace(face)) return require_errors.ok(face);
16024
- return require_errors.err("Face orientation is inconsistent or face is invalid");
16025
- }
16026
- /**
16027
- * Prove that a shell is manifold, returning a branded `ManifoldShell` on success.
16028
- */
16029
- function manifoldShell(shell) {
16030
- if (isManifoldShell(shell)) return require_errors.ok(shell);
16031
- return require_errors.err("Shell is not manifold: has free edges or is invalid");
16032
- }
16033
- /**
16034
- * Prove that a solid is valid, returning a branded `ValidSolid` on success.
16035
- */
16036
- function validSolid(solid) {
16037
- if (isValidSolid(solid)) return require_errors.ok(solid);
16038
- return require_errors.err("Solid failed BRepCheck validation");
16039
- }
16040
- /** Type guard — check if a face is planar (underlying surface is a plane). */
16041
- function isPlanarFace(face) {
16042
- return getKernel().surfaceType(face.wrapped) === "plane";
16043
- }
16044
- /**
16045
- * Type guard — check if a wire is planar (all edges lie in a common plane).
16046
- * Strategy: try planar-only face construction first (fast path on OCCT — throws
16047
- * for non-planar wires). If that succeeds, verify the surface type. If it
16048
- * fails, fall back to general mode and check whether the resulting surface is
16049
- * a plane. This handles kernel-specific differences in the planar flag.
16050
- */
16051
- function isPlanarWire(wire) {
16052
- const kernel = getKernel();
16053
- const checkFace = (onlyPlane) => {
16054
- try {
16055
- const tempFace = kernel.makeFace(wire.wrapped, onlyPlane);
16056
- const stype = kernel.surfaceType(tempFace);
16057
- try {
16058
- kernel.dispose(tempFace);
16059
- } catch {}
16060
- return stype === "plane";
16061
- } catch {
16062
- return false;
16063
- }
16064
- };
16065
- if (checkFace(true)) return true;
16066
- return checkFace(false);
16067
- }
16068
- /** Prove that a face is planar, returning a branded `PlanarFace` on success. */
16069
- function planarFace(face) {
16070
- if (isPlanarFace(face)) return require_errors.ok(face);
16071
- return require_errors.err("Face is not planar: underlying surface is not a geometric plane");
16072
- }
16073
- /** Prove that a wire is planar, returning a branded `PlanarWire` on success. */
16074
- function planarWire(wire) {
16075
- if (isPlanarWire(wire)) return require_errors.ok(wire);
16076
- return require_errors.err("Wire is not planar: edges do not lie in a common plane");
16077
- }
16078
- //#endregion
16079
15942
  //#region src/core/shapeTypes.ts
16080
15943
  function brandHandle(handle, dim) {
16081
15944
  if (dim === "2D") handle["__is2D"] = true;
@@ -16347,12 +16210,6 @@ Object.defineProperty(exports, "castShapeWithKnownType", {
16347
16210
  return castShapeWithKnownType;
16348
16211
  }
16349
16212
  });
16350
- Object.defineProperty(exports, "closedWire", {
16351
- enumerable: true,
16352
- get: function() {
16353
- return closedWire;
16354
- }
16355
- });
16356
16213
  Object.defineProperty(exports, "createCompound", {
16357
16214
  enumerable: true,
16358
16215
  get: function() {
@@ -16515,12 +16372,6 @@ Object.defineProperty(exports, "is3D", {
16515
16372
  return is3D;
16516
16373
  }
16517
16374
  });
16518
- Object.defineProperty(exports, "isClosedWire", {
16519
- enumerable: true,
16520
- get: function() {
16521
- return isClosedWire;
16522
- }
16523
- });
16524
16375
  Object.defineProperty(exports, "isCompound", {
16525
16376
  enumerable: true,
16526
16377
  get: function() {
@@ -16545,30 +16396,6 @@ Object.defineProperty(exports, "isLive", {
16545
16396
  return isLive;
16546
16397
  }
16547
16398
  });
16548
- Object.defineProperty(exports, "isManifoldShell", {
16549
- enumerable: true,
16550
- get: function() {
16551
- return isManifoldShell;
16552
- }
16553
- });
16554
- Object.defineProperty(exports, "isOrientedFace", {
16555
- enumerable: true,
16556
- get: function() {
16557
- return isOrientedFace;
16558
- }
16559
- });
16560
- Object.defineProperty(exports, "isPlanarFace", {
16561
- enumerable: true,
16562
- get: function() {
16563
- return isPlanarFace;
16564
- }
16565
- });
16566
- Object.defineProperty(exports, "isPlanarWire", {
16567
- enumerable: true,
16568
- get: function() {
16569
- return isPlanarWire;
16570
- }
16571
- });
16572
16399
  Object.defineProperty(exports, "isShape1D", {
16573
16400
  enumerable: true,
16574
16401
  get: function() {
@@ -16593,12 +16420,6 @@ Object.defineProperty(exports, "isSolid", {
16593
16420
  return isSolid;
16594
16421
  }
16595
16422
  });
16596
- Object.defineProperty(exports, "isValidSolid", {
16597
- enumerable: true,
16598
- get: function() {
16599
- return isValidSolid;
16600
- }
16601
- });
16602
16423
  Object.defineProperty(exports, "isVertex", {
16603
16424
  enumerable: true,
16604
16425
  get: function() {
@@ -16611,30 +16432,6 @@ Object.defineProperty(exports, "isWire", {
16611
16432
  return isWire;
16612
16433
  }
16613
16434
  });
16614
- Object.defineProperty(exports, "manifoldShell", {
16615
- enumerable: true,
16616
- get: function() {
16617
- return manifoldShell;
16618
- }
16619
- });
16620
- Object.defineProperty(exports, "orientedFace", {
16621
- enumerable: true,
16622
- get: function() {
16623
- return orientedFace;
16624
- }
16625
- });
16626
- Object.defineProperty(exports, "planarFace", {
16627
- enumerable: true,
16628
- get: function() {
16629
- return planarFace;
16630
- }
16631
- });
16632
- Object.defineProperty(exports, "planarWire", {
16633
- enumerable: true,
16634
- get: function() {
16635
- return planarWire;
16636
- }
16637
- });
16638
16435
  Object.defineProperty(exports, "prewarm", {
16639
16436
  enumerable: true,
16640
16437
  get: function() {
@@ -16677,30 +16474,12 @@ Object.defineProperty(exports, "resetPerformanceStats", {
16677
16474
  return resetPerformanceStats;
16678
16475
  }
16679
16476
  });
16680
- Object.defineProperty(exports, "supportsConstraintSketch", {
16681
- enumerable: true,
16682
- get: function() {
16683
- return supportsConstraintSketch;
16684
- }
16685
- });
16686
- Object.defineProperty(exports, "supportsProjection", {
16687
- enumerable: true,
16688
- get: function() {
16689
- return supportsProjection;
16690
- }
16691
- });
16692
16477
  Object.defineProperty(exports, "unregisterFromCleanup", {
16693
16478
  enumerable: true,
16694
16479
  get: function() {
16695
16480
  return unregisterFromCleanup;
16696
16481
  }
16697
16482
  });
16698
- Object.defineProperty(exports, "validSolid", {
16699
- enumerable: true,
16700
- get: function() {
16701
- return validSolid;
16702
- }
16703
- });
16704
16483
  Object.defineProperty(exports, "withArenaCheckpoint", {
16705
16484
  enumerable: true,
16706
16485
  get: function() {
@@ -1,6 +1,5 @@
1
1
  import { A as EXACT_BREP_CAPABILITIES, C as serializeCurve2d$2, D as UnsupportedKernelOperationError, E as quickHull, O as isUnsupportedKernelOperationError, S as scaleCurve2d$2, T as translateCurve2d$2, _ as makeEllipse2d$2, a as buildBinarySTL, b as mirrorAtPoint, c as curveBounds, d as evaluateCurve2d$2, f as intersectCurves2dFn, g as makeCircle2d$2, h as makeBezier2d$2, i as buildAsciiSTL, l as curveTypeName, m as makeArc2dThreePoints, n as DEFAULT_STL_ANGULAR_TOLERANCE, o as addCurveToBBox, p as makeArc2dTangent, r as DEFAULT_STL_TOLERANCE, s as createBBox2d, t as OcctWasmAdapter, u as deserializeCurve2d$2, v as makeLine2d$2, w as tangentCurve2d, x as rotateCurve2d$2, y as mirrorAcrossAxis } from "./occtWasmAdapter-CE6nV8_2.js";
2
2
  import { i as wasmIndex, r as vec3At } from "./bug-BdOHwn_e.js";
3
- import { O as ok, v as err } from "./errors-B3CDG537.js";
4
3
  //#region src/kernel/quality.ts
5
4
  /**
6
5
  * Extract-time deflection per level. `'standard'` matches brepjs's historical
@@ -15334,16 +15333,6 @@ function importOptionalBackend(specifier) {
15334
15333
  );
15335
15334
  }
15336
15335
  //#endregion
15337
- //#region src/kernel/types.ts
15338
- /** Check if the kernel supports hidden-line-removal projection. */
15339
- function supportsProjection(kernel) {
15340
- return "projectEdges" in kernel;
15341
- }
15342
- /** Check if the kernel supports 2D constraint sketch solving. */
15343
- function supportsConstraintSketch(kernel) {
15344
- return "sketchNew" in kernel && "sketchDof" in kernel;
15345
- }
15346
- //#endregion
15347
15336
  //#region src/kernel/index.ts
15348
15337
  var _kernels = /* @__PURE__ */ new Map();
15349
15338
  var _defaultKernelId = null;
@@ -15534,7 +15523,7 @@ async function init() {
15534
15523
  throw new Error("brepjs: no kernel package found. Install one of:\n npm install occt-wasm (recommended, default)\n npm install brepjs-opencascade\n npm install brepkit-wasm");
15535
15524
  }
15536
15525
  //#endregion
15537
- //#region \0@oxc-project+runtime@0.138.0/helpers/esm/usingCtx.js
15526
+ //#region \0@oxc-project+runtime@0.139.0/helpers/esm/usingCtx.js
15538
15527
  function _usingCtx() {
15539
15528
  var r = "function" == typeof SuppressedError ? SuppressedError : function(r, e) {
15540
15529
  var n = Error();
@@ -15942,132 +15931,6 @@ function getShapeKind(shape) {
15942
15931
  return getOrQueryType(getKernel(), shape.wrapped);
15943
15932
  }
15944
15933
  //#endregion
15945
- //#region src/core/validityTypes.ts
15946
- /**
15947
- * Type guard — check if a wire is closed (forms a loop).
15948
- * Uses the kernel's `curveIsClosed` to verify at runtime.
15949
- */
15950
- function isClosedWire(wire) {
15951
- return getKernel().curveIsClosed(wire.wrapped);
15952
- }
15953
- /**
15954
- * Type guard — check if a face is valid and thus safe to use in operations.
15955
- *
15956
- * Uses kernel validity (BRepCheck_Analyzer) which verifies geometric and
15957
- * topological correctness. Faces produced by kernel operations (makeFace,
15958
- * extrude, revolve, boolean ops) are oriented by construction. For faces
15959
- * from STEP/IGES imports or external sources, validity does not guarantee
15960
- * consistent normal orientation — use with caution or re-orient first.
15961
- */
15962
- function isOrientedFace(face) {
15963
- return getKernel().isValid(face.wrapped);
15964
- }
15965
- /**
15966
- * Type guard — check if a shell is manifold (watertight, no dangling faces).
15967
- * Checks kernel validity, then attempts `solidFromShell` — if the shell
15968
- * can form a valid solid, it is manifold by definition.
15969
- *
15970
- * The temporary solid created for the proof is disposed immediately to avoid
15971
- * WASM memory leaks.
15972
- */
15973
- function isManifoldShell(shell) {
15974
- const kernel = getKernel();
15975
- if (!kernel.isValid(shell.wrapped)) return false;
15976
- const validate = kernel.isValidStrict?.bind(kernel) ?? kernel.isValid.bind(kernel);
15977
- try {
15978
- const solid = kernel.solidFromShell(shell.wrapped);
15979
- const valid = validate(solid);
15980
- try {
15981
- kernel.dispose(solid);
15982
- } catch {}
15983
- return valid;
15984
- } catch {
15985
- return false;
15986
- }
15987
- }
15988
- /**
15989
- * Type guard — check if a solid passes BRepCheck validation.
15990
- */
15991
- function isValidSolid(solid) {
15992
- return getKernel().isValid(solid.wrapped);
15993
- }
15994
- /**
15995
- * Prove that a wire is closed, returning a branded `ClosedWire` on success.
15996
- * This is the primary smart constructor for `ClosedWire`.
15997
- *
15998
- * @example
15999
- * ```ts
16000
- * const w = wire([e1, e2, e3]);
16001
- * const closed = closedWire(unwrap(w));
16002
- * if (isOk(closed)) {
16003
- * const f = face(closed.value); // ClosedWire accepted
16004
- * }
16005
- * ```
16006
- */
16007
- function closedWire(wire) {
16008
- if (isClosedWire(wire)) return ok(wire);
16009
- return err("Wire is not closed: start and end points do not coincide");
16010
- }
16011
- /**
16012
- * Prove that a face is oriented, returning a branded `OrientedFace` on success.
16013
- */
16014
- function orientedFace(face) {
16015
- if (isOrientedFace(face)) return ok(face);
16016
- return err("Face orientation is inconsistent or face is invalid");
16017
- }
16018
- /**
16019
- * Prove that a shell is manifold, returning a branded `ManifoldShell` on success.
16020
- */
16021
- function manifoldShell(shell) {
16022
- if (isManifoldShell(shell)) return ok(shell);
16023
- return err("Shell is not manifold: has free edges or is invalid");
16024
- }
16025
- /**
16026
- * Prove that a solid is valid, returning a branded `ValidSolid` on success.
16027
- */
16028
- function validSolid(solid) {
16029
- if (isValidSolid(solid)) return ok(solid);
16030
- return err("Solid failed BRepCheck validation");
16031
- }
16032
- /** Type guard — check if a face is planar (underlying surface is a plane). */
16033
- function isPlanarFace(face) {
16034
- return getKernel().surfaceType(face.wrapped) === "plane";
16035
- }
16036
- /**
16037
- * Type guard — check if a wire is planar (all edges lie in a common plane).
16038
- * Strategy: try planar-only face construction first (fast path on OCCT — throws
16039
- * for non-planar wires). If that succeeds, verify the surface type. If it
16040
- * fails, fall back to general mode and check whether the resulting surface is
16041
- * a plane. This handles kernel-specific differences in the planar flag.
16042
- */
16043
- function isPlanarWire(wire) {
16044
- const kernel = getKernel();
16045
- const checkFace = (onlyPlane) => {
16046
- try {
16047
- const tempFace = kernel.makeFace(wire.wrapped, onlyPlane);
16048
- const stype = kernel.surfaceType(tempFace);
16049
- try {
16050
- kernel.dispose(tempFace);
16051
- } catch {}
16052
- return stype === "plane";
16053
- } catch {
16054
- return false;
16055
- }
16056
- };
16057
- if (checkFace(true)) return true;
16058
- return checkFace(false);
16059
- }
16060
- /** Prove that a face is planar, returning a branded `PlanarFace` on success. */
16061
- function planarFace(face) {
16062
- if (isPlanarFace(face)) return ok(face);
16063
- return err("Face is not planar: underlying surface is not a geometric plane");
16064
- }
16065
- /** Prove that a wire is planar, returning a branded `PlanarWire` on success. */
16066
- function planarWire(wire) {
16067
- if (isPlanarWire(wire)) return ok(wire);
16068
- return err("Wire is not planar: edges do not lie in a common plane");
16069
- }
16070
- //#endregion
16071
15934
  //#region src/core/shapeTypes.ts
16072
15935
  function brandHandle(handle, dim) {
16073
15936
  if (dim === "2D") handle["__is2D"] = true;
@@ -16273,4 +16136,4 @@ function borrowShapeWithKnownType(ocShape, knownType, dim) {
16273
16136
  return brandHandle(createBorrowedHandle(ocShape), dim);
16274
16137
  }
16275
16138
  //#endregion
16276
- export { withScope as $, isPlanarFace as A, as2D as B, isSolid as C, qualityDeflection as Ct, isClosedWire as D, closedWire as E, planarFace as F, createHandle as G, is2D as H, planarWire as I, isLive as J, createKernelHandle as K, validSolid as L, isValidSolid as M, manifoldShell as N, isManifoldShell as O, orientedFace as P, withArenaCheckpoint as Q, getShapeKind as R, isShell as S, currentQuality as St, isWire as T, is3D as U, as3D as V, DisposalScope as W, resetDisposalStats as X, registerForCleanup as Y, unregisterFromCleanup as Z, isCompound as _, supportsConstraintSketch as _t, castShape3D as a, getKernel2D as at, isShape1D as b, getPerformanceStats as bt, createEdge as c, init as ct, createSolid as d, prewarm as dt, withScopeResult as et, createVertex as f, registerKernel as ft, disposeTransientSubShape as g, withTier as gt, disposeResultShape as h, withQuality as ht, castShape as i, getKernel as it, isPlanarWire as j, isOrientedFace as k, createFace as l, initFromManifold as lt, disposeDowncastSource as m, withKernel as mt, castResultShape as n, _usingCtx as nt, castShapeWithKnownType as o, getKernelCapabilities as ot, createWire as p, registerKernelTier as pt, getDisposalStats as q, castResultShapeWithKnownType as r, getActiveKernelId as rt, createCompound as s, getKernelTier as st, borrowShapeWithKnownType as t, withScopeResultAsync as tt, createShell as u, initFromOC as ut, isEdge as v, supportsProjection as vt, isVertex as w, isShape3D as x, resetPerformanceStats as xt, isFace as y, BrepkitAdapter as yt, getOrQueryType as z };
16139
+ export { prewarm as $, is2D as A, withArenaCheckpoint as B, isSolid as C, getOrQueryType as D, getShapeKind as E, getDisposalStats as F, getActiveKernelId as G, withScopeResult as H, isLive as I, getKernelCapabilities as J, getKernel as K, registerForCleanup as L, DisposalScope as M, createHandle as N, as2D as O, createKernelHandle as P, initFromOC as Q, resetDisposalStats as R, isShell as S, isWire as T, withScopeResultAsync as U, withScope as V, _usingCtx as W, init as X, getKernelTier as Y, initFromManifold as Z, isCompound as _, castShape3D as a, BrepkitAdapter as at, isShape1D as b, createEdge as c, currentQuality as ct, createSolid as d, registerKernel as et, createVertex as f, disposeTransientSubShape as g, disposeResultShape as h, castShape as i, withTier as it, is3D as j, as3D as k, createFace as l, qualityDeflection as lt, disposeDowncastSource as m, castResultShape as n, withKernel as nt, castShapeWithKnownType as o, getPerformanceStats as ot, createWire as p, getKernel2D as q, castResultShapeWithKnownType as r, withQuality as rt, createCompound as s, resetPerformanceStats as st, borrowShapeWithKnownType as t, registerKernelTier as tt, createShell as u, isEdge as v, isVertex as w, isShape3D as x, isFace as y, unregisterFromCleanup as z };
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_textBlueprints = require("./textBlueprints-B5zcLGvJ.cjs");
3
- const require_blueprintSketcher = require("./blueprintSketcher-C0EXFVb2.cjs");
4
- const require_drawFns = require("./drawFns-D9Rf4foW.cjs");
2
+ const require_blueprintSketcher = require("./blueprintSketcher-BNz6f36D.cjs");
3
+ const require_drawFns = require("./drawFns-B14M5M68.cjs");
4
+ const require_textBlueprints = require("./textBlueprints-8EcWreab.cjs");
5
5
  //#region src/sketching.ts
6
6
  /**
7
7
  * brepjs/sketching — Sketcher, Drawing, and sketch-to-shape operations.
package/dist/sketching.js CHANGED
@@ -1,6 +1,6 @@
1
- import { n as BaseSketcher2d, t as BlueprintSketcher } from "./blueprintSketcher-DDPyypmC.js";
2
- import { A as sketchEllipse, C as DrawingPen, D as makeBaseBox, E as deserializeDrawing, F as sketchRectangle, I as sketchRoundedRectangle, L as FaceSketcher, M as sketchHelix, N as sketchParametricFunction, O as polysideInnerRadius, P as sketchPolysides, R as Sketcher, S as drawText, T as Drawing, _ as drawPolysides, a as drawingIntersect, b as drawSingleCircle, c as rotateDrawing, d as drawFaceOutline, f as drawProjection, g as drawPointsInterpolation, h as drawParametricFunction, i as drawingFuse, j as sketchFaceOffset, k as sketchCircle, l as scaleDrawing, m as drawEllipse, n as drawingCut, o as drawingToSketchOnPlane, p as drawCircle, r as drawingFillet, s as mirrorDrawing, t as drawingChamfer, u as translateDrawing, v as drawRectangle, w as draw, x as drawSingleEllipse, y as drawRoundedRectangle } from "./drawFns-B9HbtAoc.js";
3
- import { a as Sketch, c as compoundSketchLoft, d as sketchFace, f as sketchLoft, h as sketchWires, i as Sketches, l as compoundSketchRevolve, m as sketchSweep, o as compoundSketchExtrude, p as sketchRevolve, s as compoundSketchFace, u as sketchExtrude, v as CompoundSketch } from "./textBlueprints-igbNvKcd.js";
1
+ import { n as BaseSketcher2d, t as BlueprintSketcher } from "./blueprintSketcher-CKKxvxB-.js";
2
+ import { A as sketchEllipse, C as DrawingPen, D as makeBaseBox, E as deserializeDrawing, F as sketchRectangle, I as sketchRoundedRectangle, L as FaceSketcher, M as sketchHelix, N as sketchParametricFunction, O as polysideInnerRadius, P as sketchPolysides, R as Sketcher, S as drawText, T as Drawing, _ as drawPolysides, a as drawingIntersect, b as drawSingleCircle, c as rotateDrawing, d as drawFaceOutline, f as drawProjection, g as drawPointsInterpolation, h as drawParametricFunction, i as drawingFuse, j as sketchFaceOffset, k as sketchCircle, l as scaleDrawing, m as drawEllipse, n as drawingCut, o as drawingToSketchOnPlane, p as drawCircle, r as drawingFillet, s as mirrorDrawing, t as drawingChamfer, u as translateDrawing, v as drawRectangle, w as draw, x as drawSingleEllipse, y as drawRoundedRectangle } from "./drawFns-BShGVVXW.js";
3
+ import { a as Sketch, c as compoundSketchLoft, d as sketchFace, f as sketchLoft, h as sketchWires, i as Sketches, l as compoundSketchRevolve, m as sketchSweep, o as compoundSketchExtrude, p as sketchRevolve, s as compoundSketchFace, u as sketchExtrude, v as CompoundSketch } from "./textBlueprints-rA1HT6j1.js";
4
4
  //#region src/sketching.ts
5
5
  /**
6
6
  * brepjs/sketching — Sketcher, Drawing, and sketch-to-shape operations.