Sweep Tolerance Range
sweep_toleranceUse this when you need to know where and why a design breaks across a tolerance/dimension range, not just whether it builds at one nominal value. Declares one or more param() names with a { values: [...] } list or a { min, max, steps } range (number params are bisected; choice/string params are evaluated as discrete points), re-evaluates the script once per cartesian-product combination (capped at 64 combos — exceeding it truncates to the first 64 and emits kinematic.sweep-tolerance.combo-cap-exceeded), and measures every requirement in the S2 ledger (script require(), dfmSpec, gated FEA, mechanical intent) plus the standard gates on each combo: interference, mounting-hole diameter agreement, and joint-axis binding (all three default on); reachability only when gates.reachable names a tip_link + target. After the coarse grid it bisects each numeric pass/fail transition down to boundaryTolerance and reports the boundary value, the failing side, and the binding requirement/gate names (e.g. "wall fails below 1.840 mm; binding: wall"). Returns per-combo verdicts, firstFailure per gate, firstRequirementFailure per requirement, boundaries[], and a coverage statement that says "checked at N points plus boundaries", never "proven".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | Inline kernelCAD script source. | |
| file | No | Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project. | |
| gates | No | Which standard gates to run per combo. | |
| params | Yes | param() name -> { values: [number|string, ...] } or { min, max, steps }. | |
| assembly | No | Assembly name; defaults to the first captured assembly. | |
| boundaryBudget | No | Maximum extra evaluations spent bisecting boundaries. Default 64; 0 skips bisection. | |
| boundaryTolerance | No | Absolute parameter tolerance for boundary bisection. Default 0.001. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||