forgecad 0.10.1 → 0.10.2

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 (59) hide show
  1. package/dist/assets/{AdminPage-DcCnj0qo.js → AdminPage-CHY6ZN-p.js} +1 -1
  2. package/dist/assets/{BenchmarkPage-BVEpJSVk.js → BenchmarkPage-BcRT5iGN.js} +1 -1
  3. package/dist/assets/{BlogPage-DHaGP50_.js → BlogPage-BssBbnb-.js} +1 -1
  4. package/dist/assets/{DocsPage-CDoxHkz8.js → DocsPage-DsvdiRNK.js} +1 -1
  5. package/dist/assets/{EditorApp-BJ0Dloyh.js → EditorApp-Bfd3jbtC.js} +18 -16
  6. package/dist/assets/{EmbedViewer-CRKZbY0y.js → EmbedViewer-D5t8WamV.js} +3 -3
  7. package/dist/assets/{LandingPageProofDriven-BxHkYRE7.js → LandingPageProofDriven-DbN7o-Be.js} +1 -1
  8. package/dist/assets/{LegalPage-B-u6FrVv.js → LegalPage-DNGrrY0p.js} +1 -1
  9. package/dist/assets/{PricingPage-CzpZ6-Ce.js → PricingPage-Nczr3pRz.js} +1 -1
  10. package/dist/assets/{SettingsPage-CIZSSAd0.js → SettingsPage-DZlyu4d4.js} +1 -1
  11. package/dist/assets/{app-DaTMg3nH.js → app-C9ct2hRD.js} +1154 -368
  12. package/dist/assets/{scalar-sampling-budget-prBw_s8t.js → backendInit-ymjonyQp.js} +84920 -78304
  13. package/dist/assets/cli/{render-DPf4AYJK.js → render-B_0lQwKU.js} +35 -179
  14. package/dist/assets/{constructionHistoryWorker-AwMMWSxg.js → constructionHistoryWorker-CZ42Dksy.js} +8058 -1225
  15. package/dist/assets/{evalWorker-CjZZWRWW.js → evalWorker-C2pm8LHP.js} +21596 -14770
  16. package/dist/assets/{forgecad_geometry-Dgceylq9.js → forgecad_geometry-BlMtqluF.js} +120 -1
  17. package/dist/assets/{forgecad_geometry_bg-dD4RNQF1.wasm → forgecad_geometry_bg-BllP_WiL.wasm} +0 -0
  18. package/dist/assets/{inspectWorker-CZsCFtQT.js → inspectWorker-D5T5VbfK.js} +31375 -32603
  19. package/dist/assets/{jointPose-DzQOViQH.js → jointPose-4r8ed8_5.js} +1 -1
  20. package/dist/assets/{manifold-K1SkarlQ.js → manifold-5PP1eGLN.js} +1 -1
  21. package/dist/assets/{manifold-DgXo0T5P.js → manifold-C4r6B-XY.js} +2 -2
  22. package/dist/assets/{manifold-BYlzU521.js → manifold-DjBkyIc8.js} +1 -1
  23. package/dist/assets/{reportWorker-B9nWwSrB.js → reportWorker-CwenM7wB.js} +45719 -44425
  24. package/dist/cli/render.html +1 -1
  25. package/dist/docs/index.html +1 -1
  26. package/dist/docs-raw/CLI.md +27 -15
  27. package/dist/docs-raw/generated/assembly.md +1 -1
  28. package/dist/docs-raw/generated/concepts.md +1 -1
  29. package/dist/docs-raw/generated/core.md +1 -1
  30. package/dist/docs-raw/generated/lib.md +1 -1
  31. package/dist/docs-raw/generated/sdf.md +2 -2
  32. package/dist/docs-raw/guides/simready-quickstart.md +3 -1
  33. package/dist/index.html +1 -1
  34. package/dist/sitemap.xml +15 -15
  35. package/dist-cli/{check-compiler-II7NLPAB.js → check-compiler-SP7FAL7R.js} +1 -1
  36. package/dist-cli/{check-query-propagation-7462TR3R.js → check-query-propagation-BRLSHP22.js} +1 -1
  37. package/dist-cli/{chunk-UWTJCGXF.js → chunk-RQQ42YCP.js} +50429 -43409
  38. package/dist-cli/forgecad.js +3017 -1390
  39. package/dist-cli/{forgecad_geometry-QOQIIP53.js → forgecad_geometry-7TVSNVUB.js} +119 -0
  40. package/dist-cli/forgecad_geometry_bg.wasm +0 -0
  41. package/dist-skill/CONTEXT.md +13 -13
  42. package/dist-skill/docs/API/core/concepts.md +1 -1
  43. package/dist-skill/docs/CLI.md +27 -15
  44. package/dist-skill/docs/generated/assembly.md +1 -1
  45. package/dist-skill/docs/generated/core.md +1 -1
  46. package/dist-skill/docs/generated/lib.md +1 -1
  47. package/dist-skill/docs/generated/sdf.md +2 -2
  48. package/examples/api/gyroid-voronoi-blend.forge.js +1 -1
  49. package/examples/api/organic-noise-sculpture.forge.js +1 -1
  50. package/examples/api/sdf-circular-array-knurling.forge.js +1 -1
  51. package/examples/api/{sdf-custom-raymarch.forge.js → sdf-custom-field-mesh-preview.forge.js} +3 -4
  52. package/examples/api/sdf-materialize-tree.forge.js +2 -2
  53. package/examples/api/sdf-plain-return.forge.js +3 -2
  54. package/examples/api/sdf-shapes.forge.js +2 -2
  55. package/examples/api/sdf-surface-basket-weave.forge.js +2 -2
  56. package/examples/generative/twisted-lattice-tower.forge.js +1 -1
  57. package/examples/generative/voronoi-lampshade.forge.js +1 -1
  58. package/package.json +2 -2
  59. package/dist/assets/manifold-CzYf_iub.js +0 -3023
@@ -154,6 +154,25 @@ function geometry_create_revolved_regions(regions_json, degrees, segments) {
154
154
  }
155
155
  return ret[0] >>> 0;
156
156
  }
157
+ function geometry_create_sdf_mesh(abi_version, opcodes, arg_a, arg_b, arg_c, constants, output, slot_count, options_json) {
158
+ const ptr0 = passArray8ToWasm0(opcodes, wasm.__wbindgen_malloc);
159
+ const len0 = WASM_VECTOR_LEN;
160
+ const ptr1 = passArray32ToWasm0(arg_a, wasm.__wbindgen_malloc);
161
+ const len1 = WASM_VECTOR_LEN;
162
+ const ptr2 = passArray32ToWasm0(arg_b, wasm.__wbindgen_malloc);
163
+ const len2 = WASM_VECTOR_LEN;
164
+ const ptr3 = passArray32ToWasm0(arg_c, wasm.__wbindgen_malloc);
165
+ const len3 = WASM_VECTOR_LEN;
166
+ const ptr4 = passArrayF64ToWasm0(constants, wasm.__wbindgen_malloc);
167
+ const len4 = WASM_VECTOR_LEN;
168
+ const ptr5 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
169
+ const len5 = WASM_VECTOR_LEN;
170
+ const ret = wasm.geometry_create_sdf_mesh(abi_version, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, output, slot_count, ptr5, len5);
171
+ if (ret[2]) {
172
+ throw takeFromExternrefTable0(ret[1]);
173
+ }
174
+ return ret[0] >>> 0;
175
+ }
157
176
  function geometry_create_side_profile_cut(spec_json) {
158
177
  const ptr0 = passStringToWasm0(spec_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
159
178
  const len0 = WASM_VECTOR_LEN;
@@ -249,6 +268,9 @@ function geometry_delete_nurbs_curve(handle) {
249
268
  function geometry_delete_nurbs_surface(handle) {
250
269
  wasm.geometry_delete_nurbs_surface(handle);
251
270
  }
271
+ function geometry_delete_sdf_mesh(handle) {
272
+ wasm.geometry_delete_sdf_mesh(handle);
273
+ }
252
274
  function geometry_export_step(handle) {
253
275
  let deferred2_0;
254
276
  let deferred2_1;
@@ -509,6 +531,47 @@ function geometry_sample_nurbs_surface(handle, u_samples, v_samples) {
509
531
  wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
510
532
  }
511
533
  }
534
+ function geometry_sdf_mesh_metadata(handle) {
535
+ let deferred2_0;
536
+ let deferred2_1;
537
+ try {
538
+ const ret = wasm.geometry_sdf_mesh_metadata(handle);
539
+ var ptr1 = ret[0];
540
+ var len1 = ret[1];
541
+ if (ret[3]) {
542
+ ptr1 = 0;
543
+ len1 = 0;
544
+ throw takeFromExternrefTable0(ret[2]);
545
+ }
546
+ deferred2_0 = ptr1;
547
+ deferred2_1 = len1;
548
+ return getStringFromWasm0(ptr1, len1);
549
+ } finally {
550
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
551
+ }
552
+ }
553
+ function geometry_sdf_mesh_tri_verts(handle) {
554
+ const ret = wasm.geometry_sdf_mesh_tri_verts(handle);
555
+ if (ret[3]) {
556
+ throw takeFromExternrefTable0(ret[2]);
557
+ }
558
+ var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
559
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
560
+ return v1;
561
+ }
562
+ function geometry_sdf_mesh_vert_properties(handle) {
563
+ const ret = wasm.geometry_sdf_mesh_vert_properties(handle);
564
+ if (ret[3]) {
565
+ throw takeFromExternrefTable0(ret[2]);
566
+ }
567
+ var v1 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
568
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
569
+ return v1;
570
+ }
571
+ function geometry_sdf_mesher_abi_version() {
572
+ const ret = wasm.geometry_sdf_mesher_abi_version();
573
+ return ret >>> 0;
574
+ }
512
575
  function geometry_select_edges(handle, query_json) {
513
576
  let deferred3_0;
514
577
  let deferred3_1;
@@ -621,9 +684,38 @@ function __wbg_get_imports() {
621
684
  "./forgecad_geometry_bg.js": import0
622
685
  };
623
686
  }
687
+ function getArrayF32FromWasm0(ptr, len) {
688
+ ptr = ptr >>> 0;
689
+ return getFloat32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
690
+ }
691
+ function getArrayU32FromWasm0(ptr, len) {
692
+ ptr = ptr >>> 0;
693
+ return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
694
+ }
695
+ var cachedFloat32ArrayMemory0 = null;
696
+ function getFloat32ArrayMemory0() {
697
+ if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) {
698
+ cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer);
699
+ }
700
+ return cachedFloat32ArrayMemory0;
701
+ }
702
+ var cachedFloat64ArrayMemory0 = null;
703
+ function getFloat64ArrayMemory0() {
704
+ if (cachedFloat64ArrayMemory0 === null || cachedFloat64ArrayMemory0.byteLength === 0) {
705
+ cachedFloat64ArrayMemory0 = new Float64Array(wasm.memory.buffer);
706
+ }
707
+ return cachedFloat64ArrayMemory0;
708
+ }
624
709
  function getStringFromWasm0(ptr, len) {
625
710
  return decodeText(ptr >>> 0, len);
626
711
  }
712
+ var cachedUint32ArrayMemory0 = null;
713
+ function getUint32ArrayMemory0() {
714
+ if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
715
+ cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
716
+ }
717
+ return cachedUint32ArrayMemory0;
718
+ }
627
719
  var cachedUint8ArrayMemory0 = null;
628
720
  function getUint8ArrayMemory0() {
629
721
  if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
@@ -631,6 +723,24 @@ function getUint8ArrayMemory0() {
631
723
  }
632
724
  return cachedUint8ArrayMemory0;
633
725
  }
726
+ function passArray32ToWasm0(arg, malloc) {
727
+ const ptr = malloc(arg.length * 4, 4) >>> 0;
728
+ getUint32ArrayMemory0().set(arg, ptr / 4);
729
+ WASM_VECTOR_LEN = arg.length;
730
+ return ptr;
731
+ }
732
+ function passArray8ToWasm0(arg, malloc) {
733
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
734
+ getUint8ArrayMemory0().set(arg, ptr / 1);
735
+ WASM_VECTOR_LEN = arg.length;
736
+ return ptr;
737
+ }
738
+ function passArrayF64ToWasm0(arg, malloc) {
739
+ const ptr = malloc(arg.length * 8, 8) >>> 0;
740
+ getFloat64ArrayMemory0().set(arg, ptr / 8);
741
+ WASM_VECTOR_LEN = arg.length;
742
+ return ptr;
743
+ }
634
744
  function passStringToWasm0(arg, malloc, realloc) {
635
745
  if (realloc === void 0) {
636
746
  const buf = cachedTextEncoder.encode(arg);
@@ -698,6 +808,9 @@ function __wbg_finalize_init(instance, module) {
698
808
  wasmInstance = instance;
699
809
  wasm = instance.exports;
700
810
  wasmModule = module;
811
+ cachedFloat32ArrayMemory0 = null;
812
+ cachedFloat64ArrayMemory0 = null;
813
+ cachedUint32ArrayMemory0 = null;
701
814
  cachedUint8ArrayMemory0 = null;
702
815
  wasm.__wbindgen_start();
703
816
  return wasm;
@@ -791,6 +904,7 @@ export {
791
904
  geometry_create_nurbs_surface_handle,
792
905
  geometry_create_path_swept_regions,
793
906
  geometry_create_revolved_regions,
907
+ geometry_create_sdf_mesh,
794
908
  geometry_create_side_profile_cut,
795
909
  geometry_create_sphere,
796
910
  geometry_create_surface_grid,
@@ -804,6 +918,7 @@ export {
804
918
  geometry_delete,
805
919
  geometry_delete_nurbs_curve,
806
920
  geometry_delete_nurbs_surface,
921
+ geometry_delete_sdf_mesh,
807
922
  geometry_export_step,
808
923
  geometry_export_step_multi,
809
924
  geometry_fillet_edges,
@@ -818,6 +933,10 @@ export {
818
933
  geometry_nurbs_surface_tessellation,
819
934
  geometry_sample_nurbs_curve,
820
935
  geometry_sample_nurbs_surface,
936
+ geometry_sdf_mesh_metadata,
937
+ geometry_sdf_mesh_tri_verts,
938
+ geometry_sdf_mesh_vert_properties,
939
+ geometry_sdf_mesher_abi_version,
821
940
  geometry_select_edges,
822
941
  geometry_topology,
823
942
  geometry_transform,
Binary file
@@ -39,16 +39,16 @@ Author or modify ForgeCAD models, sketches, assemblies, and CLI workflows. Prefe
39
39
  ### Validation and export commands (ask the user to run these)
40
40
 
41
41
  ```bash
42
- forgecad run <file.forge.js> # geometry diagnostics, verify.* results — run after every edit
43
- forgecad run <file.forge.js> --debug-imports # trace import-chain failures
44
- forgecad check print <file.forge.js> --json # collisions, mesh health, walls, overhangs, bed contact
45
- forgecad render 3d <file.forge.js> # shaded PNG render
46
- forgecad render wireframe <file.forge.js> # edges only — internal geometry, edge flow
47
- forgecad render section <file.forge.js> --plane XZ # 2D cross-section (SVG/PNG)
48
- forgecad capture gif <file.forge.js> # animated orbit or joint-playback GIF
49
- forgecad export stl <file.forge.js> # mesh for 3D printing
50
- forgecad export 3mf <file.forge.js> # mesh + metadata for 3D printing
51
- forgecad export step <file.forge.js> # exact B-rep for CAD interchange
42
+ forgecad run <file.forge.js> [file ...] # geometry diagnostics, verify.* results — run after every edit
43
+ forgecad run <file.forge.js> --debug-imports # trace import-chain failures
44
+ forgecad check print <file.forge.js> [file ...] --json # collisions, mesh health, walls, overhangs, bed contact
45
+ forgecad render 3d <file.forge.js> [file ...] # shaded PNG render
46
+ forgecad render wireframe <file.forge.js> [file ...] # edges only — internal geometry, edge flow
47
+ forgecad render section <file.forge.js> [file ...] --plane XZ # 2D cross-section (SVG/PNG)
48
+ forgecad capture gif <file.forge.js> [file ...] # animated orbit or joint-playback GIF
49
+ forgecad export stl <file.forge.js> [file ...] # mesh for 3D printing
50
+ forgecad export 3mf <file.forge.js> [file ...] # mesh + metadata for 3D printing
51
+ forgecad export step <file.forge.js> [file ...] # exact B-rep for CAD interchange
52
52
  ```
53
53
 
54
54
  Add `--param Name=Value` to test a specific parameter value. Pick the export that matches the goal: STL/3MF for printing, STEP for exact CAD interchange.
@@ -114,7 +114,7 @@ Resolve labels with `.face(name)` or `.face(query)` — see the Shape class docs
114
114
 
115
115
  **No explanatory text inside CAD geometry.** Model the physical artifact; explain the design through names, comments, BOM entries, and docs. Use `text2d()` only when letters are part of the real object (engraving, branding, gauge ticks); use `Viewport.label()` only for temporary review/debug annotation — never to compensate for unclear geometry.
116
116
 
117
- **SDF shapes preview natively** when returned directly; call `.toShape()` only when mesh-backed CAD/export behavior is needed. See [SDF docs](../../generated/sdf.md).
117
+ **SDF shapes preview natively** when returned directly — including plain object/array trees of SDF leaves; call `.toShape()` only when mesh-backed CAD/export behavior is needed. See [SDF docs](../../generated/sdf.md).
118
118
 
119
119
  ---
120
120
 
@@ -307,7 +307,7 @@ chamfer(base, 3, base.edge('vert-br'))
307
307
 
308
308
  Adds a taper angle to the vertical faces of a solid so that it can be extracted from a mold. The neutral plane is the Z position where the draft angle is zero — faces above and below are tapered symmetrically. Typical values for injection molding are 1–5°.
309
309
 
310
- Truck supports vertical-prism solids with Z-axis pull directions. OCCT uses its native draft operation when available. Manifold throws.
310
+ SDF, Manifold, and Truck lower supported vertical-prism solids with Z-axis pull directions to a tapered loft. OCCT uses its native draft operation when available.
311
311
 
312
312
  ```ts
313
313
  // Add 3° draft to a box for injection molding
@@ -4437,7 +4437,7 @@ console.log("Collisions", solved.collisionReport());
4437
4437
 
4438
4438
  #### `minClearance(partA: string, partB: string, searchLength?: number): number` — Compute the minimum gap (clearance) between two parts in this solved pose.
4439
4439
 
4440
- Returns `0` if the parts are touching or overlapping. Requires the Manifold backend. `searchLength` bounds the search radius in mm — increase it for widely separated parts.
4440
+ Returns `0` if the parts are touching or overlapping. Manifold-backed parts use the exact Manifold gap query. SDF-backed parts use a mesh-derived sampled gap. `searchLength` bounds the Manifold search radius in mm — increase it for widely separated Manifold parts.
4441
4441
 
4442
4442
  ---
4443
4443
 
@@ -48,4 +48,4 @@ Resolve labels with `.face(name)` or `.face(query)` — see the Shape class docs
48
48
 
49
49
  **No explanatory text inside CAD geometry.** Model the physical artifact; explain the design through names, comments, BOM entries, and docs. Use `text2d()` only when letters are part of the real object (engraving, branding, gauge ticks); use `Viewport.label()` only for temporary review/debug annotation — never to compensate for unclear geometry.
50
50
 
51
- **SDF shapes preview natively** when returned directly; call `.toShape()` only when mesh-backed CAD/export behavior is needed. See [SDF docs](../../generated/sdf.md).
51
+ **SDF shapes preview natively** when returned directly — including plain object/array trees of SDF leaves; call `.toShape()` only when mesh-backed CAD/export behavior is needed. See [SDF docs](../../generated/sdf.md).
@@ -78,7 +78,7 @@ Direct `.stl`/`.obj`/`.3mf`/`.step`/`.stp` inputs are imported automatically; ST
78
78
 
79
79
  ```bash
80
80
  forgecad run model.forge.js
81
- forgecad run model.forge.js --details --history
81
+ forgecad run model.forge.js other-model.forge.js --quality live
82
82
  ```
83
83
 
84
84
  ### `forgecad ls`
@@ -104,7 +104,7 @@ Without a target, `show` renders the whole scene and behaves like a shorter, int
104
104
 
105
105
  ```bash
106
106
  forgecad show model.forge.js
107
- forgecad show model.forge.js Bench
107
+ forgecad show model.forge.js --target Bench
108
108
  ```
109
109
 
110
110
  ### Object Filtering: `--focus` and `--hide`
@@ -112,7 +112,7 @@ forgecad show model.forge.js Bench
112
112
  `render 3d`, `render wireframe`, `inspect <family> <mode>`, `capture`, and `check print` can filter the visible object set without changing model code. Use `forgecad ls model.forge.js` to list exact object paths, then pass names or globs:
113
113
 
114
114
  ```bash
115
- forgecad render 3d model.forge.js bench.png --focus "Bench.*"
115
+ forgecad render 3d model.forge.js --output bench.png --focus "Bench.*"
116
116
  forgecad inspect visual objects model.forge.js --hide "Bench.Slat0,Bench.Slat1" --camera iso
117
117
  ```
118
118
 
@@ -200,7 +200,7 @@ Runs the script headlessly and prints every named render view with an exact came
200
200
 
201
201
  ```bash
202
202
  forgecad render views model.forge.js
203
- forgecad render views model.forge.js --json
203
+ forgecad render views model.forge.js reference.step
204
204
  ```
205
205
 
206
206
  ### `forgecad render wireframe`
@@ -224,7 +224,7 @@ Exports the scene to Blender and renders with Cycles (path tracer); requires Ble
224
224
 
225
225
  ```bash
226
226
  forgecad render hq model.forge.js
227
- forgecad render hq model.forge.js hero.png --preset dramatic --samples 1024
227
+ forgecad render hq model.forge.js --output hero.png --preset dramatic --samples 1024
228
228
  ```
229
229
 
230
230
  ### `forgecad capture gif|mp4` **\[Pro\]**
@@ -235,18 +235,22 @@ Renders an animated sequence: `--capture orbit` (default) for a turntable, `--ca
235
235
 
236
236
  ```bash
237
237
  forgecad capture gif model.forge.js
238
- forgecad capture gif model.forge.js out/sweep.gif --capture section-sweep --sweep-plane YZ
238
+ forgecad capture gif model.forge.js other-model.forge.js
239
239
  ```
240
240
 
241
241
  ### `forgecad render section`
242
242
 
243
243
  Render a 2D cross-section of a 3D model (cut by a plane) to SVG or PNG.
244
244
 
245
- Cuts all shapes with an axis-aligned plane (default XY at Z=0; `--plane XZ|YZ` reorients, `--offset` shifts the cut) and writes a 2D cross-section drawing. The file extension picks the format: `.svg` (default, vector) or `.png` (rasterized at `--size` pixels); `--edges=<off|thin|bold>` sets the outline stroke. Useful for verifying internal geometry, wall thicknesses, and fits that aren't visible in 3D renders.
245
+ Cuts all shapes in the scene with an axis-aligned plane and produces a 2D cross-section drawing. The default plane is XY at Z=0. Use `--plane XZ` or `--plane YZ` for other orientations, and `--offset` to shift the cut position.
246
+
247
+ Output defaults to `.svg`; pass `--format png` or a single-input `--output *.png` path for a rasterized PNG at `--size` pixels. Use `--edges=<off|thin|bold>` to control the outline stroke on cut shapes.
248
+
249
+ Useful for verifying internal geometry, wall thicknesses, and fit checks that aren't visible in 3D renders.
246
250
 
247
251
  ```bash
248
252
  forgecad render section model.forge.js
249
- forgecad render section model.forge.js out/section.svg --plane XZ --offset 10
253
+ forgecad render section model.forge.js --output out/section.svg --plane XZ --offset 10
250
254
  ```
251
255
 
252
256
  | Command | Description |
@@ -272,8 +276,8 @@ These flags work across run / render / capture / inspect commands:
272
276
  | `--camera <front\|back\|side\|right\|top\|iso\|az:el\|az:el:dist\|spec>` | Camera preset, spherical (az:el), or full spec such as `proj=perspective;pos=x,y,z;target=x,y,z;up=x,y,z;fov=45`. Repeatable. |
273
277
  | `--view <name>` | Named camera view declared by the model with scene({ views }) |
274
278
  | `--size <px>` | Image size in pixels |
279
+ | `--backend <manifold\|occt\|truck\|sdf>` | Geometry backend (default: manifold; STEP inputs default to OCCT) |
275
280
  | `--quality <default\|live\|high>` | Mesh quality preset |
276
- | `--backend <manifold\|occt\|truck>` | Geometry backend (default: manifold; STEP inputs default to OCCT) |
277
281
  | `--json` | Print machine-readable JSON |
278
282
 
279
283
  Every command has more — Blender-only `render hq` flags (`--preset`, `--samples`, `--engine`, `--hdri`, `--transparent`, `--video`) and capture-only flags (`--capture`, `--animation`, `--cut-plane`, `--sweep-*`, `--fps`) among them. Run `forgecad <command> --help` for the full list.
@@ -295,6 +299,7 @@ Export to every format you need.
295
299
  | `export sdf` **\[Production\]** | SDF package | Gazebo robot simulation |
296
300
  | `export mjcf` **\[Production\]** | MJCF package | MuJoCo / MJX robot simulation |
297
301
  | `export urdf` **\[Production\]** | URDF package | ROS / PyBullet / MuJoCo |
302
+ | `export usd` **\[Production\]** | USD package | Isaac Sim / OpenUSD simulation |
298
303
  | `export report` **\[Production\]** | PDF report | Multi-view report with BOM and dimensions |
299
304
  | `export cutting-layout` **\[Production\]** | PDF/DXF | Sheet cutting layout with cut sequence |
300
305
  | `link` | URL | Share link from a GitHub Gist URL or ID (copied to clipboard) |
@@ -303,6 +308,7 @@ Export to every format you need.
303
308
  # Sheet material
304
309
  forgecad cut-list shelf.forge.js
305
310
  forgecad export cutting-layout shelf.forge.js --sheet-width 420 --sheet-height 594 --kerf 3
311
+ forgecad export cutting-layout shelf.forge.js --output out/layout.dxf
306
312
 
307
313
  # 3D printing
308
314
  forgecad check print bracket.forge.js
@@ -313,11 +319,12 @@ forgecad export 3mf bracket.forge.js --quality high
313
319
  forgecad export step bracket.forge.js
314
320
 
315
321
  # Technical drawings
316
- forgecad export report bracket.forge.js out/report.pdf
322
+ forgecad export report bracket.forge.js --output out/report.pdf
317
323
 
318
324
  # Robot simulation
319
325
  forgecad export sdf rover.forge.js --output out/forge_scout
320
326
  forgecad export mjcf rover.forge.js --output out/forge_scout_mjcf
327
+ forgecad export usd rover.forge.js --output out/forge_scout_usd
321
328
  ```
322
329
 
323
330
  <details>
@@ -326,12 +333,17 @@ forgecad export mjcf rover.forge.js --output out/forge_scout_mjcf
326
333
  | Option | Description |
327
334
  |--------|-------------|
328
335
  | `--joint <JointName=Value>` | Override a Motion tab joint value (JointName=Value). Repeatable. |
329
- | `--output <path>` | Output STEP path |
336
+ | `--output <path>` | Output SVG path for a single input |
330
337
  | `--backend <occt\|truck>` | Exact BREP exporter: occt (default) or truck (native analytic kernel) |
331
338
  | `--quality <default\|live\|high>` | Forge quality preset |
332
339
  | `-o <path>` | Shorthand for --output |
340
+ | `--param <Key=Value>` | Override a parameter value (Key=Value). Repeatable. |
341
+ | `-p <Key=Value>` | Shorthand for --param |
342
+ | `--format <json\|webgpu-brick>` | Implicit artifact format |
343
+ | `-q <live\|default\|high>` | Shorthand for --quality |
344
+ | `--workgroup-size <x>x<y>x<z>` | WebGPU compute workgroup size |
333
345
  | `--dim-angle-tol <deg>` | Dimension routing tolerance in degrees |
334
- | `--format <pdf\|dxf>` | Output format |
346
+ | `--out <path>` | Alias for --output |
335
347
  | `--sheet-width <mm>` | Stock sheet width in mm |
336
348
  | `--sheet-height <mm>` | Stock sheet height in mm |
337
349
  | `--kerf <mm>` | Cutting clearance (saw blade width) in mm |
@@ -478,7 +490,7 @@ Checks include script `verify.*` results, exact positive-volume object collision
478
490
 
479
491
  ```bash
480
492
  forgecad check print model.forge.js
481
- forgecad check print model.forge.js --json
493
+ forgecad check print model.forge.js other-model.forge.js
482
494
  ```
483
495
 
484
496
  ### `forgecad check simready`
@@ -489,7 +501,7 @@ Runs a Forge script and checks the returned `assembly(...).withSimulation(...)`
489
501
 
490
502
  ```bash
491
503
  forgecad check simready model.forge.js
492
- forgecad check simready robot.forge.js --json
504
+ forgecad check simready model.forge.js other-model.forge.js
493
505
  ```
494
506
 
495
507
  ### `forgecad inspect mechanical-integrity`
@@ -529,7 +541,7 @@ The CLI is free for personal non-commercial use. Pro covers human-operated comme
529
541
 
530
542
  | Free | Production outputs | Pro | Enterprise |
531
543
  |------|--------------------|-----|------------|
532
- | `run`, `dev`, `studio`, `render 3d`, `export stl`, `export 3mf`, `export svg`, `compare 3d`, `check print`, `inspect fit interference`, `inspect mechanical-integrity` for personal non-commercial use | `cut-list`, `export sketch-pdf`, `export step`, `export brep`, `export gcode`, `export sdf`, `export mjcf`, `export urdf`, `export report`, `export cutting-layout` are free to run for personal non-commercial use; Pro covers human-operated commercial CAD work | `render hq`, `capture gif`, `capture mp4` plus commercial coverage for client/customer work | Backend, hosted, embedded, or application workflows that call ForgeCAD automatically |
544
+ | `run`, `dev`, `studio`, `render 3d`, `export stl`, `export 3mf`, `export svg`, `compare 3d`, `check print`, `inspect fit interference`, `inspect mechanical-integrity` for personal non-commercial use | `cut-list`, `export sketch-pdf`, `export step`, `export brep`, `export gcode`, `export implicit`, `export sdf`, `export mjcf`, `export urdf`, `export usd`, `export report`, `export cutting-layout` are free to run for personal non-commercial use; Pro covers human-operated commercial CAD work | `render hq`, `capture gif`, `capture mp4` plus commercial coverage for client/customer work | Backend, hosted, embedded, or application workflows that call ForgeCAD automatically |
533
545
 
534
546
  ```bash
535
547
  forgecad license # Check local license status
@@ -567,4 +567,4 @@ console.log("Collisions", solved.collisionReport());
567
567
 
568
568
  #### `minClearance(partA: string, partB: string, searchLength?: number): number` — Compute the minimum gap (clearance) between two parts in this solved pose.
569
569
 
570
- Returns `0` if the parts are touching or overlapping. Requires the Manifold backend. `searchLength` bounds the search radius in mm — increase it for widely separated parts.
570
+ Returns `0` if the parts are touching or overlapping. Manifold-backed parts use the exact Manifold gap query. SDF-backed parts use a mesh-derived sampled gap. `searchLength` bounds the Manifold search radius in mm — increase it for widely separated Manifold parts.
@@ -155,7 +155,7 @@ chamfer(base, 3, base.edge('vert-br'))
155
155
 
156
156
  Adds a taper angle to the vertical faces of a solid so that it can be extracted from a mold. The neutral plane is the Z position where the draft angle is zero — faces above and below are tapered symmetrically. Typical values for injection molding are 1–5°.
157
157
 
158
- Truck supports vertical-prism solids with Z-axis pull directions. OCCT uses its native draft operation when available. Manifold throws.
158
+ SDF, Manifold, and Truck lower supported vertical-prism solids with Z-axis pull directions to a tapered loft. OCCT uses its native draft operation when available.
159
159
 
160
160
  ```ts
161
161
  // Add 3° draft to a box for injection molding
@@ -63,7 +63,7 @@ Pre-built fasteners, gears, pipes, structural profiles, and utility shapes. Acce
63
63
 
64
64
  Pre-built parametric parts available in user scripts as `lib.*`.
65
65
 
66
- exposed to `.forge.js` scripts — see the member list below for the catalog. Sizes outside the supported ranges throw at runtime with a descriptive error.
66
+ Every key in this object becomes a method or namespace on the `lib` object exposed to `.forge.js` scripts — see the member list below for the catalog. Sizes outside the supported ranges throw at runtime with a descriptive error.
67
67
 
68
68
  - `fastenerHole(opts: FastenerHoleOptions): Shape` — ISO metric fastener hole cutter with optional counterbore or countersink.
69
69
 
@@ -53,7 +53,7 @@ An immutable SDF expression. Supports SDF-specific operations (smooth booleans,
53
53
 
54
54
  #### `clone(): SdfShape` — Clone this SDF expression and its visual metadata.
55
55
 
56
- #### `toShape(options?: SdfToShapeOptions): Shape` — Mesh this SDF into a ForgeCAD Shape through ForgeCAD's Surface Nets pipeline. Once converted, the result is a regular Shape — booleans, transforms, export all work.
56
+ #### `toShape(options?: SdfToShapeOptions): Shape` — Mesh this SDF into a ForgeCAD Shape. Typed SDF trees materialize through Rust Manifold Dual Contouring; dynamic trees (custom/noise/voronoi/displace/blend callbacks) mesh through the Surface Nets pipeline. Once converted, the result is a regular Shape — booleans, transforms, export all work.
57
57
 
58
58
  #### `color(value: string | undefined): SdfShape` — Set the display color for this implicit leaf.
59
59
 
@@ -230,7 +230,7 @@ return {
230
230
  - `basketWeave(options?: BasketWeaveOptions): SurfacePattern` — Basket weave surface pattern — threads with over-under crossings in UV space. Returns a SurfacePattern for use with `.surfaceDisplace()`.
231
231
  - `pattern2d(): Pattern2DBuilder` — Create typed, composable 2D surface patterns for `.surfaceDisplace()`.
232
232
  - `SurfacePattern: typeof SurfacePattern` — A 2D surface pattern — a heightmap function for use with `.surfaceDisplace()`.
233
- - `fromFunction(fn: SdfFunctionSource, options: SdfFunctionOptions): SdfShape` — Create a custom SDF from one expression; shader-safe expressions raymarch directly.
233
+ - `fromFunction(fn: SdfFunctionSource, options: SdfFunctionOptions): SdfShape` — Create a custom SDF from one expression; shader-safe expressions keep shader metadata for tooling.
234
234
  - `combine(value: unknown, options?: CombineOptions): SdfShape` — Collapse a plain object/array tree of SDF leaves into one continuous implicit field. Per-leaf color/material identity is intentionally discarded — the result is one scalar field. Use plain object returns for multi-material SDF preview, and `sdf.combine(...)` only when you want one implicit body. Explicit shape lists are covered by `a.union(b, c)`; pass `{ op: 'intersection' }` to intersect instead.
235
235
 
236
236
  ```js
@@ -1,5 +1,5 @@
1
1
  // Gyroid-diamond blend — shader-compatible TPMS fields combined in one form.
2
- // Return the raw SDF for fast native preview; use toShape(...) when exporting.
2
+ // Return the SDF directly for implicit preview data; use toShape(...) for export tuning.
3
3
 
4
4
  const bounds = sdf.sphere(22);
5
5
  const gyroid = sdf.gyroid({ cellSize: 10, thickness: 1.0 });
@@ -1,5 +1,5 @@
1
1
  // Organic noise sculpture — natural, coral-like form
2
- // Noise is still materialized because native preview does not raymarch it yet.
2
+ // Explicit meshing keeps the noisy field on the ordinary mesh preview/export path.
3
3
 
4
4
  const shell = sdf.sphere(20).shell(4);
5
5
  const texture = sdf.noise({ scale: 0.15, amplitude: 3, octaves: 3 });
@@ -16,4 +16,4 @@ const leftHandGroove = sdf.box(2.4, 1.2, 48)
16
16
  return body
17
17
  .subtract(rightHandGroove, leftHandGroove)
18
18
  .color('#8da2ad')
19
- .material({ roughness: 0.38, metalness: 0.18 });
19
+ .material({ roughness: 0.38, metalness: 0.18 }).toShape({edgeLength: 0.2});
@@ -1,8 +1,7 @@
1
- // Custom SDF native preview — one user-authored expression drives CPU sampling
2
- // and, when shader-safe, native raymarch preview.
1
+ // Custom SDF implicit preview — one user-authored expression drives the field.
3
2
  //
4
- // This returns a raw SdfShape. Do not call .toShape() here; keeping it implicit
5
- // proves the custom function can preview through the raymarch shader.
3
+ // Returning SdfShape directly keeps the field implicit. Call .toShape(...) when
4
+ // you need explicit mesh quality for CAD operations or export.
6
5
 
7
6
  const rippledSphere = sdf.fromFunction(
8
7
  (x, y, z, radius, frequency, amplitude) =>
@@ -1,4 +1,4 @@
1
- // Materialize a raw SDF tree when you need mesh-backed CAD/export behavior.
1
+ // Return a plain SDF tree; scene mapping keeps SDF leaves implicit.
2
2
 
3
3
  const insert = {
4
4
  shell: sdf.sphere(18)
@@ -9,4 +9,4 @@ const insert = {
9
9
  .color('#ffcf5a'),
10
10
  };
11
11
 
12
- return insert;
12
+ return insert;
@@ -1,6 +1,7 @@
1
- // Plain raw SDF return: no Shape, no .toShape(), no Sculpt facade.
1
+ // Plain SDF return: no explicit Shape, no .toShape(), no Sculpt facade.
2
2
  //
3
- // This should render directly in Studio and the CLI.
3
+ // Direct returns stay as implicit SDF preview data; call .toShape() when you
4
+ // need a mesh-backed Shape for CAD operations or export.
4
5
 
5
6
  scene(Sculpt.look('soft-studio'));
6
7
 
@@ -1,6 +1,6 @@
1
- // SDF native preview — raw SDF leaves render directly by raymarching.
1
+ // SDF implicit preview — SDF leaves stay lazy until .toShape(...).
2
2
  //
3
- // Use .toShape() only when you need mesh-backed CAD operations or export.
3
+ // Use .toShape(...) when you need explicit meshing controls, CAD operations, or export.
4
4
 
5
5
  const smoothBlob = sdf.smoothUnion(
6
6
  sdf.sphere(12),
@@ -1,5 +1,5 @@
1
- // Native SDF surface relief — user-composed Pattern2D IR lowers to shader + CPU.
2
- // These raw SDF leaves raymarch directly; call .toShape() only for export.
1
+ // Native SDF surface relief — user-composed Pattern2D IR lowers to CPU sampling.
2
+ // Direct SDF returns stay implicit; call .toShape(...) for mesh-backed export.
3
3
 
4
4
  scene({
5
5
  background: { top: '#f6fbff', bottom: '#dfe9f3' },
@@ -1,4 +1,4 @@
1
- // Twisted lattice tower — gyroid field raymarched directly in the viewport.
1
+ // Twisted lattice tower — direct SDF return materializes as a mesh-backed preview.
2
2
 
3
3
  const column = sdf.cylinder(54, 13);
4
4
 
@@ -1,5 +1,5 @@
1
1
  // Voronoi lampshade — organic cell-wall dome, open at the bottom.
2
- // Voronoi is still materialized because native preview does not raymarch it yet.
2
+ // Explicit meshing keeps this dense field on the ordinary mesh preview/export path.
3
3
 
4
4
  const dome = sdf.sphere(30)
5
5
  .subtract(sdf.sphere(27))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forgecad",
3
- "version": "0.10.1",
3
+ "version": "0.10.2",
4
4
  "description": "Code-first parametric CAD for JavaScript/TypeScript, in the browser and CLI.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "homepage": "https://forgecad.io",
@@ -213,7 +213,7 @@
213
213
  "gifenc": "^1.0.3",
214
214
  "jsonwebtoken": "^9.0.3",
215
215
  "lz-string": "^1.5.0",
216
- "manifold-3d": "^3.4.0",
216
+ "manifold-3d": "^3.5.1",
217
217
  "meshoptimizer": "^1.0.1",
218
218
  "mp4-muxer": "^5.2.1",
219
219
  "nanoid": "^5.1.7",