forgecad 0.9.16 → 0.10.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.
- package/dist/assets/{AdminPage-CXvls4-J.js → AdminPage-DwYHz72L.js} +1 -1
- package/dist/assets/{BenchmarkPage-B27zk8xL.js → BenchmarkPage-a9_f-1US.js} +1 -1
- package/dist/assets/{BlogPage-CMAVvgQL.js → BlogPage-DodHpvmf.js} +1 -1
- package/dist/assets/{DocsPage-knf4I4h7.js → DocsPage-B5LePEuj.js} +8 -858
- package/dist/assets/EditorApp-QXsAISLR.js +16307 -0
- package/dist/assets/{EmbedViewer-D7ZGlFjx.js → EmbedViewer-DdEHGUMU.js} +2 -2
- package/dist/assets/{LandingPageProofDriven-CnevhTE8.js → LandingPageProofDriven-yhhOodbf.js} +1 -1
- package/dist/assets/{LegalPage-BPTUmqeg.js → LegalPage-5RbKRGYK.js} +1 -1
- package/dist/assets/{PricingPage-B0D4goG_.js → PricingPage-E3Rma7aV.js} +1 -1
- package/dist/assets/{SettingsPage-CFF-UgjI.js → SettingsPage-BJZcM97j.js} +1 -1
- package/dist/assets/{app-T0pDcSX4.js → app-DSYrDg0V.js} +733 -205
- package/dist/assets/cli/{render-C5pcIISc.js → render-ZMHR9HkV.js} +19 -46
- package/dist/assets/{constructionHistoryWorker-Ba2Hm58b.js → constructionHistoryWorker-AwMMWSxg.js} +1103 -349
- package/dist/assets/{evalWorker-vkx310U2.js → evalWorker-DbNs7Dkp.js} +3798 -1622
- package/dist/assets/{inspectWorker-BuTJDVX6.js → inspectWorker-CZsCFtQT.js} +1163 -409
- package/dist/assets/{jointPose-B_Cgedn9.js → jointPose-DO6mnXn_.js} +1 -1
- package/dist/assets/{manifold-BWgsjmAM.js → manifold-BGlQBBH9.js} +1 -1
- package/dist/assets/{manifold-rZexZI0G.js → manifold-BU-tJwQh.js} +1 -1
- package/dist/assets/{manifold-D6IFSkhH.js → manifold-fy2MV7K1.js} +2 -2
- package/dist/assets/{reportWorker-0AGij1Ru.js → reportWorker-DO6hcQbh.js} +7155 -2437
- package/dist/assets/{scalar-sampling-budget-J5cuzxT1.js → scalar-sampling-budget-o90NSNmF.js} +3940 -1742
- package/dist/assets/{scanProxyWorker-Vl4Wxa1y.js → scanProxyWorker-2GtDLk-R.js} +1 -1
- package/dist/assets/{javascript-1kQXfVaz.js → typescript-DBQ6RN5l.js} +874 -22
- package/dist/cli/render.html +1 -1
- package/dist/docs/index.html +3 -3
- package/dist/docs-raw/AI/usage.md +1 -1
- package/dist/docs-raw/CLI.md +63 -241
- package/dist/docs-raw/README.md +6 -0
- package/dist/docs-raw/component-model.md +17 -150
- package/dist/docs-raw/generated/assembly.md +139 -598
- package/dist/docs-raw/generated/concepts.md +245 -3501
- package/dist/docs-raw/generated/core.md +277 -1251
- package/dist/docs-raw/generated/curves.md +387 -1608
- package/dist/docs-raw/generated/legacy.md +162 -0
- package/dist/docs-raw/generated/lib.md +227 -85
- package/dist/docs-raw/generated/output.md +38 -73
- package/dist/docs-raw/generated/runtime-names.md +23 -23
- package/dist/docs-raw/generated/sdf.md +68 -284
- package/dist/docs-raw/generated/sheet-metal.md +68 -335
- package/dist/docs-raw/generated/sketch.md +240 -1161
- package/dist/docs-raw/generated/viewport.md +75 -316
- package/dist/docs-raw/generated/wood.md +21 -49
- package/dist/docs-raw/guides/coordinate-system.md +4 -42
- package/dist/docs-raw/guides/inspection-bundles.md +44 -442
- package/dist/docs-raw/guides/joint-design.md +18 -79
- package/dist/docs-raw/guides/positioning.md +21 -143
- package/dist/docs-raw/guides/scene-presentation.md +89 -0
- package/dist/docs-raw/skills/forgecad-3d-reconstruction.md +25 -111
- package/dist/docs-raw/skills/forgecad-blockout-model.md +20 -117
- package/dist/docs-raw/skills/forgecad-component-model.md +23 -107
- package/dist/docs-raw/skills/forgecad-high-level-spec.md +47 -155
- package/dist/docs-raw/skills/forgecad-image-replicator.md +26 -143
- package/dist/docs-raw/skills/forgecad-lld.md +19 -113
- package/dist/docs-raw/skills/forgecad-make-a-model.md +112 -532
- package/dist/docs-raw/skills/forgecad-model-grader.md +38 -108
- package/dist/docs-raw/skills/forgecad-prepare-prompt.md +24 -211
- package/dist/docs-raw/skills/forgecad-project.md +13 -131
- package/dist/docs-raw/skills/forgecad-reconstruction-benchmark.md +42 -134
- package/dist/docs-raw/skills/forgecad-render-inspect.md +27 -174
- package/dist/docs-raw/skills/forgecad-visual-spec.md +32 -112
- package/dist/docs-raw/skills/forgecad.md +19 -18
- package/dist/docs-raw/skills/index.md +2 -0
- package/dist/docs-raw/welcome.md +2 -2
- package/dist/index.html +1 -1
- package/dist/llms.txt +1 -2
- package/dist/sitemap.xml +13 -13
- package/dist-cli/{check-compiler-SYQ2PWOB.js → check-compiler-JTVBITCR.js} +1 -1
- package/dist-cli/{check-query-propagation-HIAGV62W.js → check-query-propagation-3FFLSMVN.js} +1 -1
- package/dist-cli/{chunk-SPZE3DUY.js → chunk-OAN5T4XD.js} +4412 -2212
- package/dist-cli/forgecad.js +507 -179
- package/dist-skill/CONTEXT.md +2172 -8377
- package/dist-skill/SKILL.md +15 -15
- package/dist-skill/docs/API/core/concepts.md +27 -157
- package/dist-skill/docs/CLI.md +63 -241
- package/dist-skill/docs/generated/assembly.md +138 -549
- package/dist-skill/docs/generated/core.md +277 -1251
- package/dist-skill/docs/generated/curves.md +387 -1609
- package/dist-skill/docs/generated/lib.md +227 -85
- package/dist-skill/docs/generated/output.md +38 -73
- package/dist-skill/docs/generated/runtime-names.md +16 -21
- package/dist-skill/docs/generated/sdf.md +68 -284
- package/dist-skill/docs/generated/sheet-metal.md +68 -335
- package/dist-skill/docs/generated/sketch.md +240 -1160
- package/dist-skill/docs/generated/viewport.md +75 -223
- package/dist-skill/docs/generated/wood.md +21 -49
- package/dist-skill/docs/guides/coordinate-system.md +4 -42
- package/dist-skill/docs/guides/inspection-bundles.md +44 -442
- package/dist-skill/docs/guides/joint-design.md +18 -79
- package/dist-skill/docs/guides/positioning.md +21 -143
- package/dist-skill/docs/guides/scene-presentation.md +89 -0
- package/dist-skill/docs/guides/surface-members.md +26 -0
- package/dist-skill/library/forgecad-3d-reconstruction/SKILL.md +23 -111
- package/dist-skill/library/forgecad-blockout-model/SKILL.md +18 -117
- package/dist-skill/library/forgecad-component-model/SKILL.md +21 -107
- package/dist-skill/library/forgecad-high-level-spec/SKILL.md +45 -155
- package/dist-skill/library/forgecad-image-replicator/SKILL.md +24 -143
- package/dist-skill/library/forgecad-lld/SKILL.md +17 -113
- package/dist-skill/library/forgecad-make-a-model/SKILL.md +110 -532
- package/dist-skill/library/forgecad-model-grader/SKILL.md +36 -108
- package/dist-skill/library/forgecad-prepare-prompt/SKILL.md +35 -224
- package/dist-skill/library/forgecad-prepare-prompt/references/default-profiles.md +43 -271
- package/dist-skill/library/forgecad-prepare-prompt/references/master-prompt.md +30 -99
- package/dist-skill/library/forgecad-project/SKILL.md +13 -133
- package/dist-skill/library/forgecad-reconstruction-benchmark/SKILL.md +29 -123
- package/dist-skill/library/forgecad-render-inspect/SKILL.md +25 -174
- package/dist-skill/library/forgecad-visual-spec/SKILL.md +30 -111
- package/dist-skill/website/skills/forgecad-3d-reconstruction.md +58 -0
- package/dist-skill/website/skills/forgecad-blockout-model.md +49 -0
- package/dist-skill/website/skills/forgecad-component-model.md +53 -0
- package/dist-skill/website/skills/forgecad-high-level-spec.md +101 -0
- package/dist-skill/website/skills/forgecad-image-replicator.md +63 -0
- package/dist-skill/website/skills/forgecad-lld.md +41 -0
- package/dist-skill/website/skills/forgecad-make-a-model.md +186 -0
- package/dist-skill/website/skills/forgecad-model-grader.md +82 -0
- package/dist-skill/website/skills/forgecad-prepare-prompt.md +63 -0
- package/dist-skill/website/skills/forgecad-project.md +26 -0
- package/dist-skill/website/skills/forgecad-reconstruction-benchmark.md +60 -0
- package/dist-skill/website/skills/forgecad-render-inspect.md +80 -0
- package/dist-skill/website/skills/forgecad-visual-spec.md +71 -0
- package/dist-skill/website/skills/forgecad.md +122 -0
- package/dist-skill/website/skills/index.md +26 -0
- package/examples/api/comparison-imported-sphere-candidate.forge.js +1 -1
- package/examples/api/conformal-product-ribbon.forge.js +1 -1
- package/examples/api/exact-sheet-shell-assembly.forge.js +1 -1
- package/examples/api/extrude-options.forge.js +4 -2
- package/examples/api/field-loft-drive-tip.forge.js +40 -0
- package/examples/api/guided-loft-olive-oil-bottle.forge.js +1 -1
- package/examples/api/highlight-debug.forge.js +10 -10
- package/examples/api/mesh-import-slats.forge.js +1 -1
- package/examples/api/real-product-curves.forge.js +1 -1
- package/examples/api/sculpt-box-circle-booleans.forge.js +1 -1
- package/examples/api/sdf-shapes.forge.js +2 -5
- package/examples/api/sketch-rounding-strategies.forge.js +6 -6
- package/examples/api/surface-member-bottle-cage.forge.js +3 -3
- package/examples/api/surface-member-conformal-product-ribbon.forge.js +3 -3
- package/examples/api/surface-member-razor-inlay.forge.js +1 -1
- package/examples/api/variable-sweep-test.forge.js +3 -3
- package/examples/mechanical/airplane-propeller.forge.js +74 -39
- package/examples/nurbs-surface.forge.js +1 -1
- package/examples/products/iphone.forge.js +1 -1
- package/package.json +1 -1
- package/dist/assets/EditorApp-BHMQlJ-D.js +0 -14686
- package/dist/docs-raw/guides/geometry-conventions.md +0 -52
- package/dist/docs-raw/guides/modeling-recipes.md +0 -78
- package/dist-skill/docs/guides/geometry-conventions.md +0 -52
- package/dist-skill/docs/guides/modeling-recipes.md +0 -78
- package/dist-skill/library/forgecad-visual-spec/references/prompt-template.md +0 -79
|
@@ -9,14 +9,14 @@ Dimensions, BOM entries, verification checks, and sketch export.
|
|
|
9
9
|
|
|
10
10
|
## Contents
|
|
11
11
|
|
|
12
|
-
- [Annotations & Output](#annotations-output)
|
|
13
|
-
- [Sketch Export](#sketch-export)
|
|
12
|
+
- [Annotations & Output](#annotations-output)
|
|
13
|
+
- [Sketch Export](#sketch-export)
|
|
14
14
|
|
|
15
15
|
## Functions
|
|
16
16
|
|
|
17
17
|
### Annotations & Output
|
|
18
18
|
|
|
19
|
-
#### `bom()` — Register a Bill of Materials entry for report export.
|
|
19
|
+
#### `bom(quantity: number, description: string, opts?: BomOpts): void` — Register a Bill of Materials entry for report export.
|
|
20
20
|
|
|
21
21
|
BOM entries are accumulated during script execution and exported alongside the model in report views. Rows are grouped by normalized `description + unit`. Pass an explicit `key` to force multiple descriptions to collapse into a single line item.
|
|
22
22
|
|
|
@@ -42,10 +42,6 @@ bom(tubeLen, "rectangular steel tube", {
|
|
|
42
42
|
});
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
```ts
|
|
46
|
-
bom(quantity: number, description: string, opts?: BomOpts): void
|
|
47
|
-
```
|
|
48
|
-
|
|
49
45
|
**`BomOpts`**
|
|
50
46
|
|
|
51
47
|
| Option | Type | Description |
|
|
@@ -62,9 +58,9 @@ bom(quantity: number, description: string, opts?: BomOpts): void
|
|
|
62
58
|
| `notes?` | `string` | Free-form notes |
|
|
63
59
|
| `grain?` | `string` | Wood grain direction, e.g. "long", "cross" |
|
|
64
60
|
|
|
65
|
-
#### `robotExport()` — Declare that this script should export the assembly as a SDF/URDF robot package.
|
|
61
|
+
#### `robotExport(options: RobotExportOptions): CollectedRobotExport` — Declare that this script should export the assembly as a SDF/URDF robot package.
|
|
66
62
|
|
|
67
|
-
Call `robotExport()` alongside your assembly definition.
|
|
63
|
+
Call `robotExport()` alongside your assembly definition. `forgecad export sdf` / `forgecad export urdf` pick up the declaration (see the CLI docs for flags) and produce a robot package with:
|
|
68
64
|
|
|
69
65
|
- Mesh-based inertia tensors (full 6-component, not bounding-box approximations)
|
|
70
66
|
- Separate collision meshes (convex hull by default — ~50–80% smaller)
|
|
@@ -87,22 +83,10 @@ Call `robotExport()` alongside your assembly definition. The CLI commands `forge
|
|
|
87
83
|
- Compatibility coupling metadata, when present, maps only the primary term (largest ratio) to `<mimic>` — SDF/URDF support single-leader mimic only. Dropped terms emit a warning.
|
|
88
84
|
|
|
89
85
|
```ts
|
|
90
|
-
const rover = assembly("Scout")
|
|
91
|
-
.addPart("Chassis", box(300, 220, 50).translate(0, 0, -25))
|
|
92
|
-
.addPart("Left Wheel", cylinder(30, 60, undefined, 48).translate(0, 0, -15))
|
|
93
|
-
.addRevolute("leftWheel", "Chassis", "Left Wheel", {
|
|
94
|
-
axis: [0, 1, 0],
|
|
95
|
-
frame: Transform.identity().translate(90, 140, 60),
|
|
96
|
-
effort: 20, velocity: 1080,
|
|
97
|
-
});
|
|
98
|
-
|
|
99
86
|
robotExport({
|
|
100
|
-
assembly: rover,
|
|
87
|
+
assembly: rover, // assembly() with parts + revolute wheel joints
|
|
101
88
|
modelName: "Scout",
|
|
102
|
-
links: {
|
|
103
|
-
Chassis: { massKg: 10 },
|
|
104
|
-
"Left Wheel": { massKg: 0.8 },
|
|
105
|
-
},
|
|
89
|
+
links: { Chassis: { massKg: 10 }, "Left Wheel": { massKg: 0.8 } },
|
|
106
90
|
plugins: {
|
|
107
91
|
diffDrive: {
|
|
108
92
|
leftJoints: ["leftWheel"], rightJoints: ["rightWheel"],
|
|
@@ -113,17 +97,6 @@ robotExport({
|
|
|
113
97
|
});
|
|
114
98
|
```
|
|
115
99
|
|
|
116
|
-
**CLI usage**
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
forgecad export sdf model.forge.js # SDF package (Gazebo/Ignition)
|
|
120
|
-
forgecad export urdf model.forge.js # URDF package (ROS/PyBullet/MuJoCo)
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
```ts
|
|
124
|
-
robotExport(options: RobotExportOptions): CollectedRobotExport
|
|
125
|
-
```
|
|
126
|
-
|
|
127
100
|
**`RobotExportOptions`**: `assembly: Assembly`, `modelName?: string`, `state?: JointState`, `static?: boolean`, `selfCollide?: boolean`, `allowAutoDisable?: boolean`, `links?: Record<string, RobotLinkExportOptions>`, `joints?: Record<string, RobotJointExportOptions>`, `plugins?: { diffDrive?: RobotDiffDrivePluginOptions; jointStatePublisher?: RobotJointStatePublisherOptions; }`, `world?: RobotWorldOptions`
|
|
128
101
|
|
|
129
102
|
`RobotLinkExportOptions`: `{ massKg?: number, densityKgM3?: number, collision?: "visual" | "convex" | "box" | "none" }`
|
|
@@ -144,21 +117,13 @@ robotExport(options: RobotExportOptions): CollectedRobotExport
|
|
|
144
117
|
|
|
145
118
|
**`AssemblyPartDef`**: `name: string`, `part: AssemblyPart`, `base: Transform`, `metadata?: PartMetadata`, `mates: AssemblyPartMateInput[]`, `bindToFrame?: string`
|
|
146
119
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
| Option | Type | Description |
|
|
150
|
-
|--------|------|-------------|
|
|
151
|
-
| `tags?` | `string \| readonly string[]` | Viewport organization tags applied to scene objects produced from this part. |
|
|
152
|
-
| `material?`, `process?`, `tolerance?`, `qty?`, `notes?`, `densityKgM3?`, `massKg?` | | — |
|
|
120
|
+
`PartMetadata` — defined in [assembly](/docs/assembly).
|
|
153
121
|
|
|
154
|
-
|
|
155
|
-
- `connector: string` — Name of a connector declared on the part (via `withConnectors()`).
|
|
156
|
-
- `toLink: string` — Name of the link this connector's origin is pinned to.
|
|
157
|
-
- `aimLink?: string` — Optional second link to orient toward. When set, the part is rotated so the connector's **axis** aims from `toLink` toward `aimLink`, posing an oriented bone instead of only translating it. For full pose without relying on a connector axis, declare a second mate (two connectors → two links).
|
|
122
|
+
`AssemblyPartMateInput` — defined in [assembly](/docs/assembly).
|
|
158
123
|
|
|
159
124
|
**`AssemblyJointDef`**: `name: string`, `type: JointType`, `parent: string`, `child: string`, `frame: Transform`, `axis: Vec3`, `min?: number`, `max?: number`, `defaultValue: number`, `unit?: string`, `effort?: number`, `velocity?: number`, `damping?: number`, `friction?: number`, `connectorRefs?: JointConnectorRefs`
|
|
160
125
|
|
|
161
|
-
`JointConnectorRefs
|
|
126
|
+
`JointConnectorRefs` — defined in [assembly](/docs/assembly).
|
|
162
127
|
|
|
163
128
|
`AssemblyJointCouplingDef`: `{ joint: string, terms: JointCouplingTermRecord[], offset: number }`
|
|
164
129
|
|
|
@@ -170,13 +135,15 @@ robotExport(options: RobotExportOptions): CollectedRobotExport
|
|
|
170
135
|
|
|
171
136
|
**`AssemblyEdgeBetweenLinksDef`**: `name: string`, `a: string`, `b: string`, `length: number | null`, `min?: number`, `max?: number`, `visualOnly: boolean`, `control?: AssemblyKinematicControlOptions`, `metadata?: Record<string, unknown>`
|
|
172
137
|
|
|
173
|
-
`AssemblyKinematicControlOptions
|
|
138
|
+
`AssemblyKinematicControlOptions` — defined in [assembly](/docs/assembly).
|
|
174
139
|
|
|
175
140
|
**`AssemblyAngleBetweenLinksDef`**: `name: string`, `a?: string`, `b: string`, `c: string`, `reference?: AssemblyAngleReferenceDef`, `target?: number`, `min?: number`, `max?: number`, `control?: AssemblyKinematicControlOptions`, `metadata?: Record<string, unknown>`
|
|
176
141
|
|
|
177
142
|
`AssemblyAngleReferenceDef`: `{ kind: "worldDirection", direction: Vec3 }`
|
|
178
143
|
|
|
179
|
-
|
|
144
|
+
**`AssemblyDerivedLinkDef`**
|
|
145
|
+
- `distance: number` — Signed: positive moves from `fromLink` toward `towardLink`, negative moves away.
|
|
146
|
+
- Also: `name: string`, `fromLink: string`, `towardLink: string`.
|
|
180
147
|
|
|
181
148
|
`AssemblyFrameDef`: `{ name: string, origin: Vec3, axis: Vec3, up: Vec3, fixed: boolean, metadata?: Record<string, unknown> }`
|
|
182
149
|
|
|
@@ -184,12 +151,20 @@ robotExport(options: RobotExportOptions): CollectedRobotExport
|
|
|
184
151
|
|
|
185
152
|
`AssemblyFrameEdgeDef`: `{ name: string, a: string, b: string, metadata?: Record<string, unknown> }`
|
|
186
153
|
|
|
187
|
-
#### `dim()` — Add a dimension annotation between two points.
|
|
154
|
+
#### `dim()` — Add a dimension annotation between two points, or along an entity.
|
|
155
|
+
|
|
156
|
+
Overloads:
|
|
157
|
+
|
|
158
|
+
- `dim(line: Line2D, opts?: DimOpts): void`
|
|
159
|
+
- `dim(edge: EdgeRef, opts?: DimOpts): void`
|
|
160
|
+
- `dim(from: PointArg, to: PointArg, opts?: DimOpts): void`
|
|
188
161
|
|
|
189
162
|
Dimension annotations are purely visual callouts rendered in the viewport and report export. They do not affect geometry or constrain the model.
|
|
190
163
|
|
|
191
164
|
Point arguments accept 2D tuples `[x, y]`, 3D tuples `[x, y, z]`, or [`Point2D`](/docs/sketch#point2d) objects (Z is treated as 0 for 2D inputs).
|
|
192
165
|
|
|
166
|
+
Entity arguments: pass a single [`Line2D`](/docs/sketch#line2d) (from a constrained sketch) or an `EdgeRef` (from `shape.edge('left')`) as the first argument to dimension along that entity directly — no manual endpoint extraction needed.
|
|
167
|
+
|
|
193
168
|
**Ownership Rules (Report Pages)**
|
|
194
169
|
|
|
195
170
|
- `currentComponent: true` — deterministic ownership by the calling import instance. Use when authoring reusable imported parts.
|
|
@@ -201,33 +176,31 @@ Point arguments accept 2D tuples `[x, y]`, 3D tuples `[x, y, z]`, or [`Point2D`]
|
|
|
201
176
|
dim([-w / 2, 0, 0], [w / 2, 0, 0], { label: "Width" });
|
|
202
177
|
dim([0, 0, -h / 2], [0, 0, h / 2], { label: "Height", offset: 14 });
|
|
203
178
|
dim([0, 0, 0], [100, 0, 0], { component: "Base", color: "#00AAFF" });
|
|
179
|
+
dim(sk.line(a, b), { label: "Span", offset: -8 }); // Line2D entity
|
|
180
|
+
dim(myBox.edge("top-right"), { label: "Depth" }); // EdgeRef entity
|
|
204
181
|
```
|
|
205
182
|
|
|
206
|
-
`
|
|
183
|
+
[`Line2D`](/docs/sketch#line2d) / `EdgeRef` entity (then pass `opts` as the second argument)
|
|
207
184
|
|
|
208
|
-
|
|
209
|
-
dim(from: PointArg, to: PointArg, opts?: DimOpts): void
|
|
210
|
-
```
|
|
185
|
+
`component` (string or string[] — report ownership), `currentComponent` (boolean)
|
|
211
186
|
|
|
212
187
|
`DimOpts`: `{ offset?: number, label?: string, color?: string, component?: string | string[], currentComponent?: boolean }`
|
|
213
188
|
|
|
214
|
-
|
|
189
|
+
**`EdgeRef`**
|
|
215
190
|
|
|
216
|
-
|
|
191
|
+
| Option | Type | Description |
|
|
192
|
+
|--------|------|-------------|
|
|
193
|
+
| `start` | `Vec3` | Start point |
|
|
194
|
+
| `end` | `Vec3` | End point |
|
|
195
|
+
| `query?` | `EdgeQueryRef` | Compiler-owned edge query when available. |
|
|
196
|
+
| `curve?` | `EdgeCurve` | Exact or parametric curve family when the backend/source can identify one. |
|
|
197
|
+
| `faceName?` | `string` | Owning face name when the edge is associated with one face in a larger topology. |
|
|
217
198
|
|
|
218
|
-
|
|
219
|
-
const a = point(0, 0);
|
|
220
|
-
const b = point(100, 0);
|
|
221
|
-
dimLine(line(a, b), { label: "Span", offset: -8 });
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
```ts
|
|
225
|
-
dimLine(l: Line2D, opts?: DimOpts): void
|
|
226
|
-
```
|
|
199
|
+
Also: `name: EdgeName`.
|
|
227
200
|
|
|
228
201
|
### Sketch Export
|
|
229
202
|
|
|
230
|
-
#### `sketchToDxf()` — Export a 2D sketch as a DXF string (R12/AC1009 — maximally compatible).
|
|
203
|
+
#### `sketchToDxf(sketch: Sketch, options?: SketchDxfOptions): string` — Export a 2D sketch as a DXF string (R12/AC1009 — maximally compatible).
|
|
231
204
|
|
|
232
205
|
For regular sketches, each polygon loop becomes a closed `LWPOLYLINE`. For constrained sketches, exports raw `LINE`, `CIRCLE`, and `ARC` entities from the constraint edge geometry, which preserves internal/shared edges that `toPolygons()` would merge away.
|
|
233
206
|
|
|
@@ -238,15 +211,11 @@ const s = rect(100, 60);
|
|
|
238
211
|
const dxf = sketchToDxf(s, { layer: 'cut' });
|
|
239
212
|
```
|
|
240
213
|
|
|
241
|
-
```ts
|
|
242
|
-
sketchToDxf(sketch: Sketch, options?: SketchDxfOptions): string
|
|
243
|
-
```
|
|
244
|
-
|
|
245
214
|
**`SketchDxfOptions`**
|
|
246
215
|
- `layer?: string` — DXF layer name. Default: "0"
|
|
247
216
|
- `colorIndex?: number` — DXF color index (1–255, AutoCAD ACI). Default: 7 (white/black)
|
|
248
217
|
|
|
249
|
-
#### `sketchToSvg()` — Export a 2D sketch as an SVG string.
|
|
218
|
+
#### `sketchToSvg(sketch: Sketch, options?: SketchSvgOptions): string` — Export a 2D sketch as an SVG string.
|
|
250
219
|
|
|
251
220
|
For regular sketches, exports filled polygon regions. For constrained sketches, exports raw edge geometry (LINE, ARC, CIRCLE) which preserves internal/shared edges that `toPolygons()` would merge away.
|
|
252
221
|
|
|
@@ -257,10 +226,6 @@ const s = rect(100, 60);
|
|
|
257
226
|
const svg = sketchToSvg(s, { stroke: '#333', strokeWidth: 0.8 });
|
|
258
227
|
```
|
|
259
228
|
|
|
260
|
-
```ts
|
|
261
|
-
sketchToSvg(sketch: Sketch, options?: SketchSvgOptions): string
|
|
262
|
-
```
|
|
263
|
-
|
|
264
229
|
**`SketchSvgOptions`**
|
|
265
230
|
|
|
266
231
|
| Option | Type | Description |
|
|
@@ -14,35 +14,35 @@ Agents should avoid declaring these names with top-level `const`, `let`, destruc
|
|
|
14
14
|
These collision-reserved names are case-sensitive:
|
|
15
15
|
|
|
16
16
|
```text
|
|
17
|
-
activateBackend, Analysis, arcSlot, assembly, Assembly,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
setInterval, setTimeout, Shape, ShapeGroup, sheetMetal, SheetMetalPart, sheetStock, Sketch
|
|
34
|
-
sketchToDxf, sketchToSvg, slot, Slot, SolvedAssembly, spec, sphere, spline2d
|
|
35
|
-
star, stroke, Surface, SurfaceBody, SurfaceMembers, surfacePatch, sweep, tabSlot
|
|
36
|
-
text2d, textWidth, torus, toShape, Transform, union, union2d, variableSweep
|
|
37
|
-
verify, viewConfig, Viewport, window, Wood
|
|
17
|
+
activateBackend, Analysis, arcSlot, assembly, Assembly, Blend, bom, box
|
|
18
|
+
cameraTrajectory, Carrier, chamfer, circle2d, Circle2D, circularLayout, circularPattern, circularPattern2d
|
|
19
|
+
coalesceEdges, compareWith, connector, console, constrainedSketch, Curve, Curve3D, cutPlane
|
|
20
|
+
cylinder, difference, difference2d, dim, draft, ellipse, explodeView, faceProfile
|
|
21
|
+
fillet, Function, gcode, GCodeBuilder, getActiveBackend, global, globalThis, group
|
|
22
|
+
Import, ImportedAssembly, initKernel, intersection, intersection2d, intersectWithPlane, joint, Laser
|
|
23
|
+
lib, Line2D, linearPattern, linearPattern2d, loadFont, loft, Loft, mirrorCopy
|
|
24
|
+
mock, ngon, NurbsCurve3D, NurbsSurface, offsetSolid, param, Param, path
|
|
25
|
+
Point2D, Points, polygon, polygonVertices, port, Product, ProductPanelBuilder, ProductRibbonBuilder
|
|
26
|
+
ProductSkin, ProductSkinBuilder, ProductStationBuilder, ProductSurfaceBuilder, ProductSurfaceRef, projectToPlane, queueMicrotask, rect
|
|
27
|
+
Rectangle2D, robotExport, roundedRect, Route3D, scene, Sculpt, sdf, SdfShape
|
|
28
|
+
selectEdge, selectEdges, self, setActiveBackend, setImmediate, setInterval, setTimeout, Shape
|
|
29
|
+
ShapeGroup, sheetMetal, SheetMetalPart, sheetStock, Sketch, sketchToDxf, sketchToSvg, slot
|
|
30
|
+
SolvedAssembly, spec, sphere, spline2d, stroke, Surface, SurfaceBody, SurfaceMembers
|
|
31
|
+
sweep, text2d, textWidth, torus, toShape, Transform, union, union2d
|
|
32
|
+
variableSweep, verify, Viewport, window, Wood
|
|
38
33
|
```
|
|
39
34
|
|
|
40
35
|
<!-- forgecad-skill:exclude-start symbol="compatibility runtime names" reason="Compatibility-only renamed runtime globals." -->
|
|
41
36
|
Compatibility-only renamed runtime globals are also reserved in human-authored scripts, but are omitted from shipped agent skills so agents do not learn retired authoring APIs:
|
|
42
37
|
|
|
43
38
|
```text
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
assemblyInstructions, assemblyPreview, bomToCsv, boolParam, chamferTrackedEdge, choiceParam, circle, combine
|
|
40
|
+
COMMON_KERFS, composeChain, connectEdges, Constraint, Counterbore, degrees, dimLine, filletCorners
|
|
41
|
+
filletTrackedEdge, fingerJoint, flatPanel, flatPart, formatInstructions, Helix, HelixCurve, hermiteTransitionG2
|
|
42
|
+
highlight, importMesh, importStep, importSvgSketch, jointsView, laserKit, line, listParam
|
|
43
|
+
loftAlongSpine, lookupKerf, nurbs3d, nurbsSurface, point, ProductHandleBuilder, ProductHandleFeature, ProductSpoutBuilder
|
|
44
|
+
radians, Ribs, Slot, spline3d, star, surfacePatch, tabSlot, transitionCurve
|
|
45
|
+
transitionSurface, viewConfig
|
|
46
46
|
```
|
|
47
47
|
<!-- forgecad-skill:exclude-end -->
|
|
48
48
|
|