brepjs 20.12.15 → 20.13.1

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 (99) hide show
  1. package/dist/2d.cjs +6 -6
  2. package/dist/2d.js +6 -6
  3. package/dist/{adjacencyFns-BHdJW5pd.cjs → adjacencyFns-BA9xrrmS.cjs} +3 -3
  4. package/dist/{adjacencyFns-C4yjxKu4.js → adjacencyFns-C4Tui11_.js} +3 -3
  5. package/dist/{blueprint-D4juQWXs.cjs → blueprint-D193PMxX.cjs} +5 -5
  6. package/dist/{blueprint-ku_wYIZl.js → blueprint-DH0H9OWv.js} +5 -5
  7. package/dist/{blueprintFns-B0cqtoFB.js → blueprintFns-Bfiqbmtc.js} +2 -2
  8. package/dist/{blueprintFns-8obtvMEn.cjs → blueprintFns-DYIKTIvJ.cjs} +2 -2
  9. package/dist/{blueprintSketcher-CRFpnZAS.cjs → blueprintSketcher-B1UrnhFt.cjs} +3 -3
  10. package/dist/{blueprintSketcher-Dpdgf5aR.js → blueprintSketcher-RA8ti2Xp.js} +3 -3
  11. package/dist/{boolean2D-CnCDsRJ4.js → boolean2D-CCKUmway.js} +4 -4
  12. package/dist/{boolean2D-D3jxohLZ.cjs → boolean2D-XIehGONX.cjs} +4 -4
  13. package/dist/{booleanFns-CItcObM_.js → booleanFns-CyxmW1pL.js} +5 -5
  14. package/dist/{booleanFns-GBPAGQ5g.cjs → booleanFns-zRlNDHQY.cjs} +5 -5
  15. package/dist/brepjs.cjs +30 -30
  16. package/dist/brepjs.js +30 -30
  17. package/dist/{cameraFns-C2XhSqrr.cjs → cameraFns-BDjt94fY.cjs} +3 -3
  18. package/dist/{cameraFns-B6ujpyKy.js → cameraFns-CtpBKmwD.js} +3 -3
  19. package/dist/core.cjs +2 -2
  20. package/dist/core.js +2 -2
  21. package/dist/{cornerFinder-D3nBhdfi.js → cornerFinder-CIryesVI.js} +1 -1
  22. package/dist/{cornerFinder-CqHx_Itj.cjs → cornerFinder-DWN1Vkea.cjs} +1 -1
  23. package/dist/{curveFns-BQjw0VBB.cjs → curveFns-0vAErrs9.cjs} +1 -1
  24. package/dist/{curveFns-nAwtilbz.js → curveFns-b_C6tBeU.js} +1 -1
  25. package/dist/{drawFns-D9q4Hxc_.js → drawFns--_Bd7ONO.js} +12 -12
  26. package/dist/{drawFns-hFjTvdw4.cjs → drawFns-vcRf5KKV.cjs} +12 -12
  27. package/dist/{faceFns-DdMpocg9.cjs → faceFns-DzNcnzS5.cjs} +2 -2
  28. package/dist/{faceFns-Dodcduw8.js → faceFns-WtnWpVQl.js} +2 -2
  29. package/dist/{healingFns-GNF1rFuw.js → healingFns-B82dNj9P.js} +79 -31
  30. package/dist/{healingFns-Cdpu44d0.cjs → healingFns-D26gj7M5.cjs} +79 -31
  31. package/dist/{helpers-TWIfnyto.cjs → helpers-BO5NktbN.cjs} +6 -6
  32. package/dist/{helpers-CoVtL5c9.js → helpers-C5I0ZqYC.js} +6 -6
  33. package/dist/{importFns-P-TcOJ1G.cjs → importFns-Ceb2VgcK.cjs} +34 -20
  34. package/dist/{importFns-C9TUFscx.js → importFns-sxpO2z86.js} +34 -20
  35. package/dist/io/importFns.d.ts +12 -5
  36. package/dist/io.cjs +2 -2
  37. package/dist/io.js +2 -2
  38. package/dist/kernel/brepkit/igesMerge.d.ts +13 -0
  39. package/dist/kernel/brepkit/stepMerge.d.ts +14 -0
  40. package/dist/kernel/interfaces/evolutionOps.d.ts +8 -0
  41. package/dist/kernel/interfaces/modifierOps.d.ts +17 -8
  42. package/dist/kernel/occtWasm/evolutionOps.d.ts +2 -0
  43. package/dist/kernel/occtWasm/helpers.d.ts +6 -0
  44. package/dist/kernel/occtWasm/modifierOps.d.ts +2 -8
  45. package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
  46. package/dist/kernel/occtWasm/occtWasmAdapter.d.ts +3 -5
  47. package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
  48. package/dist/kernel/occtWasm/occtWasmTypes.d.ts +2 -0
  49. package/dist/{loftFns-Uq6BhPVL.cjs → loftFns-KXrP3aat.cjs} +1 -1
  50. package/dist/{loftFns-DVsWk-9v.js → loftFns-Y-aBF_f7.js} +1 -1
  51. package/dist/{measureFns-DoUWDfAP.js → measureFns-B0PhQ5dY.js} +3 -3
  52. package/dist/{measureFns-B0Cy7GcQ.cjs → measureFns-C8UjdHpB.cjs} +3 -3
  53. package/dist/measurement.cjs +2 -2
  54. package/dist/measurement.js +2 -2
  55. package/dist/{meshFns-BpBgKIIE.js → meshFns-BazHDlpY.js} +4 -4
  56. package/dist/{meshFns-Bz9PPZWP.cjs → meshFns-BnkXZ0Xm.cjs} +4 -4
  57. package/dist/{occtWasmAdapter-DzxyXpLG.cjs → occtWasmAdapter-4YnvqZOW.cjs} +122 -9
  58. package/dist/{occtWasmAdapter-DeVQrL5n.js → occtWasmAdapter-CGsnjMOe.js} +122 -9
  59. package/dist/operations.cjs +2 -2
  60. package/dist/operations.js +2 -2
  61. package/dist/{primitiveFns-DE1RROq-.cjs → primitiveFns-BM709SMs.cjs} +5 -5
  62. package/dist/{primitiveFns-Crqsdby_.js → primitiveFns-BZALpT35.js} +5 -5
  63. package/dist/{principalBoxFns-CzEBI6tC.cjs → principalBoxFns-C_hSxRc7.cjs} +3 -3
  64. package/dist/{principalBoxFns-DwitCsif.js → principalBoxFns-DLOoxmZB.js} +3 -3
  65. package/dist/projection.cjs +1 -1
  66. package/dist/projection.js +1 -1
  67. package/dist/query.cjs +2 -2
  68. package/dist/query.js +2 -2
  69. package/dist/{refResolveFns-BJz9UvXM.js → refResolveFns-BA1ES0sL.js} +6 -6
  70. package/dist/{refResolveFns-DgM_B9WU.cjs → refResolveFns-BkSLmvyY.cjs} +6 -6
  71. package/dist/{shapeFns-B9LB54_t.cjs → shapeFns-Bgql2_E6.cjs} +2 -2
  72. package/dist/{shapeFns-Ddh0M4Iz.js → shapeFns-CSWOXGx9.js} +2 -2
  73. package/dist/shapeRef.cjs +1 -1
  74. package/dist/shapeRef.js +1 -1
  75. package/dist/{shapeTypes-C1Ljs72p.cjs → shapeTypes-BFfnNmzj.cjs} +214 -23
  76. package/dist/{shapeTypes-DiCMRU6Z.js → shapeTypes-C7hqbMwl.js} +214 -23
  77. package/dist/sketching.cjs +3 -3
  78. package/dist/sketching.js +3 -3
  79. package/dist/{solidBuilders-Dzhk5L6w.js → solidBuilders-B01dFnd7.js} +3 -3
  80. package/dist/{solidBuilders-C6_6tZXG.cjs → solidBuilders-CWw3yasa.cjs} +3 -3
  81. package/dist/{surfaceBuilders-Idshk6C3.js → surfaceBuilders-Cn7GIsyR.js} +3 -3
  82. package/dist/{surfaceBuilders-CU_vd71e.cjs → surfaceBuilders-DL7UTpW2.cjs} +3 -3
  83. package/dist/text.cjs +2 -2
  84. package/dist/text.js +2 -2
  85. package/dist/{textBlueprints-DyT-kfxc.js → textBlueprints-B7gDC-aP.js} +8 -8
  86. package/dist/{textBlueprints-BmIxy1fi.cjs → textBlueprints-dOnCv38X.cjs} +8 -8
  87. package/dist/{textMetrics-DuzBLY9z.js → textMetrics-BFzj8Zvn.js} +1 -1
  88. package/dist/{textMetrics-CbDASt0r.cjs → textMetrics-Cqc0xzHC.cjs} +1 -1
  89. package/dist/{threadFns-YPn7KF9u.cjs → threadFns-DwTPnV_1.cjs} +7 -7
  90. package/dist/{threadFns-CN1R3YKa.js → threadFns-M8pqF4TW.js} +7 -7
  91. package/dist/topology/apiTypes.d.ts +9 -0
  92. package/dist/topology/chamferAngleFns.d.ts +18 -9
  93. package/dist/topology.cjs +9 -9
  94. package/dist/topology.js +9 -9
  95. package/dist/{topologyQueryFns-0Ycw298Y.cjs → topologyQueryFns-95FptXtu.cjs} +1 -1
  96. package/dist/{topologyQueryFns-CNOqc1rB.js → topologyQueryFns-C3-_9dFM.js} +1 -1
  97. package/dist/{validityTypes-CXnc46WG.cjs → validityTypes--tgDeAF8.cjs} +1 -1
  98. package/dist/{validityTypes-rUpnumpL.js → validityTypes-C6qOP241.js} +1 -1
  99. package/package.json +2 -2
package/dist/io.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_meshFns = require("./meshFns-Bz9PPZWP.cjs");
3
- const require_importFns = require("./importFns-P-TcOJ1G.cjs");
2
+ const require_meshFns = require("./meshFns-BnkXZ0Xm.cjs");
3
+ const require_importFns = require("./importFns-Ceb2VgcK.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-BpBgKIIE.js";
2
- import { a as exportSTEPConfigured, c as exportThreeMF, d as exportGlb, f as exportGltf, l as blueprintToDXF, n as importSTEP, o as importSVG, p as exportOBJ, r as importSTL, s as importSVGPathD, t as importIGES, u as exportDXF } from "./importFns-C9TUFscx.js";
1
+ import { n as exportSTEP, r as exportSTL, t as exportIGES } from "./meshFns-BazHDlpY.js";
2
+ import { a as exportSTEPConfigured, c as exportThreeMF, d as exportGlb, f as exportGltf, l as blueprintToDXF, n as importSTEP, o as importSVG, p as exportOBJ, r as importSTL, s as importSVGPathD, t as importIGES, u as exportDXF } from "./importFns-sxpO2z86.js";
3
3
  export { blueprintToDXF, exportDXF, exportGlb, exportGltf, exportIGES, exportOBJ, exportSTEP, exportSTEPConfigured, exportSTL, exportThreeMF, importIGES, importSTEP, importSTL, importSVG, importSVGPathD };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Merge single-solid brepkit IGES documents into one.
3
+ *
4
+ * brepkit-wasm's `exportIges` takes one solid, but an IGES file holds one
5
+ * document. brepkit's writer emits only standalone entities that point at no
6
+ * other entity, so the merge appends each later document's directory and
7
+ * parameter entries, renumbering only the fixed-column fields that number or
8
+ * link them, and keeps the first document's start and global sections.
9
+ *
10
+ * @module
11
+ */
12
+ /** One IGES document holding the entities of every brepkit IGES document in `docs`. */
13
+ export declare function mergeIgesDocuments(docs: readonly string[]): string;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Merge single-solid brepkit STEP documents into one.
3
+ *
4
+ * brepkit-wasm's `exportStep` takes one solid, but a STEP file holds one
5
+ * document. brepkit's own multi-solid writer lists every solid in a single
6
+ * ADVANCED_BREP_SHAPE_REPRESENTATION under one product, so the merge rebuilds
7
+ * that layout: each later document contributes only the entities its solids
8
+ * reach, renumbered past the ids already used, and its solids join the first
9
+ * document's representation.
10
+ *
11
+ * @module
12
+ */
13
+ /** One STEP document holding the solids of every brepkit STEP document in `docs`. */
14
+ export declare function mergeStepDocuments(docs: readonly string[]): string;
@@ -1,4 +1,5 @@
1
1
  import { BooleanOptions, DiagnosticOperationResult, KernelShape, KernelType, OperationResult } from '../types.js';
2
+ import { ChamferDistAngleEdge } from './modifierOps.js';
2
3
  export interface KernelEvolutionOps {
3
4
  translateWithHistory(shape: KernelShape, x: number, y: number, z: number, inputFaceHashes: number[], hashUpperBound: number): OperationResult;
4
5
  /** {@link KernelTransformOps.rotate} with face history: `angle` is in radians. */
@@ -18,6 +19,13 @@ export interface KernelEvolutionOps {
18
19
  cutAllWithHistory?: ((shape: KernelShape, tools: KernelShape[], inputFaceHashes: number[], hashUpperBound: number, options?: BooleanOptions) => DiagnosticOperationResult) | undefined;
19
20
  filletWithHistory(shape: KernelShape, edges: KernelShape[], radius: number | [number, number] | ((edge: KernelShape) => number | [number, number]), inputFaceHashes: number[], hashUpperBound: number): OperationResult;
20
21
  chamferWithHistory(shape: KernelShape, edges: KernelShape[], distance: number | [number, number] | ((edge: KernelShape) => number | [number, number]), inputFaceHashes: number[], hashUpperBound: number): OperationResult;
22
+ /**
23
+ * {@link KernelModifierOps.chamferDistAngles} with face history. Optional, and
24
+ * may throw `UnsupportedKernelOperationError` on a build without it: there a
25
+ * distance-angle chamfer carries over face origins only, matched by hash and
26
+ * geometry.
27
+ */
28
+ chamferDistAnglesWithHistory?(shape: KernelShape, edges: ReadonlyArray<ChamferDistAngleEdge>, inputFaceHashes: number[], hashUpperBound: number): OperationResult;
21
29
  shellWithHistory(shape: KernelShape, faces: KernelShape[], thickness: number, inputFaceHashes: number[], hashUpperBound: number, tolerance?: number): OperationResult;
22
30
  thickenWithHistory(shape: KernelShape, thickness: number, inputFaceHashes: number[], hashUpperBound: number): OperationResult;
23
31
  offsetWithHistory(shape: KernelShape, distance: number, inputFaceHashes: number[], hashUpperBound: number, tolerance?: number): OperationResult;
@@ -1,20 +1,29 @@
1
1
  import { KernelShape } from '../types.js';
2
+ /** One edge of a distance-angle chamfer that gives each edge its own values. */
3
+ export interface ChamferDistAngleEdge {
4
+ readonly edge: KernelShape;
5
+ /** Setback on the reference face. */
6
+ readonly distance: number;
7
+ /** Angle from the reference face, in degrees. */
8
+ readonly angleDeg: number;
9
+ /**
10
+ * The reference face, one of the two faces the edge joins. Omitted, the
11
+ * kernel picks it as {@link KernelModifierOps.chamferDistAngle} does.
12
+ */
13
+ readonly face?: KernelShape | undefined;
14
+ }
2
15
  export interface KernelModifierOps {
3
16
  fillet(shape: KernelShape, edges: KernelShape[], radius: number | [number, number] | ((edge: KernelShape) => number | [number, number])): KernelShape;
4
17
  chamfer(shape: KernelShape, edges: KernelShape[], distance: number | [number, number] | ((edge: KernelShape) => number | [number, number])): KernelShape;
5
18
  chamferDistAngle(shape: KernelShape, edges: KernelShape[], distance: number, angleDeg: number): KernelShape;
6
19
  /**
7
20
  * Distance-angle chamfer with its own values on each edge, in one operation:
8
- * `distance` is set back on the edge's reference face (as {@link chamferDistAngle}
9
- * picks it) and `angleDeg` is measured from that face.
21
+ * `distance` is set back on the edge's reference face (its `face`, or as
22
+ * {@link chamferDistAngle} picks it) and `angleDeg` is measured from that face.
10
23
  * Optional: kernels without it can chamfer by distance and angle only with
11
- * one value for every edge.
24
+ * one value for every edge and no reference faces.
12
25
  */
13
- chamferDistAngles?(shape: KernelShape, edges: ReadonlyArray<{
14
- edge: KernelShape;
15
- distance: number;
16
- angleDeg: number;
17
- }>): KernelShape;
26
+ chamferDistAngles?(shape: KernelShape, edges: ReadonlyArray<ChamferDistAngleEdge>): KernelShape;
18
27
  shell(shape: KernelShape, faces: KernelShape[], thickness: number, tolerance?: number): KernelShape;
19
28
  thicken(shape: KernelShape, thickness: number): KernelShape;
20
29
  offset(shape: KernelShape, distance: number, tolerance?: number): KernelShape;
@@ -1,4 +1,5 @@
1
1
  import { BooleanOptions, DiagnosticOperationResult, KernelShape, KernelType, OperationResult } from '../types.js';
2
+ import { ChamferDistAngleEdge } from '../interfaces/modifierOps.js';
2
3
  import { OcctKernelWasm, OcctWasmModule } from './occtWasmTypes.js';
3
4
  import { EdgeValueSpec } from './helpers.js';
4
5
  /**
@@ -19,6 +20,7 @@ export declare function fuseAllWithHistory(k: OcctKernelWasm, Module: OcctWasmMo
19
20
  export declare function cutAllWithHistory(k: OcctKernelWasm, Module: OcctWasmModule, shape: KernelShape, tools: KernelShape[], inputFaceHashes: number[], hashUpperBound: number, options?: BooleanOptions): DiagnosticOperationResult;
20
21
  export declare function filletWithHistory(k: OcctKernelWasm, Module: OcctWasmModule, shape: KernelShape, edges: KernelShape[], radius: EdgeValueSpec, inputFaceHashes: number[], hashUpperBound: number): OperationResult;
21
22
  export declare function chamferWithHistory(k: OcctKernelWasm, Module: OcctWasmModule, shape: KernelShape, edges: KernelShape[], distance: EdgeValueSpec, inputFaceHashes: number[], hashUpperBound: number): OperationResult;
23
+ export declare function chamferDistAnglesWithHistory(k: OcctKernelWasm, Module: OcctWasmModule, shape: KernelShape, entries: ReadonlyArray<ChamferDistAngleEdge>, inputFaceHashes: number[], hashUpperBound: number): OperationResult;
22
24
  export declare function shellWithHistory(k: OcctKernelWasm, Module: OcctWasmModule, shape: KernelShape, faces: KernelShape[], thickness: number, inputFaceHashes: number[], hashUpperBound: number, tolerance?: number): OperationResult;
23
25
  export declare function thickenWithHistory(k: OcctKernelWasm, Module: OcctWasmModule, shape: KernelShape, thickness: number, inputFaceHashes: number[], hashUpperBound: number): OperationResult;
24
26
  export declare function offsetWithHistory(k: OcctKernelWasm, Module: OcctWasmModule, shape: KernelShape, distance: number, inputFaceHashes: number[], hashUpperBound: number, tolerance?: number): OperationResult;
@@ -35,11 +35,17 @@ export type EdgeValueSpec = EdgeValue | ((edge: KernelShape) => EdgeValue);
35
35
  * and `second`.
36
36
  */
37
37
  export declare function runEdgeTreatment<T>(Module: OcctWasmModule, edges: KernelShape[], value: EdgeValueSpec, uniform: (edgeVec: EmVectorUint32, value: number) => T, perEdge: (edgeVec: EmVectorUint32, first: EmVectorDouble, second: EmVectorDouble) => T): T;
38
+ /**
39
+ * A per-edge chamfer's `referenceFaceIds`: empty when no edge names its
40
+ * reference face, else one id per edge, 0 where the facade picks the face.
41
+ */
42
+ export declare function referenceFaceIds(faces: ReadonlyArray<KernelShape | undefined>): number[];
38
43
  /** Each face's draft angle, in radians. */
39
44
  export declare function draftAnglesRad(faces: readonly KernelShape[], angleDeg: number | ((face: KernelShape) => number)): number[];
40
45
  /** The peer range still admits older builds, which lack the per-edge and unit entry points. */
41
46
  export declare function needsOcctWasm59(what: string): UnsupportedKernelOperationError;
42
47
  export declare function needsOcctWasm510(what: string): UnsupportedKernelOperationError;
48
+ export declare function needsOcctWasm511(what: string): UnsupportedKernelOperationError;
43
49
  /**
44
50
  * Rotate a shape from the kernel's default Z-axis to an arbitrary direction.
45
51
  * Used by primitives whose creation API only takes a Z-aligned form.
@@ -1,16 +1,11 @@
1
1
  import { KernelShape } from '../types.js';
2
+ import { ChamferDistAngleEdge } from '../interfaces/modifierOps.js';
2
3
  import { OcctKernelWasm, OcctWasmModule } from './occtWasmTypes.js';
3
4
  import { EdgeValueSpec } from './helpers.js';
4
5
  export declare function fillet(k: OcctKernelWasm, Module: OcctWasmModule, shape: KernelShape, edges: KernelShape[], radius: EdgeValueSpec): KernelShape;
5
6
  export declare function chamfer(k: OcctKernelWasm, Module: OcctWasmModule, shape: KernelShape, edges: KernelShape[], distance: EdgeValueSpec): KernelShape;
6
- interface DistAngle {
7
- readonly distance: number;
8
- readonly angleDeg: number;
9
- }
10
7
  export declare function chamferDistAngle(k: OcctKernelWasm, Module: OcctWasmModule, shape: KernelShape, edges: KernelShape[], distance: number, angleDeg: number): KernelShape;
11
- export declare function chamferDistAngles(k: OcctKernelWasm, Module: OcctWasmModule, shape: KernelShape, entries: ReadonlyArray<{
12
- edge: KernelShape;
13
- } & DistAngle>): KernelShape;
8
+ export declare function chamferDistAngles(k: OcctKernelWasm, Module: OcctWasmModule, shape: KernelShape, entries: ReadonlyArray<ChamferDistAngleEdge>): KernelShape;
14
9
  export declare function shell(k: OcctKernelWasm, Module: OcctWasmModule, shape: KernelShape, faces: KernelShape[], thickness: number, tolerance?: number): KernelShape;
15
10
  export declare function thicken(k: OcctKernelWasm, shape: KernelShape, thickness: number): KernelShape;
16
11
  export declare function offset(k: OcctKernelWasm, shape: KernelShape, distance: number, tolerance?: number): KernelShape;
@@ -21,4 +16,3 @@ export declare function defeature(k: OcctKernelWasm, Module: OcctWasmModule, sha
21
16
  export declare function offsetWire2D(k: OcctKernelWasm, wire: KernelShape, offset: number, joinType?: number | 'arc' | 'intersection' | 'tangent'): KernelShape;
22
17
  export declare function simplify(k: OcctKernelWasm, shape: KernelShape): KernelShape;
23
18
  export declare function reverseShape(k: OcctKernelWasm, shape: KernelShape): KernelShape;
24
- export {};
@@ -1,3 +1,3 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_occtWasmAdapter = require("../../occtWasmAdapter-DzxyXpLG.cjs");
2
+ const require_occtWasmAdapter = require("../../occtWasmAdapter-4YnvqZOW.cjs");
3
3
  exports.OcctWasmAdapter = require_occtWasmAdapter.OcctWasmAdapter;
@@ -2,6 +2,7 @@ import { KernelCapabilities } from '../capabilities.js';
2
2
  import { BooleanOpType, BooleanOptions, CheckBooleanResult, DiagnosticOperationResult, DistanceResult, KernelAdapter, KernelEdgeMeshResult, KernelInstance, KernelMeshResult, KernelShape, KernelType, MeshOptions, NurbsCurveData, OperationResult, ShapeOrientation, ShapeType, StepAssemblyPart, SurfaceType } from '../types.js';
3
3
  import { BulkMeasurement, Matrix3 } from '../interfaces/measureOps.js';
4
4
  import { TransformEntry } from '../interfaces/transformOps.js';
5
+ import { ChamferDistAngleEdge } from '../interfaces/modifierOps.js';
5
6
  import { Curve2dHandle, BBox2dHandle } from '../kernel2dTypes.js';
6
7
  import { OcctWasmModule, OcctKernelWasm } from './occtWasmTypes.js';
7
8
  /**
@@ -166,11 +167,7 @@ export declare class OcctWasmAdapter implements KernelAdapter {
166
167
  fillet(shape: KernelShape, edges: KernelShape[], radius: number | [number, number] | ((edge: KernelShape) => number | [number, number])): KernelShape;
167
168
  chamfer(shape: KernelShape, edges: KernelShape[], distance: number | [number, number] | ((edge: KernelShape) => number | [number, number])): KernelShape;
168
169
  chamferDistAngle(shape: KernelShape, edges: KernelShape[], distance: number, angleDeg: number): KernelShape;
169
- chamferDistAngles(shape: KernelShape, edges: ReadonlyArray<{
170
- edge: KernelShape;
171
- distance: number;
172
- angleDeg: number;
173
- }>): KernelShape;
170
+ chamferDistAngles(shape: KernelShape, edges: ReadonlyArray<ChamferDistAngleEdge>): KernelShape;
174
171
  shell(shape: KernelShape, faces: KernelShape[], thickness: number, tolerance?: number): KernelShape;
175
172
  thicken(shape: KernelShape, thickness: number): KernelShape;
176
173
  offset(shape: KernelShape, distance: number, tolerance?: number): KernelShape;
@@ -216,6 +213,7 @@ export declare class OcctWasmAdapter implements KernelAdapter {
216
213
  intersectWithHistory(shape: KernelShape, tool: KernelShape, inputFaceHashes: number[], hashUpperBound: number, options?: BooleanOptions): DiagnosticOperationResult;
217
214
  filletWithHistory(shape: KernelShape, edges: KernelShape[], radius: number | [number, number] | ((edge: KernelShape) => number | [number, number]), inputFaceHashes: number[], hashUpperBound: number): OperationResult;
218
215
  chamferWithHistory(shape: KernelShape, edges: KernelShape[], distance: number | [number, number] | ((edge: KernelShape) => number | [number, number]), inputFaceHashes: number[], hashUpperBound: number): OperationResult;
216
+ chamferDistAnglesWithHistory(shape: KernelShape, edges: ReadonlyArray<ChamferDistAngleEdge>, inputFaceHashes: number[], hashUpperBound: number): OperationResult;
219
217
  shellWithHistory(shape: KernelShape, faces: KernelShape[], thickness: number, inputFaceHashes: number[], hashUpperBound: number, tolerance?: number): OperationResult;
220
218
  thickenWithHistory(shape: KernelShape, thickness: number, inputFaceHashes: number[], hashUpperBound: number): OperationResult;
221
219
  offsetWithHistory(shape: KernelShape, distance: number, inputFaceHashes: number[], hashUpperBound: number, tolerance?: number): OperationResult;
@@ -1 +1 @@
1
- export { t as OcctWasmAdapter } from "../../occtWasmAdapter-DeVQrL5n.js";
1
+ export { t as OcctWasmAdapter } from "../../occtWasmAdapter-CGsnjMOe.js";
@@ -333,6 +333,8 @@ export interface OcctKernelWasm {
333
333
  filletRadiiWithHistory?(solidId: number, edgeIds: EmVectorUint32, startRadii: EmVectorDouble, endRadii: EmVectorDouble, inputFaceHashes: EmVectorInt, hashUpperBound: number): EmEvolutionData;
334
334
  /** occt-wasm >= 5.9.0: {@link chamferDistances} with face evolution. */
335
335
  chamferDistancesWithHistory?(solidId: number, edgeIds: EmVectorUint32, distances1: EmVectorDouble, distances2: EmVectorDouble, referenceFaceIds: EmVectorUint32, inputFaceHashes: EmVectorInt, hashUpperBound: number): EmEvolutionData;
336
+ /** occt-wasm >= 5.11.0: {@link chamferDistAngles} with face evolution. */
337
+ chamferDistAnglesWithHistory?(solidId: number, edgeIds: EmVectorUint32, distances: EmVectorDouble, anglesDeg: EmVectorDouble, referenceFaceIds: EmVectorUint32, inputFaceHashes: EmVectorInt, hashUpperBound: number): EmEvolutionData;
336
338
  /** occt-wasm >= 5.9.0 (npm build): {@link draftFaces} with face evolution. */
337
339
  draftFacesWithHistory?(shapeId: number, faceIds: EmVectorUint32, anglesRad: EmVectorDouble, dx: number, dy: number, dz: number, px: number, py: number, pz: number, nx: number, ny: number, nz: number, inputFaceHashes: EmVectorInt, hashUpperBound: number): EmEvolutionData;
338
340
  shellWithHistory(solidId: number, faceIds: EmVectorUint32, thickness: number, tolerance: number, inputFaceHashes: EmVectorInt, hashUpperBound: number): EmEvolutionData;
@@ -1,4 +1,4 @@
1
- const require_shapeTypes = require("./shapeTypes-C1Ljs72p.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-BFfnNmzj.cjs");
2
2
  const require_errors = require("./errors-O_blYTWT.cjs");
3
3
  const require_types = require("./types-CjF9Rofr.cjs");
4
4
  const require_vecOps = require("./vecOps-CrGEPPQM.cjs");
@@ -1,4 +1,4 @@
1
- import { G as _usingCtx, T as isWire, h as disposeResultShape, n as castResultShape, q as getKernel, x as isShape3D } from "./shapeTypes-DiCMRU6Z.js";
1
+ import { G as _usingCtx, T as isWire, h as disposeResultShape, n as castResultShape, q as getKernel, x as isShape3D } from "./shapeTypes-C7hqbMwl.js";
2
2
  import { E as ok, b as isErr, d as validationError, g as err, i as kernelError, l as typeCastError, t as BrepErrorCode } from "./errors-BTccWbtE.js";
3
3
  import { r as toVec3 } from "./types-CKXsIm9-.js";
4
4
  import { c as vecLength, t as vecAdd } from "./vecOps-S-m9H_fe.js";
@@ -1,7 +1,7 @@
1
- import { q as getKernel } from "./shapeTypes-DiCMRU6Z.js";
1
+ import { q as getKernel } from "./shapeTypes-C7hqbMwl.js";
2
2
  import { E as ok, d as validationError, g as err, t as BrepErrorCode } from "./errors-BTccWbtE.js";
3
- import { E as kernelCallRaw } from "./topologyQueryFns-CNOqc1rB.js";
4
- import { m as uvBounds } from "./faceFns-Dodcduw8.js";
3
+ import { E as kernelCallRaw } from "./topologyQueryFns-C3-_9dFM.js";
4
+ import { m as uvBounds } from "./faceFns-WtnWpVQl.js";
5
5
  // src/measurement/measureCache.ts
6
6
  var cache = /* @__PURE__ */ new WeakMap();
7
7
  function getCachedMeasurement(shape, key) {
@@ -1,7 +1,7 @@
1
- const require_shapeTypes = require("./shapeTypes-C1Ljs72p.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-BFfnNmzj.cjs");
2
2
  const require_errors = require("./errors-O_blYTWT.cjs");
3
- const require_topologyQueryFns = require("./topologyQueryFns-0Ycw298Y.cjs");
4
- const require_faceFns = require("./faceFns-DdMpocg9.cjs");
3
+ const require_topologyQueryFns = require("./topologyQueryFns-95FptXtu.cjs");
4
+ const require_faceFns = require("./faceFns-DzNcnzS5.cjs");
5
5
  // src/measurement/measureCache.ts
6
6
  var cache = /* @__PURE__ */ new WeakMap();
7
7
  function getCachedMeasurement(shape, key) {
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_measureFns = require("./measureFns-B0Cy7GcQ.cjs");
3
- const require_principalBoxFns = require("./principalBoxFns-CzEBI6tC.cjs");
2
+ const require_measureFns = require("./measureFns-C8UjdHpB.cjs");
3
+ const require_principalBoxFns = require("./principalBoxFns-C_hSxRc7.cjs");
4
4
  exports.createDistanceQuery = require_measureFns.createDistanceQuery;
5
5
  exports.measureArea = require_measureFns.measureArea;
6
6
  exports.measureDistance = require_measureFns.measureDistance;
@@ -1,3 +1,3 @@
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-DoUWDfAP.js";
2
- import { t as principalBoundingBox } from "./principalBoxFns-DwitCsif.js";
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-B0PhQ5dY.js";
2
+ import { t as principalBoundingBox } from "./principalBoxFns-DLOoxmZB.js";
3
3
  export { createDistanceQuery, measureArea, measureDistance, measureDistanceProps, measureLength, measureLinearProps, measureSurfaceProps, measureVolume, measureVolumeProps, principalBoundingBox };
@@ -1,8 +1,8 @@
1
- import { q as getKernel, ut as qualityDeflection } from "./shapeTypes-DiCMRU6Z.js";
2
- import { j as isUnsupportedKernelOperationError } from "./occtWasmAdapter-DeVQrL5n.js";
1
+ import { q as getKernel, ut as qualityDeflection } from "./shapeTypes-C7hqbMwl.js";
2
+ import { j as isUnsupportedKernelOperationError } from "./occtWasmAdapter-CGsnjMOe.js";
3
3
  import { E as ok, g as err, r as ioError, t as BrepErrorCode, u as unsupportedError } from "./errors-BTccWbtE.js";
4
- import { d as getSolids, n as getBounds } from "./topologyQueryFns-CNOqc1rB.js";
5
- import { d as getFaceOrigins } from "./solidBuilders-Dzhk5L6w.js";
4
+ import { d as getSolids, n as getBounds } from "./topologyQueryFns-C3-_9dFM.js";
5
+ import { d as getFaceOrigins } from "./solidBuilders-B01dFnd7.js";
6
6
  // src/topology/meshCache.ts
7
7
  /**
8
8
  * Build a parameter key for the inner cache map (excludes shape identity).
@@ -1,8 +1,8 @@
1
- const require_shapeTypes = require("./shapeTypes-C1Ljs72p.cjs");
2
- const require_occtWasmAdapter = require("./occtWasmAdapter-DzxyXpLG.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-BFfnNmzj.cjs");
2
+ const require_occtWasmAdapter = require("./occtWasmAdapter-4YnvqZOW.cjs");
3
3
  const require_errors = require("./errors-O_blYTWT.cjs");
4
- const require_topologyQueryFns = require("./topologyQueryFns-0Ycw298Y.cjs");
5
- const require_solidBuilders = require("./solidBuilders-C6_6tZXG.cjs");
4
+ const require_topologyQueryFns = require("./topologyQueryFns-95FptXtu.cjs");
5
+ const require_solidBuilders = require("./solidBuilders-CWw3yasa.cjs");
6
6
  // src/topology/meshCache.ts
7
7
  /**
8
8
  * Build a parameter key for the inner cache map (excludes shape identity).
@@ -2343,6 +2343,14 @@ function runEdgeTreatment(Module, edges, value, uniform, perEdge) {
2343
2343
  edgeVec.delete();
2344
2344
  }
2345
2345
  }
2346
+ /**
2347
+ * A per-edge chamfer's `referenceFaceIds`: empty when no edge names its
2348
+ * reference face, else one id per edge, 0 where the facade picks the face.
2349
+ */
2350
+ function referenceFaceIds(faces) {
2351
+ if (faces.every((face) => face === void 0)) return [];
2352
+ return faces.map((face) => face === void 0 ? 0 : unwrap(face));
2353
+ }
2346
2354
  /** Each face's draft angle, in radians. */
2347
2355
  function draftAnglesRad(faces, angleDeg) {
2348
2356
  return faces.map((face) => (typeof angleDeg === "function" ? angleDeg(face) : angleDeg) * Math.PI / 180);
@@ -2354,6 +2362,9 @@ function needsOcctWasm59(what) {
2354
2362
  function needsOcctWasm510(what) {
2355
2363
  return new UnsupportedKernelOperationError(`occt-wasm: ${what} requires occt-wasm >= 5.10.0`);
2356
2364
  }
2365
+ function needsOcctWasm511(what) {
2366
+ return new UnsupportedKernelOperationError(`occt-wasm: ${what} requires occt-wasm >= 5.11.0`);
2367
+ }
2357
2368
  /**
2358
2369
  * Rotate a shape from the kernel's default Z-axis to an arbitrary direction.
2359
2370
  * Used by primitives whose creation API only takes a Z-aligned form.
@@ -3817,21 +3828,23 @@ function chamfer(k, Module, shape, edges, distance) {
3817
3828
  }
3818
3829
  }
3819
3830
  /**
3820
- * Chamfer edge i by `distances[i]` and `anglesDeg[i]`. Builds without the
3821
- * per-edge entry point take only `shared`, the one value every edge has.
3831
+ * Chamfer edge i by `distances[i]` and `anglesDeg[i]` from reference face
3832
+ * `faceIds[i]` (see {@link referenceFaceIds}). Builds without the per-edge
3833
+ * entry point take only `shared`, the one value every edge has, and no faces.
3822
3834
  */
3823
- function runChamferDistAngles(k, Module, shape, edges, distances, anglesDeg, shared) {
3835
+ function runChamferDistAngles(k, Module, shape, edges, distances, anglesDeg, faceIds, shared) {
3824
3836
  const id = unwrap(shape);
3825
3837
  const edgeVec = makeVecU32(Module, edges.map(unwrap));
3826
3838
  try {
3827
3839
  if (!k.chamferDistAngles) {
3840
+ if (faceIds.length > 0) throw needsOcctWasm59("distance-angle chamfers measured from a given face");
3828
3841
  if (!shared) throw needsOcctWasm59("per-edge distance-angle chamfers");
3829
3842
  return wrapResult(k, k.chamferDistAngle(id, edgeVec, shared.distance, shared.angleDeg));
3830
3843
  }
3831
3844
  const chamferDistAngles = k.chamferDistAngles.bind(k);
3832
3845
  const distanceVec = makeVecDouble(Module, distances);
3833
3846
  const angleVec = makeVecDouble(Module, anglesDeg);
3834
- const faceVec = makeVecU32(Module, []);
3847
+ const faceVec = makeVecU32(Module, faceIds);
3835
3848
  try {
3836
3849
  return wrapResult(k, reportingFaultyEdges(edges, () => chamferDistAngles(id, edgeVec, distanceVec, angleVec, faceVec)));
3837
3850
  } finally {
@@ -3844,7 +3857,7 @@ function runChamferDistAngles(k, Module, shape, edges, distances, anglesDeg, sha
3844
3857
  }
3845
3858
  }
3846
3859
  function chamferDistAngle(k, Module, shape, edges, distance, angleDeg) {
3847
- return runChamferDistAngles(k, Module, shape, edges, Array(edges.length).fill(distance), Array(edges.length).fill(angleDeg), {
3860
+ return runChamferDistAngles(k, Module, shape, edges, Array(edges.length).fill(distance), Array(edges.length).fill(angleDeg), [], {
3848
3861
  distance,
3849
3862
  angleDeg
3850
3863
  });
@@ -3856,7 +3869,7 @@ function sharedDistAngle(entries) {
3856
3869
  return entries.every((e) => e.distance === first.distance && e.angleDeg === first.angleDeg) ? first : void 0;
3857
3870
  }
3858
3871
  function chamferDistAngles(k, Module, shape, entries) {
3859
- return runChamferDistAngles(k, Module, shape, entries.map((e) => e.edge), entries.map((e) => e.distance), entries.map((e) => e.angleDeg), sharedDistAngle(entries));
3872
+ return runChamferDistAngles(k, Module, shape, entries.map((e) => e.edge), entries.map((e) => e.distance), entries.map((e) => e.angleDeg), referenceFaceIds(entries.map((e) => e.face)), sharedDistAngle(entries));
3860
3873
  }
3861
3874
  function shell(k, Module, shape, faces, thickness, tolerance) {
3862
3875
  const vec = makeVecU32(Module, faces.map(unwrap));
@@ -4837,17 +4850,86 @@ function toBREP(k, shape) {
4837
4850
  function fromBREP(k, data) {
4838
4851
  return wrapResult(k, k.fromBREP(data));
4839
4852
  }
4853
+ /**
4854
+ * A new XCAF document holding each part as a free shape of its own, tagged
4855
+ * with its name and color.
4856
+ *
4857
+ * XCAF stores a shape once. A part identical to an earlier one comes back as
4858
+ * that part's label, and a part sharing another part's geometry (`TShape`) at
4859
+ * another placement becomes a reference to it, which leaves the shared label
4860
+ * no longer free, so it is not written. Either way there are fewer free shapes
4861
+ * than parts; the document is then rebuilt once with those parts copied, and a
4862
+ * copy has a `TShape` of its own. Copying the part whose label became shared,
4863
+ * not the placed parts referencing it, keeps those sharing one geometry.
4864
+ */
4840
4865
  function addXcafParts(k, parts) {
4841
4866
  const docId = k.xcafNewDocument();
4842
- for (const entry of parts) {
4843
- const labelId = k.xcafAddShape(docId, unwrap(entry.shape));
4867
+ let merged;
4868
+ try {
4869
+ merged = mergedParts(addEachPart(k, docId, parts, /* @__PURE__ */ new Set()), freeShapes(k, docId));
4870
+ } catch (e) {
4871
+ k.xcafClose(docId);
4872
+ throw e;
4873
+ }
4874
+ if (merged.size === 0) return docId;
4875
+ k.xcafClose(docId);
4876
+ const rebuilt = k.xcafNewDocument();
4877
+ try {
4878
+ addEachPart(k, rebuilt, parts, merged);
4879
+ return rebuilt;
4880
+ } catch (e) {
4881
+ k.xcafClose(rebuilt);
4882
+ throw e;
4883
+ }
4884
+ }
4885
+ /** Add `parts` in order, copying those in `copy`; the label each part went in as. */
4886
+ function addEachPart(k, docId, parts, copy) {
4887
+ return parts.map((entry, i) => {
4888
+ const labelId = addPartShape(k, docId, unwrap(entry.shape), copy.has(i));
4844
4889
  if (entry.name) k.xcafSetName(docId, labelId, entry.name);
4845
4890
  if (entry.color) {
4846
4891
  const [r, g, b] = entry.color;
4847
4892
  k.xcafSetColor(docId, labelId, r / 255, g / 255, b / 255);
4848
4893
  }
4894
+ return labelId;
4895
+ });
4896
+ }
4897
+ /**
4898
+ * The parts that did not become a free shape of their own: a repeat of an
4899
+ * earlier part's label, or a label no longer free. Each part adds at most one
4900
+ * free shape, so as many free shapes as parts means none merged.
4901
+ */
4902
+ function mergedParts(labels, free) {
4903
+ const merged = /* @__PURE__ */ new Set();
4904
+ if (free.length === labels.length) return merged;
4905
+ const freeLabels = new Set(free);
4906
+ const seen = /* @__PURE__ */ new Set();
4907
+ labels.forEach((label, i) => {
4908
+ if (seen.has(label) || !freeLabels.has(label)) merged.add(i);
4909
+ seen.add(label);
4910
+ });
4911
+ return merged;
4912
+ }
4913
+ /** Add a shape, or a copy of it; the document keeps the copy's geometry once its slot is released. */
4914
+ function addPartShape(k, docId, shapeId, copy) {
4915
+ if (!copy) return k.xcafAddShape(docId, shapeId);
4916
+ const copyId = k.copy(shapeId);
4917
+ try {
4918
+ return k.xcafAddShape(docId, copyId);
4919
+ } finally {
4920
+ k.release(copyId);
4921
+ }
4922
+ }
4923
+ /** The document's free shapes' label ids. */
4924
+ function freeShapes(k, docId) {
4925
+ const roots = k.xcafGetRootLabels(docId);
4926
+ try {
4927
+ const ids = [];
4928
+ for (let i = 0; i < roots.size(); i++) ids.push(roots.get(i));
4929
+ return ids;
4930
+ } finally {
4931
+ roots.delete();
4849
4932
  }
4850
- return docId;
4851
4933
  }
4852
4934
  function writeXcafDoc(k, docId, units) {
4853
4935
  const roots = k.xcafGetRootLabels(docId);
@@ -6204,6 +6286,34 @@ function chamferWithHistory(k, Module, shape, edges, distance, inputFaceHashes,
6204
6286
  hashVec.delete();
6205
6287
  }
6206
6288
  }
6289
+ function chamferDistAnglesWithHistory(k, Module, shape, entries, inputFaceHashes, hashUpperBound) {
6290
+ if (!k.chamferDistAnglesWithHistory) throw needsOcctWasm511("a distance-angle chamfer with face history");
6291
+ const withHistory = k.chamferDistAnglesWithHistory.bind(k);
6292
+ const shapeId = unwrap(shape);
6293
+ const edges = entries.map((e) => e.edge);
6294
+ const edgeIds = edges.map(unwrap);
6295
+ const distances = entries.map((e) => e.distance);
6296
+ const anglesDeg = entries.map((e) => e.angleDeg);
6297
+ const faceIds = referenceFaceIds(entries.map((e) => e.face));
6298
+ const edgeVec = makeVecU32(Module, edgeIds);
6299
+ const distanceVec = makeVecDouble(Module, distances);
6300
+ const angleVec = makeVecDouble(Module, anglesDeg);
6301
+ const faceVec = makeVecU32(Module, faceIds);
6302
+ const hashVec = makeVecInt(Module, inputFaceHashes);
6303
+ try {
6304
+ const { id, evolution } = parseEvolution(reportingFaultyEdges(edges, () => withHistory(shapeId, edgeVec, distanceVec, angleVec, faceVec, hashVec, hashUpperBound)));
6305
+ return {
6306
+ shape: wrapResult(k, id),
6307
+ evolution
6308
+ };
6309
+ } finally {
6310
+ edgeVec.delete();
6311
+ distanceVec.delete();
6312
+ angleVec.delete();
6313
+ faceVec.delete();
6314
+ hashVec.delete();
6315
+ }
6316
+ }
6207
6317
  function shellWithHistory(k, Module, shape, faces, thickness, inputFaceHashes, hashUpperBound, tolerance) {
6208
6318
  const faceVec = makeVecU32(Module, faces.map(unwrap));
6209
6319
  const hashVec = makeVecInt(Module, inputFaceHashes);
@@ -6713,6 +6823,9 @@ var OcctWasmAdapter = class OcctWasmAdapter {
6713
6823
  chamferWithHistory(shape, edges, distance, inputFaceHashes, hashUpperBound) {
6714
6824
  return chamferWithHistory(this.k, this.Module, shape, edges, distance, inputFaceHashes, hashUpperBound);
6715
6825
  }
6826
+ chamferDistAnglesWithHistory(shape, edges, inputFaceHashes, hashUpperBound) {
6827
+ return chamferDistAnglesWithHistory(this.k, this.Module, shape, edges, inputFaceHashes, hashUpperBound);
6828
+ }
6716
6829
  shellWithHistory(shape, faces, thickness, inputFaceHashes, hashUpperBound, tolerance) {
6717
6830
  return shellWithHistory(this.k, this.Module, shape, faces, thickness, inputFaceHashes, hashUpperBound, tolerance);
6718
6831
  }