forgecad 0.9.15 → 0.9.16
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-CDyGUinA.js → AdminPage-CXvls4-J.js} +1 -1
- package/dist/assets/{BenchmarkPage-DfPMY_-d.js → BenchmarkPage-B27zk8xL.js} +1 -1
- package/dist/assets/{BlogPage-kF0fkdJT.js → BlogPage-CMAVvgQL.js} +1 -1
- package/dist/assets/{DocsPage-B954L3YN.js → DocsPage-knf4I4h7.js} +1 -1
- package/dist/assets/EditorApp-BHMQlJ-D.js +14686 -0
- package/dist/assets/{EditorApp-CuDLxKqL.css → EditorApp-BpjZgzk0.css} +148 -0
- package/dist/assets/{EmbedViewer-C77B-TrF.js → EmbedViewer-D7ZGlFjx.js} +2 -2
- package/dist/assets/{LandingPageProofDriven-Cr6fXMDj.js → LandingPageProofDriven-CnevhTE8.js} +2 -2
- package/dist/assets/{LegalPage-Dzklqmmg.js → LegalPage-BPTUmqeg.js} +1 -1
- package/dist/assets/{PricingPage-zWXkvlwl.js → PricingPage-B0D4goG_.js} +1 -1
- package/dist/assets/{SettingsPage-Bz0of4KQ.js → SettingsPage-CFF-UgjI.js} +1 -1
- package/dist/assets/{app-D3kDkggg.js → app-T0pDcSX4.js} +1184 -218
- package/dist/assets/cli/{render-DSY3mMQa.js → render-C5pcIISc.js} +144 -26
- package/dist/assets/{constructionHistoryWorker-gpDo-uH2.js → constructionHistoryWorker-Ba2Hm58b.js} +1 -0
- package/dist/assets/{evalWorker-CU0Ke6DP.js → evalWorker-vkx310U2.js} +1380 -2173
- package/dist/assets/{inspectWorker-COyp8XXA.js → inspectWorker-BuTJDVX6.js} +252 -30
- package/dist/assets/{targets-B9sGB5nB.js → jointPose-B_Cgedn9.js} +71 -3
- package/dist/assets/{manifold-DNkrUWpA.js → manifold-BWgsjmAM.js} +1 -1
- package/dist/assets/{manifold-C-3h2M7p.js → manifold-D6IFSkhH.js} +2 -2
- package/dist/assets/{manifold-BRI5prcH.js → manifold-rZexZI0G.js} +1 -1
- package/dist/assets/{reportWorker-CdBz5bNg.js → reportWorker-0AGij1Ru.js} +1373 -2166
- package/dist/assets/{scalar-sampling-budget-wJF98aY9.js → scalar-sampling-budget-J5cuzxT1.js} +1494 -2251
- package/dist/assets/{scanProxyWorker-B-9VbLIs.js → scanProxyWorker-Vl4Wxa1y.js} +18 -5
- package/dist/cli/render.html +1 -1
- package/dist/docs/index.html +1 -1
- package/dist/docs-raw/AI/usage.md +2 -0
- package/dist/docs-raw/CLI.md +4 -0
- package/dist/docs-raw/generated/assembly.md +104 -6
- package/dist/docs-raw/generated/concepts.md +14 -4
- package/dist/docs-raw/generated/lib.md +2 -18
- package/dist/docs-raw/generated/output.md +14 -4
- package/dist/docs-raw/generated/runtime-names.md +27 -19
- package/dist/docs-raw/skills/forgecad-make-a-model.md +39 -38
- package/dist/docs-raw/skills/forgecad-project.md +2 -0
- package/dist/docs-raw/welcome.md +2 -0
- package/dist/index.html +1 -1
- package/dist/sitemap.xml +13 -13
- package/dist-cli/{check-compiler-SDX5QIXI.js → check-compiler-SYQ2PWOB.js} +1 -1
- package/dist-cli/{check-query-propagation-EAYEFT77.js → check-query-propagation-HIAGV62W.js} +1 -1
- package/dist-cli/{chunk-N4O47JLF.js → chunk-SPZE3DUY.js} +1591 -2356
- package/dist-cli/forgecad.js +1698 -487
- package/dist-skill/CONTEXT.md +117 -46
- package/dist-skill/docs/CLI.md +4 -0
- package/dist-skill/docs/generated/assembly.md +83 -5
- package/dist-skill/docs/generated/lib.md +2 -18
- package/dist-skill/docs/generated/output.md +14 -4
- package/dist-skill/docs/generated/runtime-names.md +18 -19
- package/dist-skill/library/forgecad-make-a-model/SKILL.md +39 -38
- package/dist-skill/library/forgecad-project/SKILL.md +2 -0
- package/examples/api/helix-basics.forge.js +2 -2
- package/examples/api/route3d-elbow.forge.js +3 -0
- package/examples/api/variable-sweep-test.forge.js +3 -1
- package/package.json +4 -1
- package/dist/assets/EditorApp-Beb-IZ0y.js +0 -14014
- package/examples/api/bolted-service-cover.forge.js +0 -17
- package/examples/api/cable-gland-anchor.forge.js +0 -14
- package/examples/api/captured-cartridge-guide.forge.js +0 -14
- package/examples/api/captured-linear-slide.forge.js +0 -13
- package/examples/api/clevis-pin-joint.forge.js +0 -13
- package/examples/api/datum-enclosure.forge.js +0 -16
- package/examples/api/hose-barb-port.forge.js +0 -14
- package/examples/api/knuckled-hinge-assembly.forge.js +0 -15
- package/examples/api/living-hinge-cover.forge.js +0 -14
- package/examples/api/pcb-terminal-block.forge.js +0 -22
- package/examples/api/pinned-lever-pivot-stack.forge.js +0 -14
- package/examples/api/retained-shaft-knob-stack.forge.js +0 -15
- package/examples/api/routed-tube-clip.forge.js +0 -15
- package/examples/api/seated-bearing-stack.forge.js +0 -30
- package/examples/api/snap-latch-cover.forge.js +0 -14
- package/examples/api/thumb-screw-clamp.forge.js +0 -15
|
@@ -17,25 +17,24 @@ These collision-reserved names are case-sensitive:
|
|
|
17
17
|
activateBackend, Analysis, arcSlot, assembly, Assembly, assemblyInstructions, assemblyPreview, Blend
|
|
18
18
|
bom, bomToCsv, boolParam, box, cameraTrajectory, Carrier, chamfer, chamferTrackedEdge
|
|
19
19
|
choiceParam, circle, circle2d, Circle2D, circularLayout, circularPattern, circularPattern2d, coalesceEdges
|
|
20
|
-
combine, COMMON_KERFS, compareWith, composeChain,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
variableSweep, verify, viewConfig, Viewport, window, Wood
|
|
20
|
+
combine, COMMON_KERFS, compareWith, composeChain, connector, console, constrainedSketch, Constraint
|
|
21
|
+
Counterbore, Curve, Curve3D, cutPlane, cylinder, degrees, difference, difference2d
|
|
22
|
+
dim, dimLine, draft, ellipse, explodeView, faceProfile, fillet, filletCorners
|
|
23
|
+
filletTrackedEdge, fingerJoint, flatPanel, flatPart, formatInstructions, Function, gcode, GCodeBuilder
|
|
24
|
+
getActiveBackend, global, globalThis, group, highlight, Import, ImportedAssembly, importMesh
|
|
25
|
+
importStep, importSvgSketch, initKernel, intersection, intersection2d, intersectWithPlane, joint, jointsView
|
|
26
|
+
laserKit, lib, line, Line2D, linearPattern, linearPattern2d, listParam, loadFont
|
|
27
|
+
loft, Loft, lookupKerf, mirrorCopy, mock, ngon, NurbsCurve3D, nurbsSurface
|
|
28
|
+
NurbsSurface, offsetSolid, param, Param, path, point, Point2D, Points
|
|
29
|
+
polygon, polygonVertices, port, Product, ProductHandleBuilder, ProductHandleFeature, ProductPanelBuilder, ProductRibbonBuilder
|
|
30
|
+
ProductSkin, ProductSkinBuilder, ProductSpoutBuilder, ProductStationBuilder, ProductSurfaceBuilder, ProductSurfaceRef, projectToPlane, queueMicrotask
|
|
31
|
+
radians, rect, Rectangle2D, Ribs, robotExport, roundedRect, Route3D, scene
|
|
32
|
+
Sculpt, sdf, SdfShape, selectEdge, selectEdges, self, setActiveBackend, setImmediate
|
|
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
|
|
39
38
|
```
|
|
40
39
|
|
|
41
40
|
`showLabels` is also a runtime global, but it is not part of the top-level collision check. Avoid reusing it unless you intentionally want a local value with that name.
|
|
@@ -44,9 +44,14 @@ Use today's date for the directory. Use the user's current ForgeCAD project when
|
|
|
44
44
|
|
|
45
45
|
## Workflow
|
|
46
46
|
|
|
47
|
-
1. Load the ForgeCAD skill — always invoke the `forgecad` skill first to get API docs and authoring guidance. Read at minimum the Core API reference. If any two parts are intended to touch or mate in the final model, read the positioning guide immediately and default to connectors + `matchTo()`.
|
|
47
|
+
1. Load the ForgeCAD skill — always invoke the `forgecad` skill first to get API docs and authoring guidance. Read at minimum the Core API reference. If the model has moving parts, load the assembly group and `docs/permanent/guides/joint-design.md` before writing geometry. If any two parts are intended to touch or mate in the final model, read the positioning guide immediately and default to connectors + `matchTo()`.
|
|
48
48
|
2. Create the directory — `mkdir -p YYYY/MM/DD/[folder]` as needed.
|
|
49
|
-
3.
|
|
49
|
+
3. Prove moving-part kinematics before detailed geometry — for any mechanism, robot, linkage, hinge, slider, suspension, gripper, wheel train, drawer, door, linkage toy, or articulated product:
|
|
50
|
+
- Author the rig first: links, frames, fixed ground references, parent/child relationships, joints, couplings, limits, defaults, mirrored-side sign mapping, and named controls.
|
|
51
|
+
- Choose the right rig primitive before modeling the skin: use link graphs (`link()`, `edgeBetweenLinks()`, `addAngleBetweenLinks()`) for point skeletons and closed loops; use frame/connector joints (`frame()`, `revoluteJoint()`, `prismaticJoint()`, `connect()`, `match()`) when part orientation matters.
|
|
52
|
+
- Attach only simple markers, bars, or proxy parts at first. Return the `Assembly` directly and run it at rest, mid-travel, and limit joint values until the solver, controls, connector/frame alignment, and `verify.*` checks pass.
|
|
53
|
+
- Only after the rig works should you replace proxies with manufacture-real geometry attached to the solved links, frames, and connectors. Do not bake a posed `SolvedAssembly` as the default return just to make one pose look right.
|
|
54
|
+
4. Write the model — create the `.forge.js` file(s) following ForgeCAD conventions:
|
|
50
55
|
- Treat the default build profile as `manufacture-realistic prototype`; choose and encode the artifact's manufacturing/process cues before adding styling detail
|
|
51
56
|
- Declare `param()` / `boolParam()` for all tunable dimensions
|
|
52
57
|
- If the model is split across files, use `main.forge.js` as the primary entry point, import renderable parts from neighboring `.forge.js` files, and keep only pure helpers/constants in plain `.js` modules
|
|
@@ -57,11 +62,12 @@ Use today's date for the directory. Use the user's current ForgeCAD project when
|
|
|
57
62
|
- Make final mating geometry physically plausible: parts may touch, clear each other, or be boolean-joined, but should not unintentionally pass through each other
|
|
58
63
|
- Model the physical artifact, not an educational diagram: no explanatory arrows, floating labels, section labels, legends, or text plaques unless the user explicitly requested a presentation/teaching view
|
|
59
64
|
- Do not make the default returned model a cutaway, sectioned shell, permanently exploded assembly, or hidden-parts teaching view. ForgeCAD gives the user viewer and inspection tools for slicing, exploding, hiding, and looking inside after the real CAD exists.
|
|
60
|
-
- Return the final
|
|
65
|
+
- Return the final artifact (single shape, array, named objects array, or `Assembly` for moving mechanisms)
|
|
66
|
+
- For moving assemblies, return the `Assembly` itself whenever possible so Motion controls re-run the real kinematic solve; avoid legacy viewport-only animation APIs for new work unless the user explicitly asks for them
|
|
61
67
|
- Treat `fillet(shape, r)` and `chamfer(shape, r)` as experimental edge treatments: Manifold can produce incorrect results and OCCT can be very slow. Prefer simpler primitive profiles, lower segment counts, targeted edge selectors, and inspection before relying on the result.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
68
|
+
5. Validate — run `forgecad run <file>` to check for errors. For multi-file projects, always validate `main.forge.js`. For moving assemblies, also run representative joint states with `--joint`, including rest/default, mid-travel, both limits, and any coupled or mirrored poses.
|
|
69
|
+
6. Verify geometry — render a multi-angle visual evidence set before final delivery: whole-model context plus agent-chosen orthographic, oblique, underside, or hidden-object views that expose the relevant components and interfaces. Choose camera directions from the model's shape and likely failure modes, not from a fixed recipe. Use those views to look for internals that are accidentally visible, parts that visibly do not fit, floating details, blocked access, missing seats, and unexpected interference. For moving assemblies, render at several joint values with `--joint` so clearance, range, stops, and connected followers are proven in motion, not only at rest. Run `forgecad inspect physical components` when the model has multiple returned objects or visible attachments, run `forgecad debug assembly --fail-on warning` when the script uses `assembly()`, run `forgecad inspect mechanical-integrity <project-or-file> --collisions` before sharing generated mechanical work, and run the targeted `forgecad inspect <family> <mode>` commands that match the task (see Final Acceptance Gate and Render-Verify Loop below). For multi-file projects, render and inspect `main.forge.js`. Collision findings are model work, not FYI: remove unexpected overlaps before delivery.
|
|
70
|
+
7. Iterate from visual and inspection feedback — treat every render and inspection bundle as model evidence, not a checkbox. Read the normal PNGs, manifest, and evidence PNGs; convert each unexpected collision, thin region, missing section detail, wrong component count, floating body, distance gap, confusing object-color result, accidentally exposed internal structure, bad fit, bad joint sweep, unconverged pose, follower drift, or visually unsupported interface into a concrete model edit; then rerun the same targeted evidence pass until the result matches the intended physical component graph.
|
|
65
71
|
|
|
66
72
|
## Manufacturing Process Is Not Assumed
|
|
67
73
|
|
|
@@ -118,6 +124,28 @@ Do not reveal hidden structure by permanently cutting away the production geomet
|
|
|
118
124
|
|
|
119
125
|
When internals are hidden by the final exterior, verify them with exploration tools instead of changing the artifact: render underside or alternate camera views, use `forgecad inspect sections at|stack|sample`, use viewer-only cut planes or explode controls, temporarily make a shell transparent, or add named ghost objects for fit checks. Those views are diagnostic/presentation modes; they must not replace the real model unless the user explicitly asked for a cutaway teaching model.
|
|
120
126
|
|
|
127
|
+
## Kinematics-First for Moving Parts
|
|
128
|
+
|
|
129
|
+
For moving models, the mechanism rig is the source of truth. Do not start with finished housings, arms, shells, covers, or decorative surfaces and then try to retrofit motion. Build the motion structure first, prove it, and attach geometry to it.
|
|
130
|
+
|
|
131
|
+
- Decide the rig shape before geometry: point links for closed-loop skeletons and distance/angle constraints; frames and connector joints for serial rigid parts whose orientation matters.
|
|
132
|
+
- Name every moving degree of freedom and encode its limits/defaults at the rig level. For mirrored revolute axes, make the sign mapping explicit instead of assuming equal values create mirrored poses.
|
|
133
|
+
- Add simple proxy geometry only to expose the rig: pivot markers, bars between links, slider blocks, wheel discs, or frame axes. Use those proxies to verify the mechanism before adding real material.
|
|
134
|
+
- Attach final geometry to solved links, frames, and connectors. A visible arm, cover, wheel, drawer, or follower should move because it is mated to the rig, not because a final `rotate()` or `translate()` happens to make one pose look assembled.
|
|
135
|
+
- Keep the default return as the unsolved `Assembly` when possible. This lets Motion controls and CLI `--joint` overrides re-run the real solve.
|
|
136
|
+
- Put representative pose checks in the script with `verify.*`: convergence, connector origins coinciding, link lengths holding, end effectors reaching their expected points, followers remaining attached, and required running clearances staying positive.
|
|
137
|
+
|
|
138
|
+
At minimum, run the mechanism at rest, mid-travel, both limits, and any mirrored/coupled poses:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
node dist-cli/forgecad.js run model.forge.js --joint "theta=0"
|
|
142
|
+
node dist-cli/forgecad.js run model.forge.js --joint "theta=45"
|
|
143
|
+
node dist-cli/forgecad.js run model.forge.js --joint "theta=90"
|
|
144
|
+
node dist-cli/forgecad.js render 3d model.forge.js /tmp/model-theta-45.png --joint "theta=45" --camera iso --size 700
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Use the real joint/control names from the assembly. For multiple controls, repeat `--joint`: `--joint "hip=20" --joint "knee=-35"`. If any pose fails to solve, clamps unexpectedly, breaks a connector check, or creates a new collision, the rig is not ready for final geometry.
|
|
148
|
+
|
|
121
149
|
## Mechanical Assembly Contract
|
|
122
150
|
|
|
123
151
|
For mechanical models, a ForgeCAD script is not done when it merely looks assembled. Every visible piece must have a believable physical reason to be where it is: fused material, contact faces, a screw stack, a pin in a bore, a tab in a slot, a gasket on a land, a bearing in a seat, a cable in a channel, or a named intentional ghost.
|
|
@@ -132,37 +160,7 @@ For mechanical models, a ForgeCAD script is not done when it merely looks assemb
|
|
|
132
160
|
- Purchased loose parts may remain separate bodies, but they should be named as purchased hardware or consumables and should sit in believable sockets, bores, races, guides, or fastener stacks.
|
|
133
161
|
- Encode interface intent with `verify.*`, not only comments. Use `verify.clearanceBetween("cover is seated on gasket", cover, gasket, -0.01, 0.05)` for contact/seated fits and clearance bands, `verify.minClearance(...)` or `verify.notColliding(...)` for keep-out/running gaps, and `verify.connectorDistance(...)` for connector-authored mates. Part counts and generic dimensions are useful supporting checks, but they do not prove an interface by themselves.
|
|
134
162
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
For electronics boxes, backplates, service-stack housings, and camera/monitor enclosures, prefer `lib.datumEnclosureAssembly(...)` before independently placing panels, ribs, bosses, ports, covers, and screws. It creates the tray, ledges, standoffs, ribs, service port, gasket, cover, and screws from one shared datum system.
|
|
138
|
-
|
|
139
|
-
For PCB-mounted terminal blocks, thermostat backplates, control boards, and wire-entry electronics panels, prefer `lib.pcbTerminalBlockAssembly(...)` before placing a loose green block near a board or cover. It creates the backplate, fused standoffs, PCB mounting screws, PCB pin holes, terminal pins, and seated purchased terminal block from one shared datum system.
|
|
140
|
-
|
|
141
|
-
For snap-retained covers, cartridges, small clasps, and housings, prefer `lib.snapLatchCoverAssembly(...)` before drawing decorative snap tabs. It creates latch windows, underside catch lands, fused snap hooks, barbs, and clearance checks so the cover is retained by real geometry.
|
|
142
|
-
|
|
143
|
-
For ordinary pinned handles, cam levers, release levers, and latch arms, prefer `lib.pinnedLeverAssembly(...)` before hand-placing a hub, arm, washers, and pin. It creates a fused lever body, aligned pivot bore, retained pin, thrust washers, support land, and low stop land as one mechanically accountable pivot stack.
|
|
144
|
-
|
|
145
|
-
For trunnions, side knobs, adjustable pivots, and clamp shafts, prefer `lib.retainedShaftAssembly(...)` before hand-placing rods, washers, and knobs. It creates bored support cheeks, a through shaft, thrust washers, knobs, retaining heads, and shared bore dimensions as one mechanically accountable stack.
|
|
146
|
-
|
|
147
|
-
For thumb screws, desk clamps, vise screws, capo pressure screws, and small fixture hold-downs, prefer `lib.thumbScrewClampAssembly(...)` before hand-placing a knob, screw cylinder, pressure pad, and bracket jaw. It creates the C-frame, threaded boss/bore, captive pressure pad, hand knob, and seated workpiece contact from one shared datum system.
|
|
148
|
-
|
|
149
|
-
For drawer slides, quick-release plates, and guided linear carriages, prefer `lib.capturedLinearSlide(...)` before hand-placing rails and a block. It creates a U-channel rail with return lips, end stops, a captured carriage, and explicit travel/clearance dimensions.
|
|
150
|
-
|
|
151
|
-
For pump cartridges, filter cassettes, battery cartridges, skeg cassettes, and removable slide-in modules, prefer `lib.capturedCartridgeGuideAssembly(...)` before placing a loose tray and block. It creates return lips, a rear stop, a captured cartridge flange, pull tab, insertion travel, and explicit clearance dimensions.
|
|
152
|
-
|
|
153
|
-
For molded flexible battery doors, sample covers, blister latches, and polypropylene-style service flaps, prefer `lib.livingHingeCoverAssembly(...)` before drawing two plates with a decorative hinge strip. It creates one fused molded strip with fixed leaf, thin flexible web, moving cover leaf, pull lip, snap barb, catch land, and web-thickness checks.
|
|
154
|
-
|
|
155
|
-
For doors, barn-door leaves, lids, locket leaves, and small hinged access panels, prefer `lib.knuckledHingeAssembly(...)` before hand-placing barrels and a pin. It creates alternating fused knuckles, two leaves, a shared bore, and a retained pin as one mechanically accountable hinge.
|
|
156
|
-
|
|
157
|
-
For crank links, damper rod ends, crossheads, and clevis-yoke pivots, prefer `lib.clevisPinJointAssembly(...)` before hand-placing an eyelet and pin. It creates bored clevis ears, a captured center link eye, a rear bridge, and a retained pin as one mechanically accountable load path.
|
|
158
|
-
|
|
159
|
-
For bearings, rollers, burr cartridges, spindle supports, and purchased radial bearings, prefer `lib.seatedBearingAssembly(...)` before hand-placing a ring and shaft near a block. It creates a bored housing, counterbore pocket, bearing shoulder, seated bearing, shaft, collars, and shared clearance dimensions as one mechanically accountable support.
|
|
160
|
-
|
|
161
|
-
For cables, wires, hoses, pump tubes, and panel pass-throughs, prefer `lib.cableGlandAnchorAssembly(...)` before hand-placing a loose cylinder near a wall. It creates the panel clearance hole, hollow gland body, compression nut, and routed cable/tube as one mechanically accountable pass-through.
|
|
162
|
-
|
|
163
|
-
For routed cables, wires, hoses, pump tubes, and sensor leads that run along a surface, prefer `lib.routedTubeClipAssembly(...)` before drawing a tube that floats between endpoints. It creates a base panel, saddle clip bores, clip screw holes, installed screws, and the retained tube route from one shared datum system.
|
|
164
|
-
|
|
165
|
-
For fluid hoses, pump inlets/outlets, filter ports, and lab tubing, prefer `lib.hoseBarbPortAssembly(...)` before drawing a tube that stops at a block. It creates the bored receiver, raised boss, hollow barbed fitting, installed hose, and clamp band as one accountable hose-port interface.
|
|
163
|
+
Do not introduce canned finished-object helpers for project-specific assemblies. When a repeated physical pattern appears, build the project-specific interface explicitly: use `lib.fastenerSet()` or `lib.boltPattern()` for screw stacks, real bores/counterbores/pockets for purchased parts, connectors plus `matchTo()` for mating parts, and `verify.*` checks for seated contact and running clearances. Reusable library vocabulary should be primitives, cutters, patterns, and mechanical contracts, not finished thermostat backplates, clamp brackets, hinge leaves, or other canned objects.
|
|
166
164
|
|
|
167
165
|
## Final Geometry Should Be Physically Plausible
|
|
168
166
|
|
|
@@ -206,6 +204,8 @@ Before telling the user the model is done, prove both technical validity and vis
|
|
|
206
204
|
|
|
207
205
|
The model should include at least one verification that proves a mechanical interface, not just object count. Prefer checks such as `verify.clearanceBetween("bearing is seated in pocket", bearing, housing, -0.01, 0.1)`, `verify.minClearance("carriage clears rail", carriage, rail, 0.15)`, `verify.notColliding("cover screw clears parent hole", screw, parent)`, or `verify.connectorDistance("leg connector is seated", bench, "Rail.leg_0", "Leg0.head", 0, 0.01)`.
|
|
208
206
|
|
|
207
|
+
For moving assemblies, this gate is incomplete until the rig has been run through representative control states. Use `--joint` overrides and/or in-script `solve(state)` verification to cover rest/default, mid-travel, physical limits, coupled states, and mirrored-side poses. Each tested pose should keep the solver converged, attached geometry following the rig, and clearances/collisions within the intended mechanical contract.
|
|
208
|
+
|
|
209
209
|
2. Run collision evidence and read both the manifest and images:
|
|
210
210
|
|
|
211
211
|
```bash
|
|
@@ -241,7 +241,7 @@ Before telling the user the model is done, prove both technical validity and vis
|
|
|
241
241
|
|
|
242
242
|
5. Treat ProductSkin and surface-member limitations honestly. If `inspect fit interference` reports boolean-test warnings because a sampled `Product.skin` loft has boundary edges, distinguish that from real collision findings. You may still deliver if `collisionCount` is clean, the intended connectivity is correct, and the visual attachment audit passes. Mention the residual warning briefly in the final response.
|
|
243
243
|
|
|
244
|
-
6. Final response must name the evidence: commands run, render views checked, any focus/hide filters used, component count, collision count, and any residual warnings or intentional exceptions. Do not just say "validated."
|
|
244
|
+
6. Final response must name the evidence: commands run, render views checked, joint values tested for moving assemblies, any focus/hide filters used, component count, collision count, and any residual warnings or intentional exceptions. Do not just say "validated."
|
|
245
245
|
|
|
246
246
|
## Render-Verify Loop
|
|
247
247
|
|
|
@@ -438,6 +438,7 @@ Primitive placement convention:
|
|
|
438
438
|
Key composition tools:
|
|
439
439
|
|
|
440
440
|
- Connectors + `matchTo()` for parts that should touch in the final model
|
|
441
|
+
- `assembly()` link graphs, frames, and connector joints for moving mechanisms
|
|
441
442
|
- `group()` for local-coordinate subassemblies
|
|
442
443
|
- `attachTo()` for quick bounding-box placement
|
|
443
444
|
- `.translate()` / `.rotate()` for free offsets or bridging computed locations, not as the default assembly contract
|
|
@@ -10,6 +10,8 @@ forgecad-public: true
|
|
|
10
10
|
|
|
11
11
|
**forgecad.io** is the primary platform for ForgeCAD projects. The CLI is the main way AI agents interact with it — creating projects, managing files, publishing models, and collaborating. `forgecad studio <project-path> [project-path ...]` opens the installed local editor for users; `forgecad dev <project-path> [project-path ...]` is mainly for ForgeCAD source development.
|
|
12
12
|
|
|
13
|
+
Keep one long-running `forgecad studio <project-path> [project-path ...]` process open with every active project folder listed in its arguments; the user opens the single printed localhost port once, and AI agents should only create or edit files under those folders so the browser updates live without starting more servers.
|
|
14
|
+
|
|
13
15
|
## Authentication
|
|
14
16
|
|
|
15
17
|
```sh
|
|
@@ -49,8 +49,8 @@ const sampledPathMarkers = union(
|
|
|
49
49
|
...guide.sample(9).map(([x, y, z]) => sphere(wireRadius * 0.5).translate(x + 120, y, z)),
|
|
50
50
|
);
|
|
51
51
|
|
|
52
|
-
console.info(`Helix height: ${guide.height.toFixed(2)}`);
|
|
53
|
-
console.info(`Helix centerline length: ${guide.length().toFixed(2)}`);
|
|
52
|
+
console.info(`Curve.Helix height: ${guide.height.toFixed(2)}`);
|
|
53
|
+
console.info(`Curve.Helix centerline length: ${guide.length().toFixed(2)}`);
|
|
54
54
|
|
|
55
55
|
return [
|
|
56
56
|
{ name: "Circular wire coil", shape: circularWireCoil },
|
|
@@ -20,8 +20,11 @@ const neckLength = 26.645;
|
|
|
20
20
|
const neckRadius = 55.6;
|
|
21
21
|
|
|
22
22
|
const tubeProfile = difference2d(circle2d(outerRadius, 80), circle2d(innerRadius, 80));
|
|
23
|
+
|
|
23
24
|
const pipe = sweep(tubeProfile, route, { samples: 72 });
|
|
24
25
|
|
|
26
|
+
return pipe;
|
|
27
|
+
|
|
25
28
|
function placeAtPort(shape, port, offset) {
|
|
26
29
|
return shape.pointAlong(port.axis).translate(
|
|
27
30
|
port.origin[0] + port.axis[0] * offset,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Variable Sweep test — tapered tube along a curved spine
|
|
2
2
|
// Demonstrates variableSweep() with different cross-sections at different t values
|
|
3
3
|
|
|
4
|
-
const spine =
|
|
4
|
+
const spine = Curve.Spline([
|
|
5
5
|
[0, 0, 0],
|
|
6
6
|
[20, 0, 10],
|
|
7
7
|
[40, 10, 20],
|
|
@@ -20,4 +20,6 @@ const tapered = variableSweep(spine, [
|
|
|
20
20
|
samples: 64,
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
+
verify.boundingBoxSize('variableSweep along Curve.Spline keeps the tapered tube envelope', tapered, [66, 22, 36], 8);
|
|
24
|
+
|
|
23
25
|
return tapered.color('#8899aa');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "forgecad",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.16",
|
|
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",
|
|
@@ -32,6 +32,9 @@
|
|
|
32
32
|
"check": {
|
|
33
33
|
"description": "Run model-focused readiness checks."
|
|
34
34
|
},
|
|
35
|
+
"context": {
|
|
36
|
+
"description": "Read and render submitted marker context for agent workflows."
|
|
37
|
+
},
|
|
35
38
|
"compare": {
|
|
36
39
|
"description": "Compare ForgeCAD scripts and imported 3D assets."
|
|
37
40
|
},
|