forgecad 0.9.4 → 0.9.5

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 (82) hide show
  1. package/dist/assets/{AdminPage-jwoEgwE_.js → AdminPage-uTtcSXtn.js} +1 -1
  2. package/dist/assets/{BlogPage-Ck7g3ue2.js → BlogPage-DYJMjWx3.js} +1 -1
  3. package/dist/assets/{DocsPage-9WaRC14b.js → DocsPage-C58f0K5v.js} +1 -6
  4. package/dist/assets/{EditorApp-Dja2jMmW.js → EditorApp-DNH1TEz1.js} +282 -62
  5. package/dist/assets/{EmbedViewer-37_PfMwv.js → EmbedViewer-CMXWA2LX.js} +2 -2
  6. package/dist/assets/{LandingPageProofDriven-CO8WL0CY.js → LandingPageProofDriven-CAu2OZFn.js} +1 -1
  7. package/dist/assets/{PricingPage-DADKGuOa.js → PricingPage-BIgW7m3X.js} +1 -1
  8. package/dist/assets/{SettingsPage-DKKI4W49.js → SettingsPage-N1l1tMXO.js} +1 -1
  9. package/dist/assets/{app-CwI02pTA.js → app-CFy7g5WP.js} +74 -12
  10. package/dist/assets/cli/{render-Kw5hLEcL.js → render-BrVVdj_T.js} +453 -41
  11. package/dist/assets/{evalWorker-D6ub3kfS.js → evalWorker-c_SB9gg3.js} +2057 -446
  12. package/dist/assets/{manifold-lru0jwVw.js → manifold-CRoBhJKH.js} +2 -2
  13. package/dist/assets/{manifold-CwDdMKyc.js → manifold-Cjk7WhRs.js} +1 -1
  14. package/dist/assets/{manifold-DTvmxSDf.js → manifold-Dp6pvFr6.js} +1 -1
  15. package/dist/assets/{renderSceneState-tvtNKNRi.js → renderSceneState-3DfsSASX.js} +1 -1
  16. package/dist/assets/{reportWorker-DeqktDGt.js → reportWorker-BLkuIoS8.js} +2052 -443
  17. package/dist/assets/{sectionPlaneMath-C8N0w8o3.js → sectionPlaneMath-CykEnkvQ.js} +2258 -518
  18. package/dist/cli/render.html +1 -1
  19. package/dist/docs/index.html +2 -2
  20. package/dist/docs-raw/AI/usage.md +0 -1
  21. package/dist/docs-raw/API/core/concepts.md +11 -1
  22. package/dist/docs-raw/CLI.md +64 -13
  23. package/dist/docs-raw/generated/assembly.md +8 -3
  24. package/dist/docs-raw/generated/concepts.md +44 -41
  25. package/dist/docs-raw/generated/core.md +97 -47
  26. package/dist/docs-raw/generated/curves.md +6 -580
  27. package/dist/docs-raw/generated/lib.md +40 -3
  28. package/dist/docs-raw/generated/output.md +6 -1
  29. package/dist/docs-raw/generated/sdf.md +50 -4
  30. package/dist/docs-raw/generated/viewport.md +1 -9
  31. package/dist/docs-raw/guides/inspection-bundles.md +31 -6
  32. package/dist/docs-raw/skills/forgecad-blockout-model.md +1 -0
  33. package/dist/docs-raw/skills/forgecad-image-replicator.md +3 -1
  34. package/dist/docs-raw/skills/forgecad-make-a-model.md +48 -4
  35. package/dist/docs-raw/skills/forgecad-render-inspect.md +3 -1
  36. package/dist/docs-raw/skills/forgecad-visual-spec.md +2 -0
  37. package/dist/docs-raw/skills/forgecad.md +2 -1
  38. package/dist/docs-raw/skills/index.md +0 -1
  39. package/dist/index.html +1 -1
  40. package/dist/sitemap.xml +6 -6
  41. package/dist-cli/blender/render.py +43 -8
  42. package/dist-cli/forgecad.js +4941 -1758
  43. package/dist-cli/forgecad.js.map +1 -1
  44. package/dist-skill/CONTEXT.md +255 -656
  45. package/dist-skill/SKILL-dev.md +2 -1
  46. package/dist-skill/SKILL.md +2 -1
  47. package/dist-skill/docs/API/core/concepts.md +11 -1
  48. package/dist-skill/docs/CLI.md +64 -13
  49. package/dist-skill/docs/generated/assembly.md +8 -3
  50. package/dist-skill/docs/generated/core.md +97 -47
  51. package/dist-skill/docs/generated/curves.md +6 -580
  52. package/dist-skill/docs/generated/lib.md +40 -3
  53. package/dist-skill/docs/generated/output.md +6 -1
  54. package/dist-skill/docs/generated/sdf.md +50 -4
  55. package/dist-skill/docs/generated/viewport.md +1 -9
  56. package/dist-skill/docs/guides/inspection-bundles.md +31 -6
  57. package/dist-skill/docs-dev/API/core/concepts.md +11 -1
  58. package/dist-skill/docs-dev/CLI.md +64 -13
  59. package/dist-skill/docs-dev/generated/assembly.md +8 -3
  60. package/dist-skill/docs-dev/generated/core.md +97 -47
  61. package/dist-skill/docs-dev/generated/curves.md +6 -580
  62. package/dist-skill/docs-dev/generated/lib.md +40 -3
  63. package/dist-skill/docs-dev/generated/output.md +6 -1
  64. package/dist-skill/docs-dev/generated/sdf.md +50 -4
  65. package/dist-skill/docs-dev/generated/viewport.md +1 -9
  66. package/dist-skill/docs-dev/guides/inspection-bundles.md +31 -6
  67. package/dist-skill/library/README.md +0 -1
  68. package/dist-skill/library/forgecad-blockout-model/SKILL.md +1 -0
  69. package/dist-skill/library/forgecad-image-replicator/SKILL.md +3 -1
  70. package/dist-skill/library/forgecad-make-a-model/SKILL.md +48 -4
  71. package/dist-skill/library/forgecad-render-inspect/SKILL.md +3 -1
  72. package/dist-skill/library/forgecad-visual-spec/SKILL.md +2 -0
  73. package/examples/api/drive-wheel-regions.forge.js +43 -0
  74. package/examples/api/sdf-circular-array-knurling.forge.js +19 -0
  75. package/examples/api/sdf-pattern2d-ceramic-ripple-set.forge.js +83 -0
  76. package/examples/api/sdf-pattern2d-grip-tread.forge.js +72 -0
  77. package/examples/api/sdf-pattern2d-orbital-jewelry.forge.js +62 -0
  78. package/examples/api/sdf-surface-basket-weave.forge.js +67 -0
  79. package/examples/api/sector-gear-body.forge.js +34 -0
  80. package/package.json +1 -1
  81. package/dist/docs-raw/skills/forgecad-api-dogfood.md +0 -130
  82. package/dist-skill/library/forgecad-api-dogfood/SKILL.md +0 -125
@@ -18,15 +18,15 @@ skill-order: 100
18
18
  - [Grouping & Local Coordinates](#grouping-local-coordinates) — `group`
19
19
  - [Section & Projection](#section-projection) — `intersectWithPlane`, `faceProfile`, `projectToPlane`
20
20
  - [Transforms](#transforms) — `composeChain`
21
- - [Backend Runtime](#backend-runtime) — `initKernel`, `setActiveBackend`, `activateBackend`, `getActiveBackend`
22
21
  - [Verification](#verification) — `spec`
23
22
  - [Shape](#shape) — Appearance, Face Topology, Edge Topology, Transforms, Booleans & Cutting, Features, Placement, Connectors, References, Measurement
24
23
  - [Transform](#transform)
25
24
  - [ShapeGroup](#shapegroup) — Children, Transforms, Placement, Connectors, References
26
25
  - [SurfacePattern](#surfacepattern)
26
+ - [Pattern2D](#pattern2d)
27
+ - [Pattern2DBuilder](#pattern2dbuilder)
27
28
  - [ShapeRef](#shaperef)
28
29
  - [ANCHOR3D_NAMES](#anchor3d-names)
29
- - [DEFAULT_ACTIVE_BACKEND](#default-active-backend)
30
30
  - [verify](#verify)
31
31
  - [Constraint](#constraint)
32
32
  - [Points](#points)
@@ -121,9 +121,11 @@ intersection(...inputs: ShapeOperandInput[]): Shape
121
121
 
122
122
  ### Edge Features
123
123
 
124
- #### `fillet()` — Apply fillets (rounded edges) to one or more edges of a shape.
124
+ #### `fillet()` — Apply experimental fillets (rounded edges) to one or more edges of a shape.
125
125
 
126
- Works on edge selections from any active backend. Truck and OCCT route edge finishes through native kernel operations; unsupported selections fail as explicit kernel gaps instead of using TypeScript geometry fallbacks.
126
+ **Experimental**: fillets are still backend-sensitive. The Manifold backend is known to produce incorrect results for some edge-finish cases, and the OCCT backend can be very slow, especially with broad edge selections. Prefer targeted edge selectors and inspect the result before treating it as production-ready geometry.
127
+
128
+ Edge selections compile into backend operations; unsupported selections fail as explicit kernel gaps instead of using TypeScript geometry fallbacks.
127
129
 
128
130
  The `edges` parameter is flexible:
129
131
 
@@ -149,9 +151,11 @@ fillet(myShape, 3, edges)
149
151
  fillet(shape: Shape, radius: number, edges?: EdgeSelector, segments?: number): Shape
150
152
  ```
151
153
 
152
- #### `chamfer()` — Apply chamfers (beveled edges) to one or more edges of a shape.
154
+ #### `chamfer()` — Apply experimental chamfers (beveled edges) to one or more edges of a shape.
155
+
156
+ **Experimental**: chamfers are still backend-sensitive. The Manifold backend is known to produce incorrect results for some edge-finish cases, and the OCCT backend can be very slow, especially with broad edge selections. Prefer targeted edge selectors and inspect the result before treating it as production-ready geometry.
153
157
 
154
- Produces a 45° bevel at the specified `size` (distance from edge). Works on edge selections from any active backend. Truck and OCCT route chamfers through native kernel operations; unsupported selections fail as explicit kernel gaps instead of using TypeScript geometry fallbacks.
158
+ Produces a 45° bevel at the specified `size` (distance from edge). Edge selections compile into backend operations; unsupported selections fail as explicit kernel gaps instead of using TypeScript geometry fallbacks.
155
159
 
156
160
  The `edges` parameter accepts the same options as `fillet()`: inline `EdgeQuery`, pre-selected `EdgeSegment`/`EdgeSegment[]`, or `undefined` (all sharp edges).
157
161
 
@@ -376,11 +380,8 @@ selectEdges(shape: Shape, query?: EdgeQuery): EdgeSegment[]
376
380
  | `normalA` | `Vec3` | Normal of first adjacent face. |
377
381
  | `normalB` | `Vec3` | Normal of second adjacent face (same as normalA for boundary edges). |
378
382
  | `boundary` | `boolean` | true if this is a boundary (unmatched) edge — unusual for closed solids. |
379
- | `nativeTopology?` | `EdgeNativeTopologyRef` | Native kernel topology identity when the active backend can provide one. |
380
383
  | `start`, `end`, `midpoint`, `length` | | — |
381
384
 
382
- `EdgeNativeTopologyRef`: `{ backend: "truck", edge: number }`
383
-
384
385
  #### `selectEdge()` — Select the single best-matching edge from a shape.
385
386
 
386
387
  When `near` is specified, returns the edge whose midpoint is closest to that point. Otherwise returns the first matching edge in mesh order. Throws if no edges match the query — useful as a guard when you expect exactly one result.
@@ -481,7 +482,7 @@ importSvgSketch(fileName: string, options?: SvgImportOptions): Sketch
481
482
  importMesh(fileName: string, options?: { scale?: number; center?: boolean; }): Shape
482
483
  ```
483
484
 
484
- #### `importStep()` — Import a STEP file (.step, .stp) as an exact OCCT-backed Shape. Preserves NURBS curves, B-spline surfaces, and exact topology. Requires `setActiveBackend('occt')`.
485
+ #### `importStep()` — Import a STEP file (.step, .stp) as an exact OCCT-backed Shape. Preserves NURBS curves, B-spline surfaces, and exact topology. Requires running with the OCCT backend.
485
486
 
486
487
  ```ts
487
488
  importStep(fileName: string): Shape
@@ -617,18 +618,21 @@ Param.list<T extends Record<string, number | boolean | string>>(name: string, de
617
618
 
618
619
  Unlike union(), child colors and individual identities are preserved. Children can be plain shapes, named descriptors ({ name, shape/sketch/group }), or nested groups. The returned ShapeGroup supports all Shape transforms (translate, rotate, etc.).
619
620
 
621
+ Named descriptors can include `tags` for viewport organization. Tags do not affect geometry; they let the command palette hide, show only, or focus all objects with the same tag.
622
+
620
623
  **Local coordinate pattern:** Build child parts at the origin (local coordinates), then group and translate once to place the whole assembly. This eliminates the error-prone pattern of manually adding parent offsets to every sub-part.
621
624
 
622
625
  ```js
623
- // BAD every sub-part repeats the parent's global offset
624
- const unitX = 0, unitY = -18, unitZ = 70;
625
- const body = roundedBox(100, 20, 32, 4).translate(unitX, unitY, unitZ);
626
- const panel = box(98, 2, 18).translate(unitX, unitY - 12, unitZ + 4);
627
- const louver = box(88, 2, 6).translate(unitX, unitY - 14, unitZ - 11);
626
+ const body = roundedBox(100, 20, 32, 4);
627
+ const panel = box(98, 2, 18).translate(0, -12, 4);
628
+ const louver = box(88, 2, 6).translate(0, -14, -11);
629
+ const indoorUnit = group(
630
+ { name: 'Body', shape: body },
631
+ { name: 'Panel', tags: 'cover', shape: panel },
632
+ { name: 'Louver', tags: ['cover', 'moving'], shape: louver },
633
+ ).translate(0, -18, 70);
628
634
  ```
629
635
 
630
- // GOOD — build at origin, group, translate once const body = roundedBox(100, 20, 32, 4); const panel = box(98, 2, 18).translate(0, -12, 4); const louver = box(88, 2, 6).translate(0, -14, -11); const indoorUnit = group( { name: 'Body', shape: body }, { name: 'Panel', shape: panel }, { name: 'Louver', shape: louver }, ).translate(0, -18, 70);
631
-
632
636
  ```ts
633
637
  group(...items: GroupInput[]): ShapeGroup
634
638
  ```
@@ -663,32 +667,6 @@ projectToPlane(shape: Shape, plane: PlaneSpec): Sketch
663
667
  composeChain(...steps: TransformInput[]): Transform
664
668
  ```
665
669
 
666
- ### Backend Runtime
667
-
668
- #### `initKernel()`
669
-
670
- ```ts
671
- initKernel(): Promise<unknown>
672
- ```
673
-
674
- #### `setActiveBackend()`
675
-
676
- ```ts
677
- setActiveBackend(backend: ActiveBackend): void
678
- ```
679
-
680
- #### `activateBackend()` — Set the active backend and ensure its WASM module is initialized. Call this instead of `setActiveBackend` when you're about to execute code — it guarantees the backend is ready, not just selected.
681
-
682
- ```ts
683
- activateBackend(backend: ActiveBackend): Promise<void>
684
- ```
685
-
686
- #### `getActiveBackend()`
687
-
688
- ```ts
689
- getActiveBackend(): ActiveBackend
690
- ```
691
-
692
670
  ### Verification
693
671
 
694
672
  #### `spec()` — Create a named, reusable bundle of verification checks.
@@ -1674,6 +1652,82 @@ color(hex: string): ShapeGroup
1674
1652
  | `body` | `string` | Function body: receives (u, v) in surface mm, returns height displacement. |
1675
1653
  | `constants` | `Record<string, number>` | Named constants injected into the function. |
1676
1654
 
1655
+ ### `Pattern2D`
1656
+
1657
+ #### `add()` — Add this pattern to one or more patterns or constant height offsets.
1658
+
1659
+ ```ts
1660
+ add(...patterns: Pattern2DInput[]): Pattern2D
1661
+ ```
1662
+
1663
+ #### `subtract()` — Subtract another pattern or constant height offset from this pattern.
1664
+
1665
+ ```ts
1666
+ subtract(pattern: Pattern2DInput): Pattern2D
1667
+ ```
1668
+
1669
+ #### `multiply()` — Multiply this pattern by one or more patterns or numeric scale factors.
1670
+
1671
+ ```ts
1672
+ multiply(...patterns: Pattern2DInput[]): Pattern2D
1673
+ ```
1674
+
1675
+ #### `min()` — Keep the lower height between this pattern and one or more other patterns.
1676
+
1677
+ ```ts
1678
+ min(...patterns: Pattern2DInput[]): Pattern2D
1679
+ ```
1680
+
1681
+ #### `max()` — Keep the higher height between this pattern and one or more other patterns.
1682
+
1683
+ ```ts
1684
+ max(...patterns: Pattern2DInput[]): Pattern2D
1685
+ ```
1686
+
1687
+ #### `clamp()` — Limit pattern height to the inclusive `[min, max]` range in millimeters.
1688
+
1689
+ ```ts
1690
+ clamp(min: number, max: number): Pattern2D
1691
+ ```
1692
+
1693
+ #### `abs()` — Convert negative heights to positive heights.
1694
+
1695
+ ```ts
1696
+ abs(): Pattern2D
1697
+ ```
1698
+
1699
+ #### `negate()` — Flip the pattern height sign.
1700
+
1701
+ ```ts
1702
+ negate(): Pattern2D
1703
+ ```
1704
+
1705
+ ### `Pattern2DBuilder`
1706
+
1707
+ #### `constant()` — Create a constant-height pattern in millimeters.
1708
+
1709
+ ```ts
1710
+ constant(value?: number): Pattern2D
1711
+ ```
1712
+
1713
+ #### `sineWave()` — Create a sinusoidal wave pattern in UV space.
1714
+
1715
+ ```ts
1716
+ sineWave(options: Pattern2DSineWaveOptions): Pattern2D
1717
+ ```
1718
+
1719
+ #### `stripes()` — Create recessed stripe bands in UV space.
1720
+
1721
+ ```ts
1722
+ stripes(options: Pattern2DStripesOptions): Pattern2D
1723
+ ```
1724
+
1725
+ #### `overUnderWeave()` — Create an over-under woven relief pattern in UV space.
1726
+
1727
+ ```ts
1728
+ overUnderWeave(options: Pattern2DOverUnderWeaveOptions): Pattern2D
1729
+ ```
1730
+
1677
1731
  ### `ShapeRef`
1678
1732
 
1679
1733
  A first-class reference path over a shape's semantic faces and face relationships.
@@ -1796,10 +1850,6 @@ toString(): string
1796
1850
 
1797
1851
  ### `ANCHOR3D_NAMES`
1798
1852
 
1799
- ### `DEFAULT_ACTIVE_BACKEND`
1800
-
1801
- Default geometry backend when no explicit backend is selected.
1802
-
1803
1853
  ### `verify`
1804
1854
 
1805
1855
  - `that(label: string, check: () => boolean, message?: string): void` — Custom predicate check.