@bitbybit-dev/cad-cloud-sdk 1.1.1 → 1.2.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/client.d.ts.map +1 -1
  2. package/dist/client.js +5 -15
  3. package/dist/client.js.map +1 -1
  4. package/dist/endpoints/cad.d.ts.map +1 -1
  5. package/dist/endpoints/cad.js +0 -3
  6. package/dist/endpoints/cad.js.map +1 -1
  7. package/dist/endpoints/convert.d.ts.map +1 -1
  8. package/dist/endpoints/convert.js +0 -3
  9. package/dist/endpoints/convert.js.map +1 -1
  10. package/dist/endpoints/files.d.ts.map +1 -1
  11. package/dist/endpoints/files.js +0 -3
  12. package/dist/endpoints/files.js.map +1 -1
  13. package/dist/endpoints/models.d.ts.map +1 -1
  14. package/dist/endpoints/models.js +0 -3
  15. package/dist/endpoints/models.js.map +1 -1
  16. package/dist/endpoints/tasks.d.ts.map +1 -1
  17. package/dist/endpoints/tasks.js +0 -3
  18. package/dist/endpoints/tasks.js.map +1 -1
  19. package/dist/errors.d.ts +4 -4
  20. package/dist/errors.d.ts.map +1 -1
  21. package/dist/errors.js +0 -3
  22. package/dist/errors.js.map +1 -1
  23. package/dist/fetch-downloads.d.ts.map +1 -1
  24. package/dist/fetch-downloads.js +0 -3
  25. package/dist/fetch-downloads.js.map +1 -1
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +0 -8
  28. package/dist/index.js.map +1 -1
  29. package/dist/polling.d.ts.map +1 -1
  30. package/dist/polling.js +0 -3
  31. package/dist/polling.js.map +1 -1
  32. package/dist/types/custom.d.ts.map +1 -1
  33. package/dist/types/custom.js +0 -5
  34. package/dist/types/custom.js.map +1 -1
  35. package/dist/types/generated.d.ts +19 -6
  36. package/dist/types/generated.d.ts.map +1 -1
  37. package/dist/types/index.d.ts.map +1 -1
  38. package/dist/types/index.js +0 -7
  39. package/dist/types/index.js.map +1 -1
  40. package/dist/types/pipeline-operations.d.ts +54 -46
  41. package/dist/types/pipeline-operations.d.ts.map +1 -1
  42. package/dist/types/pipeline-operations.js +1 -1
  43. package/dist/types/pipeline-operations.js.map +1 -1
  44. package/dist/unwrap.d.ts.map +1 -1
  45. package/dist/unwrap.js +0 -3
  46. package/dist/unwrap.js.map +1 -1
  47. package/dist/validation/validator.d.ts.map +1 -1
  48. package/dist/validation/validator.js +0 -8
  49. package/dist/validation/validator.js.map +1 -1
  50. package/package.json +6 -3
  51. package/src/__test__/helpers.ts +71 -0
  52. package/src/__test__/index.ts +1 -0
  53. package/src/client.test.ts +206 -0
  54. package/src/client.ts +153 -0
  55. package/src/endpoints/cad.test.ts +101 -0
  56. package/src/endpoints/cad.ts +53 -0
  57. package/src/endpoints/convert.test.ts +154 -0
  58. package/src/endpoints/convert.ts +83 -0
  59. package/src/endpoints/files.test.ts +170 -0
  60. package/src/endpoints/files.ts +89 -0
  61. package/src/endpoints/index.ts +5 -0
  62. package/src/endpoints/models.test.ts +228 -0
  63. package/src/endpoints/models.ts +131 -0
  64. package/src/endpoints/tasks.test.ts +193 -0
  65. package/src/endpoints/tasks.ts +93 -0
  66. package/src/errors.test.ts +57 -0
  67. package/src/errors.ts +21 -0
  68. package/src/fetch-downloads.test.ts +67 -0
  69. package/src/fetch-downloads.ts +18 -0
  70. package/src/index.ts +19 -0
  71. package/src/polling.test.ts +194 -0
  72. package/src/polling.ts +81 -0
  73. package/src/types/custom.ts +45 -0
  74. package/src/types/generated.ts +3136 -0
  75. package/src/types/index.ts +3 -0
  76. package/src/types/pipeline-operations.ts +9008 -0
  77. package/src/types/schema-exports.ts +228 -0
  78. package/src/unwrap.test.ts +75 -0
  79. package/src/unwrap.ts +20 -0
  80. package/src/validation/index.ts +1 -0
  81. package/src/validation/request-schemas.ts +1001 -0
  82. package/src/validation/validator.test.ts +218 -0
  83. package/src/validation/validator.ts +60 -0
@@ -1427,7 +1427,7 @@ export interface OperationParams {
1427
1427
  /** Applies NOT operator to flip all boolean values in a list. Example: [true, false, true] → [false, true, false] */
1428
1428
  "logic.notList": {
1429
1429
  /** Boolean value */
1430
- booleans: unknown | PipelineRef;
1430
+ booleans: unknown[] | PipelineRef;
1431
1431
  };
1432
1432
  /** Generates a random boolean list where each value has a threshold chance of being true. Example: length=5, threshold=0.7 → might produce [true, true, false, true, true] */
1433
1433
  "logic.randomBooleans": {
@@ -1652,7 +1652,7 @@ export interface OperationParams {
1652
1652
  /** Circular segments */
1653
1653
  circularSegments?: number | PipelineRef;
1654
1654
  };
1655
- /** Remove vertices from the contours in this CrossSection that are less than the specified distance epsilon from an imaginary line that passes through its two adjacent vertices. Near duplicate vertices and collinear points will be removed at lower epsilons, with elimination of line segments becoming increasingly aggressive with larger epsilons. It is recommended to apply this function following Offset, in order to clean up any spurious tiny line segments introduced that do not improve offseting operations are to be performed, which would compound the issue. */
1655
+ /** Remove vertices from the contours in this CrossSection that are less than the specified distance epsilon from an imaginary line that passes through its two adjacent vertices. Near duplicate vertices and collinear points will be removed at lower epsilons, with elimination of line segments becoming increasingly aggressive with larger epsilons. It is recommended to apply this function following Offset, in order to clean up any spurious tiny line segments introduced that do not improve quality in any meaningful way. This is particularly important if further offseting operations are to be performed, which would compound the issue. */
1656
1656
  "manifold.crossSection.operations.simplify": {
1657
1657
  /** Revolve cross section shape */
1658
1658
  crossSection: unknown | PipelineRef;
@@ -1825,7 +1825,7 @@ export interface OperationParams {
1825
1825
  /** The offset from the origin */
1826
1826
  originOffset?: number | PipelineRef;
1827
1827
  };
1828
- /** Split manifold by plane on various offsets */
1828
+ /** Split manifold by plane on various offsets. Each cut takes the part below the plane as a finished piece and carries the part above it to the next, larger offset, so a run of n offsets yields n + 1 pieces and accounts for the whole of the solid. */
1829
1829
  "manifold.manifold.booleans.splitByPlaneOnOffsets": {
1830
1830
  /** Manifold that will be split */
1831
1831
  manifold: unknown | PipelineRef;
@@ -2139,7 +2139,7 @@ export interface OperationParams {
2139
2139
  /** Manifold shape */
2140
2140
  manifold: unknown | PipelineRef;
2141
2141
  /** The normal vector of the plane to be mirrored over */
2142
- factor?: number | PipelineRef;
2142
+ vector?: [number, number, number] | PipelineRef;
2143
2143
  };
2144
2144
  /** Scales a manifold shape with 3D vector */
2145
2145
  "manifold.manifold.transforms.scale3D": {
@@ -2246,8 +2246,8 @@ export interface OperationParams {
2246
2246
  "manifold.mesh.evaluate.transform": {
2247
2247
  /** Mesh */
2248
2248
  mesh: unknown | PipelineRef;
2249
- /** Vertex index */
2250
- vertexIndex?: number | PipelineRef;
2249
+ /** Triangle run index */
2250
+ triangleRunIndex?: number | PipelineRef;
2251
2251
  };
2252
2252
  /** Gets the three vertex indices of this triangle in CCW order. */
2253
2253
  "manifold.mesh.evaluate.verts": {
@@ -2556,7 +2556,7 @@ export interface OperationParams {
2556
2556
  /** Maximum value */
2557
2557
  max?: number | PipelineRef;
2558
2558
  };
2559
- /** Build an assembly document from a structure definition. Returns the document handle directly - document stays in worker memory. This is the recommended approach for creating assemblies: 1. Define parts with shapes, names, and optional colors 2. Define nodes (assemblies and instances) with hierarchy and transforms 3. Call this method to create the document 4. Query the document or to STEP/glTF 5. Call deleteDocument() to release memory when done If existingDocument is provided and valid, the document will be cleared and updated instead of creating a new one. This is useful for updating an assembly without allocating a new document each time. ```typescript // Create new document const structure = await occt.assembly.manager.combineStructure({ parts, nodes }); const document = await occt.assembly.manager.buildAssemblyDocument({ structure }); // Update existing document (reuses same handle) const updatedStructure = await occt.assembly.manager.combineStructure({ parts: newParts, nodes: newNodes }); await occt.assembly.manager.buildAssemblyDocument({ structure: updatedStructure, existingDocument: document }); // Cleanup await occt.assembly.manager.deleteDocument({ document }); ``` */
2559
+ /** Build an assembly document from a structure definition. Returns the document handle directly - document stays in worker memory. This is the recommended approach for creating assemblies: 1. Define parts with shapes, names, and optional colors 2. Define nodes (assemblies and instances) with hierarchy and transforms 3. Call this method to create the document 4. Query the document or export to STEP/glTF 5. Call deleteDocument() to release memory when done If existingDocument is provided and valid, the document will be cleared and updated instead of creating a new one. This is useful for updating an assembly without allocating a new document each time. When updating an existing document (existingDocument provided): - If `structure.removals` is provided, those labels are removed first - If `structure.partUpdates` is provided, those parts are updated (shape, name, color) - New `parts` and `nodes` are added to the document - If neither `removals` nor `partUpdates` is provided, the document is cleared first (backward compatible) - Use `clearDocument: false` in structure to preserve existing content while adding new parts/nodes */
2560
2560
  "occt.assembly.manager.buildAssemblyDocument": {
2561
2561
  /** Assembly structure definition with parts and nodes */
2562
2562
  structure: unknown | PipelineRef;
@@ -2565,13 +2565,13 @@ export interface OperationParams {
2565
2565
  /** Optional array of source document handles referenced by `structure.loadedParts` entries via `sourceDocumentIndex`. Typically these are documents previously loaded with loadStepToDoc. Lifetime of source documents is the caller's responsibility — they are not modified or deleted by buildAssemblyDocument. */
2566
2566
  sourceDocuments?: unknown[] | PipelineRef;
2567
2567
  };
2568
- /** Combine parts and nodes into a complete assembly structure definition. This is the final step before calling buildAssemblyDocument. ```typescript const parts = [part1, part2]; const nodes = [rootAsm, inst1, inst2]; const structure = await occt.assembly.manager.combineStructure({ parts, nodes }); const result = await occt.assembly.manager.buildAssemblyDocument({ structure }); ``` */
2568
+ /** Combine parts and nodes into a complete assembly structure definition. This is the final step before calling buildAssemblyDocument. */
2569
2569
  "occt.assembly.manager.combineStructure": {
2570
2570
  /** Labels to remove from existing document. Can be part labels, instance labels, or assembly labels. Ignored when creating a new document (no existingDocument provided). */
2571
2571
  removals: unknown[] | PipelineRef;
2572
2572
  /** Updates to apply to existing parts in the document. Each update can change the shape, name, and/or color of a part. Ignored when creating a new document (no existingDocument provided). */
2573
2573
  partUpdates: unknown[] | PipelineRef;
2574
- /** source document via `sourceDocumentIndex` (matching the order of `sourceDocuments` on buildAssemblyDocument) and copies a label (or all free shapes) into this assembly, preserving sub-assembly hierarchy, names and colors. Instance nodes can then reference */
2574
+ /** Parts imported from other documents (e.g. STEP-loaded). Each entry references a source document via `sourceDocumentIndex` (matching the order of `sourceDocuments` on buildAssemblyDocument) and copies a label (or all free shapes) into this assembly, preserving sub-assembly hierarchy, names and colors. Instance nodes can then reference them by `partId` to place the imported assembly multiple times with different transforms. */
2575
2575
  loadedParts: unknown[] | PipelineRef;
2576
2576
  /** List of part definitions (shapes that can be instanced) */
2577
2577
  parts?: unknown[] | PipelineRef;
@@ -2580,7 +2580,7 @@ export interface OperationParams {
2580
2580
  /** Whether to clear the existing document before adding new content. Only relevant when an existingDocument is provided to buildAssemblyDocument. - `true`: Clear all existing shapes, then add new parts/nodes (full rebuild) - `false`: Keep existing shapes, apply removals/updates, add new parts/nodes (incremental) */
2581
2581
  clearDocument?: boolean | PipelineRef;
2582
2582
  };
2583
- /** Create an assembly node definition (a container for other nodes). Assembly nodes group instances and other assemblies together in the hierarchy. ```typescript const rootAsm = await occt.assembly.manager.createAssemblyNode({ id: "root", name: "Root Assembly" }); const subAsm = await occt.assembly.manager.createAssemblyNode({ id: "sub", name: "Sub Assembly", parentId: "root" }); ``` */
2583
+ /** Create an assembly node definition (a container for other nodes). Assembly nodes group instances and other assemblies together in the hierarchy. */
2584
2584
  "occt.assembly.manager.createAssemblyNode": {
2585
2585
  /** Unique identifier for this assembly node */
2586
2586
  id: string | PipelineRef;
@@ -2593,17 +2593,20 @@ export interface OperationParams {
2593
2593
  /** Optional color for the assembly */
2594
2594
  colorRgba?: unknown | PipelineRef;
2595
2595
  };
2596
- /** (typically a STEP-loaded document) into the new assembly. Preserves sub-assembly hierarchy, names and colors. The result can be referenced by `partId` from any ```typescript const chairDoc = occt.assembly.manager.loadStepToDoc({ stepData }); const chair = occt.assembly.manager.createImportedPart({ id: "chair", sourceDocumentIndex: 0, name: "Chair" }); const i1 = occt.assembly.manager.createInstanceNode({ id: "c1", partId: "chair", name: "Chair 1", translation: [0,0,0] }); const i2 = occt.assembly.manager.createInstanceNode({ id: "c2", partId: "chair", name: "Chair 2", translation: [500,0,0] }); const structure = occt.assembly.manager.combineStructure({ parts: [], nodes: [i1, i2], loadedParts: [chair] }); const doc = occt.assembly.manager.buildAssemblyDocument({ structure, sourceDocuments: [chairDoc] }); ``` */
2596
+ /** Create an imported part definition that copies a label tree from another document (typically a STEP-loaded document) into the new assembly. Preserves sub-assembly hierarchy, names and colors. The result can be referenced by `partId` from any instance node to place the imported assembly multiple times. */
2597
2597
  "occt.assembly.manager.createImportedPart": {
2598
+ /** Unique identifier for referencing this imported part from instance nodes (via partId). */
2598
2599
  id: string | PipelineRef;
2599
- /** Optional OCAF entry string of the label to copy from the source document (e.g. "0:1:1:1"). assembly compound when there are multiple). */
2600
+ /** Optional OCAF entry string of the label to copy from the source document (e.g. "0:1:1:1"). If omitted, all free shapes of the source document are imported (wrapped in a new assembly compound when there are multiple). */
2600
2601
  sourceLabel: string | PipelineRef;
2602
+ /** Optional display name override applied to the imported root label. */
2601
2603
  name: string | PipelineRef;
2604
+ /** Optional color override applied to the imported root label. */
2602
2605
  colorRgba: unknown | PipelineRef;
2603
2606
  /** Index into the `sourceDocuments` array passed to buildAssemblyDocument. */
2604
2607
  sourceDocumentIndex?: number | PipelineRef;
2605
2608
  };
2606
- /** Create an instance node definition (a reference to a part with transform). Instance nodes place a part at a specific location with optional translation, rotation, and scale. ```typescript const inst1 = await occt.assembly.manager.createInstanceNode({ id: "box1", partId: "box", name: "Box 1" }); const inst2 = await occt.assembly.manager.createInstanceNode({ id: "box2", partId: "box", name: "Box 2", translation: [20, 0, 0], rotation: [0, 0, 45] }); ``` */
2609
+ /** Create an instance node definition (a reference to a part with transform). Instance nodes place a part at a specific location with optional translation, rotation, and scale. */
2607
2610
  "occt.assembly.manager.createInstanceNode": {
2608
2611
  /** Unique identifier for this instance node */
2609
2612
  id: string | PipelineRef;
@@ -2624,7 +2627,7 @@ export interface OperationParams {
2624
2627
  /** Uniform scale factor */
2625
2628
  scale?: number | PipelineRef;
2626
2629
  };
2627
- /** Create a part definition for use in assembly structures. This is a helper for visual programming - it simply wraps the inputs into a part object. ```typescript const box = await occt.shapes.solid.createBox({ width: 10, length: 10, height: 10 }); const part = await occt.assembly.manager.createPart({ id: "box", shape: box, name: "Box", color: { r: 1, g: 0, b: 0, a: 1 } }); ``` */
2630
+ /** Create a part definition for use in assembly structures. This is a helper for visual programming - it simply wraps the inputs into a part object. */
2628
2631
  "occt.assembly.manager.createPart": {
2629
2632
  /** Unique identifier for referencing this part in nodes */
2630
2633
  id: string | PipelineRef;
@@ -2635,7 +2638,7 @@ export interface OperationParams {
2635
2638
  /** Optional color for the part (RGBA, values 0-1) */
2636
2639
  colorRgba?: unknown | PipelineRef;
2637
2640
  };
2638
- /** Create a part update definition for modifying an existing part in a document. Part updates can change the shape, name, and/or color of an existing part. ```typescript // Get existing parts from document const parts = await occt.assembly.query.getDocumentParts({ document }); // Create a new shape to replace the old one const newBox = await occt.shapes.solid.createBox({ width: 20, length: 20, height: 20 }); // Create an update definition const update = await occt.assembly.manager.createPartUpdate({ label: parts[0].label, shape: newBox, name: "Bigger Box", colorRgba: { r: 0, g: 1, b: 0, a: 1 } }); // Combine with structure and rebuild const structure = await occt.assembly.manager.combineStructure({ parts: [], nodes: [], partUpdates: [update] }); await occt.assembly.manager.buildAssemblyDocument({ structure, existingDocument: document }); ``` */
2641
+ /** Create a part update definition for modifying an existing part in a document. Part updates can change the shape, name, and/or color of an existing part. */
2639
2642
  "occt.assembly.manager.createPartUpdate": {
2640
2643
  /** Label of the existing part to update (e.g., "0:1:1:1"). Obtain this from document queries like getDocumentParts. */
2641
2644
  label: string | PipelineRef;
@@ -2646,12 +2649,12 @@ export interface OperationParams {
2646
2649
  /** New color for the part. If undefined, the color is not changed. */
2647
2650
  colorRgba: unknown | PipelineRef;
2648
2651
  };
2649
- /** Delete an assembly document and release its memory. Call this when done with the document to free resources. ```typescript const document = await occt.assembly.manager.buildAssemblyDocument({ structure }); // ... use the document ... await occt.assembly.manager.deleteDocument({ document }); ``` */
2652
+ /** Delete an assembly document and release its memory. Call this when done with the document to free resources. */
2650
2653
  "occt.assembly.manager.deleteDocument": {
2651
2654
  /** Assembly document handle from buildAssemblyDocument or loadStepToDoc */
2652
2655
  document: unknown | PipelineRef;
2653
2656
  };
2654
- /** Export an assembly document to glTF binary (GLB) format. ```typescript const document = await occt.assembly.manager.buildAssemblyDocument({ structure }); const glbData = await occt.assembly.manager.exportDocumentToGltf({ document, meshDeflection: 0.1, tryDownload: true }); ``` */
2657
+ /** Export an assembly document to glTF binary (GLB) format. */
2655
2658
  "occt.assembly.manager.exportDocumentToGltf": {
2656
2659
  /** Assembly document handle from buildAssemblyDocument or loadStepToDoc */
2657
2660
  document: unknown | PipelineRef;
@@ -2665,14 +2668,14 @@ export interface OperationParams {
2665
2668
  controlSurfaceDeflection?: boolean | PipelineRef;
2666
2669
  /** Whether to merge faces with same material for optimization. Set to false to preserve face boundaries. */
2667
2670
  mergeFaces?: boolean | PipelineRef;
2668
- /** Whether to texture coordinates (UVs). */
2671
+ /** Whether to export texture coordinates (UVs). */
2669
2672
  forceUVExport?: boolean | PipelineRef;
2670
2673
  /** File name for download (optional, should end with .glb) */
2671
2674
  fileName?: string | PipelineRef;
2672
2675
  /** Whether to trigger a file download in the browser */
2673
2676
  tryDownload?: boolean | PipelineRef;
2674
2677
  };
2675
- /** Export an assembly document to glTF binary (GLB) format with explicit Draco geometry compression settings. ```typescript const document = await occt.assembly.manager.buildAssemblyDocument({ structure }); const glbData = await occt.assembly.manager.exportDocumentToGltfWithDraco({ document, meshDeflection: 0.1, useDraco: true, dracoCompressionLevel: 7, tryDownload: true }); ``` */
2678
+ /** Export an assembly document to glTF binary (GLB) format with explicit Draco geometry compression settings. */
2676
2679
  "occt.assembly.manager.exportDocumentToGltfWithDraco": {
2677
2680
  /** Assembly document handle from buildAssemblyDocument or loadStepToDoc */
2678
2681
  document: unknown | PipelineRef;
@@ -2680,7 +2683,7 @@ export interface OperationParams {
2680
2683
  tryDownload?: boolean | PipelineRef;
2681
2684
  /** File name for download (optional, should end with .glb) */
2682
2685
  fileName?: string | PipelineRef;
2683
- /** Whether to texture coordinates (UVs). */
2686
+ /** Whether to export texture coordinates (UVs). */
2684
2687
  forceUVExport?: boolean | PipelineRef;
2685
2688
  /** Whether to merge faces with same material for optimization. Set to false to preserve face boundaries. */
2686
2689
  mergeFaces?: boolean | PipelineRef;
@@ -2709,7 +2712,7 @@ export interface OperationParams {
2709
2712
  /** Apply a single quantization grid across all attributes. */
2710
2713
  dracoUnifiedQuantization?: boolean | PipelineRef;
2711
2714
  };
2712
- /** Export an assembly document to STEP format. ```typescript const document = await occt.assembly.manager.buildAssemblyDocument({ structure }); const stepData = await occt.assembly.manager.exportDocumentToStep({ document, fileName: "my-assembly.step", author: "John Doe", tryDownload: true }); ``` */
2715
+ /** Export an assembly document to STEP format. */
2713
2716
  "occt.assembly.manager.exportDocumentToStep": {
2714
2717
  /** Assembly document handle from buildAssemblyDocument or loadStepToDoc */
2715
2718
  document: unknown | PipelineRef;
@@ -2724,12 +2727,12 @@ export interface OperationParams {
2724
2727
  /** Whether to trigger a file download in the browser */
2725
2728
  tryDownload?: boolean | PipelineRef;
2726
2729
  };
2727
- /** Load a STEP file into a new assembly document. Supports both regular STEP and gzip-compressed STEP-Z. ```typescript const stepData = await fetch("model.step").then(r => r.text()); const document = await occt.assembly.manager.loadStepToDoc({ stepData }); const parts = await occt.assembly.query.getDocumentParts({ document }); console.log("Found parts:", parts); ``` */
2730
+ /** Load a STEP file into a new assembly document. Supports both regular STEP and gzip-compressed STEP-Z. */
2728
2731
  "occt.assembly.manager.loadStepToDoc": {
2729
2732
  /** STEP file content. Accepts string, ArrayBuffer, Uint8Array, File, or Blob. Supports both regular STEP and gzip-compressed STEP-Z. */
2730
2733
  stepData: unknown | PipelineRef;
2731
2734
  };
2732
- /** Set the color of a label in the document. Colors are preserved when exporting to STEP and other formats. ```typescript const success = await occt.assembly.manager.setDocLabelColor({ document, label: "0:1:1:1", r: 255, g: 0, b: 0, a: 255 }); ``` */
2735
+ /** Set the color of a label in the document. Colors are preserved when exporting to STEP and other formats. */
2733
2736
  "occt.assembly.manager.setDocLabelColor": {
2734
2737
  /** Assembly document handle from buildAssemblyDocument or loadStepToDoc */
2735
2738
  document: unknown | PipelineRef;
@@ -2744,7 +2747,7 @@ export interface OperationParams {
2744
2747
  /** Alpha component (0.0 - 1.0, 1.0 = opaque) */
2745
2748
  a?: number | PipelineRef;
2746
2749
  };
2747
- /** Set or change the name of a label (part, instance, or assembly). ```typescript const success = await occt.assembly.manager.setDocLabelName({ document, label: "0:1:1:1", name: "Updated Part Name" }); ``` */
2750
+ /** Set or change the name of a label (part, instance, or assembly). */
2748
2751
  "occt.assembly.manager.setDocLabelName": {
2749
2752
  /** Assembly document handle from buildAssemblyDocument or loadStepToDoc */
2750
2753
  document: unknown | PipelineRef;
@@ -2753,38 +2756,38 @@ export interface OperationParams {
2753
2756
  /** New name */
2754
2757
  name?: string | PipelineRef;
2755
2758
  };
2756
- /** Get full assembly hierarchy as structured data. ```typescript const hierarchy = await occt.assembly.query.getAssemblyHierarchy({ document }); console.log("Root nodes:", hierarchy.roots); ``` */
2759
+ /** Get full assembly hierarchy as structured data. */
2757
2760
  "occt.assembly.query.getAssemblyHierarchy": {
2758
2761
  /** Assembly document handle from buildAssemblyDocument or loadStepToDoc */
2759
2762
  document: unknown | PipelineRef;
2760
2763
  };
2761
- /** Get all parts and assemblies in the document. ```typescript const parts = await occt.assembly.query.getDocumentParts({ document }); for (const part of parts) { console.log(`${part.name}: ${part.type} at label ${part.label}`); } ``` */
2764
+ /** Get all parts and assemblies in the document. */
2762
2765
  "occt.assembly.query.getDocumentParts": {
2763
2766
  /** Assembly document handle from buildAssemblyDocument or loadStepToDoc */
2764
2767
  document: unknown | PipelineRef;
2765
2768
  };
2766
- /** Get the color of a label. ```typescript const colorInfo = await occt.assembly.query.getLabelColor({ document, label: "0:1:1:1" }); if (colorInfo.hasColor) { console.log(`Color: rgb(${colorInfo.r}, ${colorInfo.g}, ${colorInfo.b})`); } ``` */
2769
+ /** Get the color of a label. */
2767
2770
  "occt.assembly.query.getLabelColor": {
2768
2771
  /** Assembly document handle from buildAssemblyDocument or loadStepToDoc */
2769
2772
  document: unknown | PipelineRef;
2770
2773
  /** Label entry string (e.g., "0:1:1:1") */
2771
2774
  label: string | PipelineRef;
2772
2775
  };
2773
- /** Get detailed info about a label. ```typescript const info = await occt.assembly.query.getLabelInfo({ document, label: "0:1:1:1" }); console.log(`Type: ${info.type}, Is assembly: ${info.isAssembly}`); ``` */
2776
+ /** Get detailed info about a label. */
2774
2777
  "occt.assembly.query.getLabelInfo": {
2775
2778
  /** Assembly document handle from buildAssemblyDocument or loadStepToDoc */
2776
2779
  document: unknown | PipelineRef;
2777
2780
  /** Label entry string (e.g., "0:1:1:1") */
2778
2781
  label: string | PipelineRef;
2779
2782
  };
2780
- /** Get the transformation of an instance label. ```typescript const transform = await occt.assembly.query.getLabelTransform({ document, label: "0:1:1:1" }); console.log("Translation:", transform.translation); console.log("Rotation (quaternion):", transform.quaternion); ``` */
2783
+ /** Get the transformation of an instance label. */
2781
2784
  "occt.assembly.query.getLabelTransform": {
2782
2785
  /** Assembly document handle from buildAssemblyDocument or loadStepToDoc */
2783
2786
  document: unknown | PipelineRef;
2784
2787
  /** Label entry string (e.g., "0:1:1:1") */
2785
2788
  label: string | PipelineRef;
2786
2789
  };
2787
- /** Get a shape from a label in an assembly document. ```typescript const shape = await occt.assembly.query.getShapeFromLabel({ document, label: "0:1:1:1" }); const mesh = await occt.shapes.face.getFaceMeshes({ shape }); ``` */
2790
+ /** Get a shape from a label in an assembly document. */
2788
2791
  "occt.assembly.query.getShapeFromLabel": {
2789
2792
  /** Assembly document handle from buildAssemblyDocument or loadStepToDoc */
2790
2793
  document: unknown | PipelineRef;
@@ -3502,7 +3505,7 @@ export interface OperationParams {
3502
3505
  /** Mesh precision (linear deflection) for triangulation. Smaller = finer mesh. */
3503
3506
  meshPrecision?: number | PipelineRef;
3504
3507
  };
3505
- /** Convert a STEP file to glTF format with full control over all options. This advanced method allows fine-grained control over: - STEP reading options (colors, names, materials, layers, props) - Mesh generation options (deflection, angle, parallel, threshold) - glTF options (merge faces, indices, naming, transforms) Use this for performance tuning - disable features you don't need for faster processing. ```typescript // Fast conversion - only colors, no names (for large files) const glbData = await occt.io.convertStepToGltfAdvanced({ stepData: stepContent, readColors: true, readNames: false, // Skip name parsing for speed readMaterials: true, readLayers: false, readProps: false, meshDeflection: 0.1, meshParallel: true, mergeFaces: true }); ``` */
3508
+ /** Convert a STEP file to glTF format with full control over all options. This advanced method allows fine-grained control over: - STEP reading options (colors, names, materials, layers, props) - Mesh generation options (deflection, angle, parallel, threshold) - glTF export options (merge faces, indices, naming, transforms) Use this for performance tuning - disable features you don't need for faster processing. */
3506
3509
  "occt.io.convertStepToGltfAdvanced": {
3507
3510
  /** STEP data as string (for plain text files), ArrayBuffer, Uint8Array, File, or Blob. Supports compressed .stpz files - gzip-compressed data is automatically decompressed. */
3508
3511
  stepData: unknown | PipelineRef;
@@ -3551,7 +3554,7 @@ export interface OperationParams {
3551
3554
  /** Scale factor for the model. Useful for unit conversion (e.g., 0.001 to convert mm to meters). Set to 1.0 for no scaling. */
3552
3555
  scale?: number | PipelineRef;
3553
3556
  };
3554
- /** Convert a STEP file to glTF format with full control over all reading, meshing and writer options, plus explicit Draco geometry compression settings. Same fast path as `convertStepToGltfAdvanced` but exposes the 8 Draco knobs. settings and Draco knobs. */
3557
+ /** Convert a STEP file to glTF format with full control over all reading, meshing and writer options, plus explicit Draco geometry compression settings. Same fast path as `convertStepToGltfAdvanced` but exposes the 8 Draco knobs. */
3555
3558
  "occt.io.convertStepToGltfAdvancedWithDraco": {
3556
3559
  /** STEP data as string (for plain text files), ArrayBuffer, Uint8Array, File, or Blob. Supports compressed .stpz files - gzip-compressed data is automatically decompressed. */
3557
3560
  stepData: unknown | PipelineRef;
@@ -3616,7 +3619,7 @@ export interface OperationParams {
3616
3619
  /** Apply a single quantization grid across all attributes. */
3617
3620
  dracoUnifiedQuantization?: boolean | PipelineRef;
3618
3621
  };
3619
- /** Convert a STEP file to glTF format (binary GLB) with explicit Draco geometry compression settings. Same fast path as `convertStepToGltf` but exposes the Draco knobs of the underlying native function. Accepts File, Blob, string, ArrayBuffer, or Uint8Array. */
3622
+ /** Convert a STEP file to glTF format (binary GLB) with explicit Draco geometry compression settings. Same fast path as `convertStepToGltf` but exposes the Draco knobs of the underlying native function. */
3620
3623
  "occt.io.convertStepToGltfWithDraco": {
3621
3624
  /** STEP data as string (for plain text files), ArrayBuffer, Uint8Array, File, or Blob. Supports compressed .stpz files - gzip-compressed data is automatically decompressed. */
3622
3625
  stepData: unknown | PipelineRef;
@@ -3678,7 +3681,7 @@ export interface OperationParams {
3678
3681
  /** Adjusts models that use Z coordinate as up to Y up system. */
3679
3682
  adjustZtoY?: boolean | PipelineRef;
3680
3683
  };
3681
- /** Parse a STEP file and return the assembly structure as JSON. Uses OCCT's native XCAFPrs_DocumentExplorer for efficient traversal. Runs entirely in C++ for maximum performance. Returns an object containing an array of nodes with: - id: Unique path identifier for each node - name: Part or assembly name - isAssembly: Whether this is an assembly node (has children) - visible: Visibility flag - color: Surface color (if set) with r, g, b, a components - transform: 4x4 transformation matrix in column-major order (if not identity) */
3684
+ /** Parse a STEP file and return the assembly structure as JSON. Uses OCCT's native XCAFPrs_DocumentExplorer for efficient traversal. Runs entirely in C++ for maximum performance. Returns an object containing an array of nodes with: - id: Unique path identifier for each node - name: Part or assembly name - isAssembly: Whether this is an assembly node (has children) - visible: Visibility flag - colorRgba: Surface color (if set) with r, g, b, a components - transform: 4x4 transformation matrix in column-major order (if not identity) */
3682
3685
  "occt.io.parseStepToJson": {
3683
3686
  /** STEP data as string (for plain text files), ArrayBuffer, Uint8Array, File, or Blob. Supports compressed .stpz files - gzip-compressed data is automatically decompressed. */
3684
3687
  stepData: unknown | PipelineRef;
@@ -4318,8 +4321,8 @@ export interface OperationParams {
4318
4321
  };
4319
4322
  /** Creates linear edges from base lines format {start: Point3, end: Point3}[] */
4320
4323
  "occt.shapes.edge.fromBaseLines": {
4321
- /** Line */
4322
- line: unknown | PipelineRef;
4324
+ /** Lines */
4325
+ lines: unknown[] | PipelineRef;
4323
4326
  };
4324
4327
  /** Creates linear edges from mesh definition */
4325
4328
  "occt.shapes.edge.fromBaseMesh": {
@@ -4842,8 +4845,10 @@ export interface OperationParams {
4842
4845
  };
4843
4846
  /** Creates a face from the surface */
4844
4847
  "occt.shapes.face.faceFromSurface": {
4845
- /** Shape on which action should be performed */
4848
+ /** The shape */
4846
4849
  shape: unknown | PipelineRef;
4850
+ /** Tolerance used for intersections */
4851
+ tolerance?: number | PipelineRef;
4847
4852
  };
4848
4853
  /** Creates a face from the surface and a wire */
4849
4854
  "occt.shapes.face.faceFromSurfaceAndWire": {
@@ -5814,8 +5819,8 @@ export interface OperationParams {
5814
5819
  };
5815
5820
  /** Transform vertex to point */
5816
5821
  "occt.shapes.vertex.vertexToPoint": {
5817
- /** The OCCT shapes */
5818
- shapes: unknown[] | PipelineRef;
5822
+ /** Shape on which action should be performed */
5823
+ shape: unknown | PipelineRef;
5819
5824
  };
5820
5825
  /** Creates compound shape containing multiple vertices. This simply speeds up rendering and allows to apply occt transformations easily on vertex groups. */
5821
5826
  "occt.shapes.vertex.verticesCompoundFromPoints": {
@@ -6361,8 +6366,8 @@ export interface OperationParams {
6361
6366
  };
6362
6367
  /** Creates linear wires from base lines format {start: Point3, end: Point3}[] */
6363
6368
  "occt.shapes.wire.fromBaseLines": {
6364
- /** Line */
6365
- line: unknown | PipelineRef;
6369
+ /** Lines */
6370
+ lines: unknown[] | PipelineRef;
6366
6371
  };
6367
6372
  /** Creates wires from mesh definition */
6368
6373
  "occt.shapes.wire.fromBaseMesh": {
@@ -6725,7 +6730,7 @@ export interface OperationParams {
6725
6730
  /** Force every face to be re-meshed to the requested precision regardless of any cached triangulation (OCCT IMeshTools_Parameters.ForceFaceDeflection). */
6726
6731
  forceFaceDeflection?: boolean | PipelineRef;
6727
6732
  };
6728
- /** Parses an SVG document and builds a single compound shape containing every drawable element, the whole drawing as one shape. */
6733
+ /** Parses an SVG document and builds a single compound shape containing every drawable element, laid on the ground and aligned per the import options. Use this to draw, extrude or transform the whole drawing as one shape. */
6729
6734
  "occt.svg.loadSVG": {
6730
6735
  /** SVG document text. */
6731
6736
  svg?: string | PipelineRef;
@@ -6779,6 +6784,7 @@ export interface OperationParams {
6779
6784
  "occt.transforms.align": {
6780
6785
  /** Shape for translation */
6781
6786
  shape: unknown | PipelineRef;
6787
+ /** from origin */
6782
6788
  fromOrigin?: [number, number, number] | PipelineRef;
6783
6789
  /** From direction */
6784
6790
  fromDirection?: [number, number, number] | PipelineRef;
@@ -6809,6 +6815,7 @@ export interface OperationParams {
6809
6815
  "occt.transforms.alignNormAndAxis": {
6810
6816
  /** Shape for translation */
6811
6817
  shape: unknown | PipelineRef;
6818
+ /** from origin */
6812
6819
  fromOrigin?: [number, number, number] | PipelineRef;
6813
6820
  /** From direction 1 */
6814
6821
  fromNorm?: [number, number, number] | PipelineRef;
@@ -6825,6 +6832,7 @@ export interface OperationParams {
6825
6832
  "occt.transforms.alignShapes": {
6826
6833
  /** Shape for translation */
6827
6834
  shapes: unknown[] | PipelineRef;
6835
+ /** from origin */
6828
6836
  fromOrigins?: [number, number, number][] | PipelineRef;
6829
6837
  /** From direction */
6830
6838
  fromDirections?: [number, number, number][] | PipelineRef;
@@ -7304,7 +7312,7 @@ export interface OperationParams {
7304
7312
  /** The center from which the axis is pointing */
7305
7313
  center?: [number, number, number] | PipelineRef;
7306
7314
  };
7307
- /** Calculates the single safest maximum fillet radius that can be applied uniformly to all corners of collection of points, based on the 'half-line' constraint. This is determined by finding the minimum of the maximum possible fillet radii calculated for each individual corner. Returns 0 if the polyline has fewer than 3 points or if any calculated maximum radius is 0. */
7315
+ /** Calculates the single safest maximum fillet radius that can be applied uniformly to all corners of collection of points, based on the 'half-line' constraint. This is determined by finding the minimum of the maximum possible fillet radii calculated for each individual corner. */
7308
7316
  "point.safestPointsMaxFilletHalfLine": {
7309
7317
  /** Points to transform */
7310
7318
  points: [number, number, number][] | PipelineRef;
@@ -7428,7 +7436,7 @@ export interface OperationParams {
7428
7436
  /** Polyline with points */
7429
7437
  polyline: unknown | PipelineRef;
7430
7438
  };
7431
- /** Calculates the maximum possible half-line fillet radius for each corner of a given polyline. For a closed polyline, it includes the corners connecting the last segment back to the first. The calculation uses the 'half-line' constraint, meaning the fillet's tangent points must lie within the first half of each segment connected to the corner. The order corresponds to corners P[1]...P[n-2] for open polylines, and P[1]...P[n-2], P[0], P[n-1] for closed polylines. Returns an empty array if the polyline has fewer than 3 points. */
7439
+ /** Calculates the maximum possible half-line fillet radius for each corner of a given polyline. For a closed polyline, it includes the corners connecting the last segment back to the first. The calculation uses the 'half-line' constraint, meaning the fillet's tangent points must lie within the first half of each segment connected to the corner. */
7432
7440
  "polyline.maxFilletsHalfLine": {
7433
7441
  /** Polyline to check */
7434
7442
  polyline: unknown | PipelineRef;
@@ -7457,7 +7465,7 @@ export interface OperationParams {
7457
7465
  /** Polyline with points */
7458
7466
  polyline: unknown | PipelineRef;
7459
7467
  };
7460
- /** Calculates the single safest maximum fillet radius that can be applied uniformly to all corners of a polyline, based on the 'half-line' constraint. This is determined by finding the minimum of the maximum possible fillet radii calculated for each individual corner. Returns 0 if the polyline has fewer than 3 points or if any calculated maximum radius is 0. */
7468
+ /** Calculates the single safest maximum fillet radius that can be applied uniformly to all corners of a polyline, based on the 'half-line' constraint. This is determined by finding the minimum of the maximum possible fillet radii calculated for each individual corner. */
7461
7469
  "polyline.safestFilletRadius": {
7462
7470
  /** Polyline to check */
7463
7471
  polyline: unknown | PipelineRef;
@@ -7824,7 +7832,7 @@ export interface OperationParams {
7824
7832
  /** Second vector */
7825
7833
  second: number[] | PipelineRef;
7826
7834
  };
7827
- /** Checks if each element in the vector is finite and returns a boolean array. Example: [1, 2, Infinity, 3] → [true, true, false, true] vector that identifies if value is finite (true) or infinite (false) */
7835
+ /** Checks if each element in the vector is finite and returns a boolean array. Example: [1, 2, Infinity, 3] → [true, true, false, true] */
7828
7836
  "vector.finite": {
7829
7837
  /** Vector array of numbers */
7830
7838
  vector: number[] | PipelineRef;