Verify Design
verifyUse this when you need to check a design against a rule set. One verifier, selected by check:
'assembly' — static assembly review ({ file | code }, or the session evaluate_script left): mate validator, default-pose interference, joint topology, mechanical plausibility. ok:false with
blocking[]exactly when review_cad's blocking rules fire on these findings; review_cad also sweeps joint ranges and runs physics.'urdf' — structural validity of a .urdf file ({ urdf_path }).
'dfm' — print-readiness gates declared by dfmSpec() ({ file | code }).
'dfm-preflight' — sheet-metal flat pattern vs a job-shop's ordering rules ({ vendor, material, thicknessIn|thicknessMm, ... }). Returns the vendor's catalog source pages as
sources; whendisclosureis present, show it with those links.'assembly-path' — continuous straight-line removal of each assembly part along ±X/±Y/±Z and optional world-space directions. Returns valid directions, blocking parts and one of three states (removable / blocked / unknown); sequence peels the directional blocking graph and reverses it into a build sequence with a model stamp. Fastened-mate and fixed-connect clusters become subassemblies: each is planned recursively inside and installed as one unit at the top level (
Step.subassembly). Remaining valid orders use deterministic heuristics (subassemblies first, outside-in, fewest reorientations, fewest tool changes); stuck sets get a budgeted blocking-reduction partition and a sampling fallback whose paths are labelled found-by-search, never proven. A fastener with a fastened-matefastenerdeclaration (axis, pitch, optional tool envelope) is tested along its helical path and reportedmotion: helical; a press/snapfitdeclaration becomes arequires-forcestep, never simulated. A modelled driver/socket/hex-key envelope swept along the approach axis addstoolBlocked{ fastener, blockers } and a failing S2 ledger entry; unmodelled tools add nothing. Threaded fasteners without metadata stay unknown: non-straight-path.stability: trueadds an approximate P3 support check at each build step: each part's mesh centre of mass must project inside the support polygon of its contacts with already-stable parts (declared or inferred base/fixture undergravity, default [0,0,-1]); unsupported parts becomeneedsHold{ part, reason, supports } and their steps carrystability: 'needs-hold', while stable steps may carryheldBy. This is a projection, not gravity simulation, friction, tipping or fixture analysis. disassemblyOrder runs a deterministic greedy removal pass. Watertight mesh approximation, conservative contact, no rotation/mate/hardware certification.'swept-collision' — sweep declared joint range(s) and report colliding poses.
'reachable' — inverse-kinematics reachability for an end-effector ({ tip_link, target_position, ... }).
'geometry-quality' — one solid body's BREP tiny faces and short edges (ids, locations, mm²/mm), plus sampled mirror symmetry about centroid XY/YZ/XZ and principal inertia planes ({ file | code, feature_id?, tiny_face_area_mm2?, tiny_face_relative?, short_edge_length_mm?, symmetry_tolerance_mm?, mesh_deflection_mm?, asserted_plane?: { origin, normal } }). Relative area is a fraction of total surface area; thresholds are ORed. Candidate planes are discovery; only an asserted plane gates symmetry. Approximate sampled tessellation, not exact BREP proof.
'fastener-installation' — measured explicit catalog-screw installation stations on lowered assembly BREP ({ file | code, fasteners:[{ part, against, engagementPart?, minEngagementMm?, maxProtrusionMm? }], toleranceMm?, angleToleranceDeg? }). Reports annular bearing gap, bore axis/diameter/overlap and receiver geometric engagement/protrusion. Unknown or zero coverage cannot pass. Simplified threads do not certify torque, preload or strength.
'mounting-holes' — fastened mates: hole pairs one screw can use (equal, or clearance over a tap drill / hole({ thread }) of the same metric size; hole-free faces are a rigid bond) and fastener holes meeting at the contact face are coaxial. Sides it cannot resolve are info, never mismatches.
'load-capacity' — will it hold? Closed-form Euler-Bernoulli beam check ({ loads, materials, ... }), or mode:'fea' to solve the script's feaStudy (quadratic-tet FEA, CalculiX) — both return { ok, safetyFactor, elements[{ partName, stressPa, yieldPa, safetyFactor }], failures[], diagnostics }; fea adds the threshold, the stress regions as @kc[...] faces with their location, and fea { peakStressPa, maxDisplacementMm, meshTrusted, peakAtSupportPa, refinement }; it refines the mesh automatically until the stress is trusted (refine: false for one solve).
'static-hold' — gravitational holding torque/force at a sampled pose grid vs each actuated joint's declared actuator capacity ({ joint?, pose?, gravity?, min_torque_margin_pct?, range_samples? }).
'motion-load' — loads on each driven joint (mechanicalJoint on a revolute mate) while the model moves: gravity, inertia from the animationView tracks (finite differences), optional external forces. Mass and inertia come from the solids and density/material, or a part's massKg. Returns per joint peak torque vs the mechanicalJoint torqueNm (margin; < 1x error, < 2x warning), axial / radial force and bending moment on the actuator shaft (checked only against radialLimitN / axialLimitN; without them 'no rating, not checked'), the radial load on each of up to two coaxial supports (each at its station on the shaft: the actuator at the joint origin, else the support's connector on the axis, else the middle of its material nearest the shaft; an ambiguous station is a mechanism.load.not-resolved warning, not a number), the worst pose, a torque-vs-time series, and
partLoads(the worst wrench per part and side in that part's own frame, whichfeaStudy({ loadsFrom })consumes) ({ file | code, motion_mode?: 'tracks'|'range'|'poses', motion_poses?: [{ joint: value }], sample_ms?, range_samples?, quasi_static?, gravity?, motion_loads?: [{ part, point, force, fromMs?, toMs? }], supports?: { joint: [parts] }, series_points? }). Pass supports to compare with and without a bushing. Rigid bodies, tree mate graphs, no friction.'physics' — full mechanism truth with physics engine: kinematic disconnect / interference / DOF checks plus static equilibrium and drop-on-release under gravity ({ file | code, assembly?, physics? }). Returns { ok, mechanism: 'real'|'broken'|'unverified', failures[], coverage }.
'edge-radius' — general edge-break specification on final BREP ({ file | code, min_radius_mm?, max_radius_mm?, require_edge_break?: 'external'|'internal'|'all', feature_id?, assembly?, parts?, edges?, faces? }). Reports sharp convex/concave edges, analytic cylindrical/toroidal fillet radii and spherical junctions, and heuristic planar chamfer strips. Radius bounds apply only to fillets; selectors/points are part-local. Unknown/empty coverage cannot pass. All params except
checkare check-specific and forwarded verbatim; each check fails closed on its own missing required params.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dxf | No | check:'dfm-preflight' — path to a DXF file. | |
| code | No | Inline kernelCAD script source (same checks as `file`). | |
| file | No | Path to a .kcad.ts script (assembly/dfm/dfm-preflight/swept-collision/reachable/mounting-holes/load-capacity/static-hold/geometry-quality/edge-radius/requirements). Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project. | |
| mode | No | check:'load-capacity' — 'beam' (default), 'stub', or 'fea' (solve the script's feaStudy: CalculiX + gmsh when installed, else the in-process voxel estimate). | |
| pose | No | check:'static-hold' — explicit pose (joint name -> deg/mm) or array of poses; omit to sample a grid across the evaluated joint's range. | |
| seed | No | check:'reachable' — numeric IK seed pose (joint name -> deg/mm). | |
| check | Yes | Which verification to run. Omit only when passing call-time `requirements`; then the requirements ledger is the verification. | |
| edges | No | check:'edge-radius' — EdgeQuery or @kc[...] edge ref(s); intersected with faces. Query near sorts, it does not filter. | |
| faces | No | check:'edge-radius' — FaceQuery or @kc[...] face ref(s); includes incident edges and fillets on selected faces. | |
| joint | No | check:'swept-collision' — joint to sweep; omit to sweep every declared joint. check:'static-hold' — joint to evaluate; omit to evaluate every joint with a declared actuator. | |
| loads | No | check:'load-capacity' — partName -> { force?: [Fx,Fy,Fz] N, torque?: [Tx,Ty,Tz] N*m }. | |
| parts | No | check:'edge-radius' — explicit assembly part names (default all). | |
| range | No | check:'swept-collision' — [lower, upper, step] in joint-native units. | |
| study | No | check:'load-capacity' mode:'fea' — feaStudy name (default: the last declared one). | |
| refine | No | check:'load-capacity' mode:'fea' — one automatic finer pass (0.75x element size) when the stress is untrusted, inside the element budget (default true); false solves once at the study's meshSize. | |
| vendor | No | check:'dfm-preflight' — vendor SKU (required for that check). | |
| gravity | No | check:'static-hold' — gravity vector, m/s^2, world frame (default [0, 0, -9.81]). check:'assembly-path' with stability:true — gravity direction, world frame, magnitude ignored (default [0, 0, -1]). | |
| service | No | check:'dfm-preflight' — service. | |
| assembly | No | Assembly name; defaults to the first captured assembly. | |
| fixtures | No | check:'assembly-path' with stability:true — declared base/fixture part names, stable from step 1. Default: the lowest part(s) along gravity. | |
| heatmaps | No | check:'load-capacity' mode:'fea' — also render stress heatmap PNGs (default false). | |
| material | No | check:'dfm-preflight' — material SKU (required for that check). | |
| sequence | No | check:'assembly-path' — plan a build sequence { steps, model, unknown, search?, requiresForce?, toolBlocked?, needsHold? }. Fastened/fixed clusters become subassemblies planned inside and installed as one unit; steps carry the insertion direction (reverse removal), and may be motion: helical (declared fastener), requires-force (press/snap, not proven) or search. Stuck sets use a budgeted partition; non-straight paths found by sampling are labelled found-by-search and are not proven. Blocked and unknown parts are not reported as impossible. | |
| supports | No | check:'motion-load' — mechanicalJoint name -> support part names to use instead of the declared supports (compare with / without a bushing). | |
| tip_link | No | check:'reachable' — end-effector part name (required for that check). | |
| fasteners | No | check:'fastener-installation' — explicit named stations; empty means no coverage. | |
| featureId | No | check:'dfm-preflight' — FeatureId to scope to. | |
| materials | No | check:'load-capacity' — partName -> material declaration. | |
| mesh_size | No | check:'load-capacity' mode:'fea' — element size override, mm. | |
| sample_ms | No | check:'motion-load' — timeline sample step, ms (default 20). Inertia peaks depend on it at keyframe velocity steps. | |
| stability | No | check:'assembly-path' — run the approximate P3 static-stability pass on the sequence. Each part's closed-mesh volume centroid (uniform density) must project inside the convex hull of its contacts with already-stable parts. Unsupported parts become needsHold { part, reason, supports } and ok:false; a stable step may carry heldBy. Not a physics simulation. | |
| urdf_path | No | check:'urdf' — path to the .urdf file. | |
| directions | No | check:'assembly-path' — additional nonzero world-space removal vectors; normalized and deduplicated. | |
| feature_id | No | check:'geometry-quality' — body feature to measure; defaults to script return. check:'edge-radius' — lowered feature; default the returned model. | |
| motion_mode | No | check:'motion-load' — 'tracks' (default): along the animationView timeline with inertia; 'range': quasi-static grid over each driven joint's limits; 'poses': exactly motion_poses (a user-named pose is one entry). | |
| thicknessIn | No | check:'dfm-preflight' — material thickness in inches. | |
| thicknessMm | No | check:'dfm-preflight' — material thickness in millimeters. | |
| toleranceMm | No | check:'fastener-installation' — linear tolerance, default .05 mm. | |
| motion_loads | No | check:'motion-load' — external forces: [{ part, point: [x,y,z] mm in the part's modeled frame, force: [Fx,Fy,Fz] N world, fromMs?, toMs? }]. | |
| motion_poses | No | check:'motion-load' motion_mode:'poses' — explicit mate poses, each an object of joint name -> value in degrees. | |
| quasi_static | No | check:'motion-load' — drop velocity/acceleration terms (gravity and external loads only). | |
| requirements | No | Call-time external requirements ([{ name, predicate }]) measured in the same ledger as script require(), dfmSpec and feaStudy, tagged source: 'external' and never persisted. The predicate is the serializable form of require(): { metric: clearance | distance | mass | volume | bbox | centerOfMass | count | innerLoops | angle | concentric | coplanar, a?, b?, op: gte | lte | eq | between | within, limit, tolerance?, density? }. Operands are { kind: body | faces | edges | part, ref: <feature id/name or part name>, query? }. With `check` omitted the ledger is the whole verification; check 'requirements' is the explicit form. | |
| max_radius_mm | No | check:'edge-radius' — maximum fillet radius in mm; must be >= min_radius_mm. | |
| min_radius_mm | No | check:'edge-radius' — minimum fillet radius in mm (does not imply sharp-edge prohibition). | |
| prefer_solver | No | check:'reachable' — force the IK path ('auto' default). | |
| range_samples | No | check:'static-hold' — grid density per evaluated joint when `pose` is omitted (default 9). check:'motion-load' motion_mode:'range' — grid points per joint (default 5). | |
| series_points | No | check:'motion-load' — max torque-vs-time points per joint in the result (default 120; 0 omits the series). | |
| asserted_plane | No | check:'geometry-quality' — optional required mirror plane in model coordinates; normal is normalized and must be nonzero. | |
| max_iterations | No | check:'reachable' — numeric-path iteration cap. | |
| refreshCatalog | No | check:'dfm-preflight' — force vendor catalog refresh. | |
| target_position | No | check:'reachable' — target [x, y, z] mm (world frame). | |
| disassemblyOrder | No | check:'assembly-path' — iteratively remove freed parts and return removalOrder or stuckParts. | |
| angleToleranceDeg | No | check:'fastener-installation' — axis tilt tolerance, default 1 degree. | |
| threadedFasteners | No | check:'assembly-path' — part names that need a helical removal. Catalog screw/bolt/nut families are detected automatically; without a fastened-mate fastener declaration (axis/pitch) they remain unknown: non-straight-path. Declare the motion on arm.mate(..., 'fastened', { fastener: { part, axis, pitchMm, tool? }, fit?: { kind, part? } }). | |
| contactToleranceMm | No | check:'assembly-path' with stability:true — surface distance at or below which parts count as touching (default 0.05 mm). | |
| mesh_deflection_mm | No | check:'geometry-quality' — absolute mesh deflection, defaults to tolerance/4; must be <= tolerance/2. | |
| require_edge_break | No | check:'edge-radius' — prohibit sharp convex/external, concave/internal, or all edges. | |
| target_orientation | No | check:'reachable' — target XYZ Euler angles in radians. | |
| tiny_face_area_mm2 | No | check:'geometry-quality' — flag faces strictly below this absolute area; zero disables. | |
| tiny_face_relative | No | check:'geometry-quality' — fraction of total BREP surface area, ORed with absolute threshold. | |
| short_edge_length_mm | No | check:'geometry-quality' — flag edges strictly below this length; zero disables. | |
| min_torque_margin_pct | No | check:'static-hold' — safety-margin floor as a percent of actuator capacity (default 20). | |
| position_tolerance_mm | No | check:'reachable' — position tolerance in mm. | |
| symmetry_tolerance_mm | No | check:'geometry-quality' — maximum sampled mirror-to-mesh distance, mm. | |
| collision_tolerance_mm3 | No | check:'swept-collision' — BREP intersection volume tolerance (mm^3). | |
| safety_factor_threshold | No | check:'load-capacity' — pass/fail safety-factor floor (default 1.5; mode 'fea': the study's minSafetyFactor when declared). | |
| orientation_tolerance_rad | No | check:'reachable' — orientation tolerance in radians. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||