Add Mate
add_mateUse this when you need to author a mate-graph relationship into the source, selected by relation (default 'mate'):
'mate' — a typed mate between two connectors ({ name, a, b, type, pose?, limits_deg?, limits_mm? }).
'coupling' — couple a driven mate to a source mate by ratio ({ driven, source, ratio, offset? }).
'transmission' — a physical drive path across mates ({ name, kind, source_mate, driven_mates, path, ... }). All durably edit source and need { code, assembly_binding }. The inserted script keeps
limitsDeg,limitsMm,sourceMate, anddrivenMates; passlimits_deg,limits_mm,source_mate, anddriven_mates. Each relation fails closed on its own missing required params.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | No | relation:'mate' — connector ref "<partName>.<connectorName>". | |
| b | No | relation:'mate' — connector ref "<partName>.<connectorName>". | |
| code | Yes | The .kcad.ts source code. | |
| kind | No | relation:'transmission' — transmission kind. | |
| name | No | relation:'mate'|'transmission' — name unique within the assembly. | |
| path | No | relation:'transmission' — drive path. | |
| pose | No | relation:'mate' — optional mate pose. | |
| type | No | relation:'mate' — mate type. | |
| input | No | relation:'transmission' — optional input. | |
| notes | No | relation:'transmission' — optional notes. | |
| ratio | No | relation:'coupling' — driven pose = source pose * ratio + offset. | |
| driven | No | relation:'coupling' — driven mate name. | |
| offset | No | relation:'coupling' — optional pose offset. | |
| output | No | relation:'transmission' — optional output. | |
| source | No | relation:'coupling' — source mate name. | |
| actuator | No | relation:'transmission' — optional actuator. | |
| adhesive | No | Optional planar adhesive interface for a fastened mate. Select one canonical face on each part. | |
| relation | No | Which relationship to author (default 'mate'). | |
| limits_mm | No | relation:'mate' — optional [minMm, maxMm]. | |
| limits_deg | No | relation:'mate' — optional [minDeg, maxDeg]. | |
| source_mate | No | relation:'transmission' — source mate name. | |
| driven_mates | No | relation:'transmission' — driven mate names. | |
| assembly_binding | Yes | JS identifier bound to assembly(...). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||