forgecad 0.9.4 → 0.9.6
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.
- package/dist/assets/{AdminPage-jwoEgwE_.js → AdminPage-Da6hhpJx.js} +1 -1
- package/dist/assets/{BlogPage-Ck7g3ue2.js → BlogPage-Bl_sKeWb.js} +1 -1
- package/dist/assets/{DocsPage-9WaRC14b.js → DocsPage-Blz3Tp4j.js} +1 -6
- package/dist/assets/EditorApp-CuiPbtn5.js +12754 -0
- package/dist/assets/{EmbedViewer-37_PfMwv.js → EmbedViewer-BFG6-Ufm.js} +2 -2
- package/dist/assets/{LandingPageProofDriven-CO8WL0CY.js → LandingPageProofDriven-DB9fQd5P.js} +1 -1
- package/dist/assets/{PricingPage-DADKGuOa.js → PricingPage-BMxYT_F0.js} +1 -1
- package/dist/assets/{SettingsPage-DKKI4W49.js → SettingsPage-VVQNrCAg.js} +1 -1
- package/dist/assets/{app-CwI02pTA.js → app-Dl9ymBWC.js} +355 -36
- package/dist/assets/cli/{render-Kw5hLEcL.js → render-CFtwKCCY.js} +203 -862
- package/dist/assets/{sectionPlaneMath-C8N0w8o3.js → distance-BEC2RjJi.js} +4150 -801
- package/dist/assets/{evalWorker-D6ub3kfS.js → evalWorker-CRvbzTXm.js} +2611 -528
- package/dist/assets/{manifold-CwDdMKyc.js → manifold-B9QSr-qP.js} +1 -1
- package/dist/assets/{manifold-DTvmxSDf.js → manifold-DpBXFS2K.js} +1 -1
- package/dist/assets/{manifold-lru0jwVw.js → manifold-DzZ4VRPs.js} +2 -2
- package/dist/assets/{renderSceneState-tvtNKNRi.js → renderSceneState-BuAXF2jh.js} +1 -1
- package/dist/assets/{reportWorker-DeqktDGt.js → reportWorker-BNWEnRg1.js} +2606 -525
- package/dist/cli/render.html +1 -1
- package/dist/docs/index.html +2 -2
- package/dist/docs-raw/AI/usage.md +0 -1
- package/dist/docs-raw/API/core/concepts.md +11 -1
- package/dist/docs-raw/CLI.md +64 -13
- package/dist/docs-raw/beta-operations.md +4 -0
- package/dist/docs-raw/deployment.md +38 -23
- package/dist/docs-raw/generated/assembly.md +8 -3
- package/dist/docs-raw/generated/concepts.md +126 -46
- package/dist/docs-raw/generated/core.md +97 -47
- package/dist/docs-raw/generated/curves.md +113 -595
- package/dist/docs-raw/generated/lib.md +40 -3
- package/dist/docs-raw/generated/output.md +6 -1
- package/dist/docs-raw/generated/sdf.md +50 -4
- package/dist/docs-raw/generated/sketch.md +9 -1
- package/dist/docs-raw/generated/viewport.md +1 -9
- package/dist/docs-raw/guides/inspection-bundles.md +40 -9
- package/dist/docs-raw/runbook.md +3 -3
- package/dist/docs-raw/skills/forgecad-blockout-model.md +1 -0
- package/dist/docs-raw/skills/forgecad-image-replicator.md +3 -1
- package/dist/docs-raw/skills/forgecad-make-a-model.md +48 -4
- package/dist/docs-raw/skills/forgecad-render-inspect.md +3 -1
- package/dist/docs-raw/skills/forgecad-visual-spec.md +2 -0
- package/dist/docs-raw/skills/forgecad.md +2 -1
- package/dist/docs-raw/skills/index.md +0 -1
- package/dist/index.html +1 -1
- package/dist/sitemap.xml +6 -6
- package/dist-cli/blender/render.py +43 -8
- package/dist-cli/forgecad.js +5729 -2015
- package/dist-cli/forgecad.js.map +1 -1
- package/dist-skill/CONTEXT.md +372 -667
- package/dist-skill/SKILL-dev.md +2 -1
- package/dist-skill/SKILL.md +2 -1
- package/dist-skill/docs/API/core/concepts.md +11 -1
- package/dist-skill/docs/CLI.md +64 -13
- package/dist-skill/docs/generated/assembly.md +8 -3
- package/dist-skill/docs/generated/core.md +97 -47
- package/dist-skill/docs/generated/curves.md +113 -595
- package/dist-skill/docs/generated/lib.md +40 -3
- package/dist-skill/docs/generated/output.md +6 -1
- package/dist-skill/docs/generated/sdf.md +50 -4
- package/dist-skill/docs/generated/sketch.md +9 -1
- package/dist-skill/docs/generated/viewport.md +1 -9
- package/dist-skill/docs/guides/inspection-bundles.md +40 -9
- package/dist-skill/docs-dev/API/core/concepts.md +11 -1
- package/dist-skill/docs-dev/CLI.md +64 -13
- package/dist-skill/docs-dev/generated/assembly.md +8 -3
- package/dist-skill/docs-dev/generated/core.md +97 -47
- package/dist-skill/docs-dev/generated/curves.md +113 -595
- package/dist-skill/docs-dev/generated/lib.md +40 -3
- package/dist-skill/docs-dev/generated/output.md +6 -1
- package/dist-skill/docs-dev/generated/sdf.md +50 -4
- package/dist-skill/docs-dev/generated/sketch.md +9 -1
- package/dist-skill/docs-dev/generated/viewport.md +1 -9
- package/dist-skill/docs-dev/guides/inspection-bundles.md +40 -9
- package/dist-skill/library/README.md +0 -1
- package/dist-skill/library/forgecad-blockout-model/SKILL.md +1 -0
- package/dist-skill/library/forgecad-image-replicator/SKILL.md +3 -1
- package/dist-skill/library/forgecad-make-a-model/SKILL.md +48 -4
- package/dist-skill/library/forgecad-render-inspect/SKILL.md +3 -1
- package/dist-skill/library/forgecad-visual-spec/SKILL.md +2 -0
- package/examples/api/drive-wheel-regions.forge.js +43 -0
- package/examples/api/guided-loft-olive-oil-bottle.forge.js +135 -0
- package/examples/api/sdf-circular-array-knurling.forge.js +19 -0
- package/examples/api/sdf-pattern2d-ceramic-ripple-set.forge.js +83 -0
- package/examples/api/sdf-pattern2d-grip-tread.forge.js +72 -0
- package/examples/api/sdf-pattern2d-orbital-jewelry.forge.js +62 -0
- package/examples/api/sdf-surface-basket-weave.forge.js +67 -0
- package/examples/api/sector-gear-body.forge.js +34 -0
- package/package.json +20 -2
- package/dist/assets/EditorApp-Dja2jMmW.js +0 -12509
- package/dist/docs-raw/skills/forgecad-api-dogfood.md +0 -130
- 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
|
-
|
|
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).
|
|
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
|
|
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
|
-
|
|
624
|
-
const
|
|
625
|
-
const
|
|
626
|
-
const
|
|
627
|
-
|
|
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.
|