add_assembly_interface
Add a mating interface between two assembly parts to define joint type, clearance, and optional motion or mechanism data for validation and clearance checking.
Instructions
Add a mating interface between two parts in an assembly.
Defines how two parts connect (joint type and clearance),
which is used during validation and clearance checking. For
screw/anchor-based joints, ``fastener`` may provide an
explicit hardware spec so downstream manuals and BOM tools do
not have to guess from clearance alone. For a joint whose
parts move after printing (a hinge, slider, ball or gear),
``motion`` records the axis and the range once, on the
interface, so the joint's clearance is judged through its
whole motion rather than at the pose as modelled. When several
joints move together (a crank turning cams, gears, a lever
riding on a cam), ``mechanism`` says this joint's place in that:
the driver, coupled to another joint, or the hinge of a part
that rides on another. ``compose_assembly_parts`` then plays
the whole mechanism for Kiln's 3D stage. The reply's
``interface`` is this joint's number, the number a later
coupling names it by.
Args:
assembly_json: JSON string of the current assembly state.
part_a_id: ID of the first part in the interface.
part_b_id: ID of the second part in the interface.
joint_type: Type of joint (default ``"clearance_fit"``):
``"snap_fit"``, ``"press_fit"``, ``"interference_fit"``,
``"clearance_fit"``, ``"loose"``, ``"tongue_groove"``,
``"threaded"``, ``"glued"``, ``"magnetic"`` or
``"heat_set_insert"``. A screw into a brass insert is
two interfaces on the same two parts: ``"threaded"``
with the screw as ``fastener``, and
``"heat_set_insert"`` with ``part_b_id`` the part the
insert is melted into.
clearance_mm: Clearance gap in mm (default 0.2); for a round
joint, the difference between the two diameters. For
``"interference_fit"`` pass a NEGATIVE value (the
part is intentionally larger than its socket);
interference geometry is the entire point.
magnet_polarity_aligned: Only meaningful when
``joint_type == "magnetic"``. ``True`` declares
the designer has confirmed which poles face each
other in each magnet pocket; ``None`` means
unknown. Downstream tooling refuses to ship a
hand-wavy "make sure they pull together"
instruction when polarity is unknown.
fastener: Optional FastenerSpec as a dict or JSON object
string. Supported keys include ``size``, ``family``,
``length_mm``, ``length_range_mm``, ``head_type``,
``drive_type``, ``surface_type``,
``quantity_per_interface``, ``notes``, ``driver``
(the driver the screw takes, as the kit's supplier
states it, e.g. ``"2 mm hex key"``) and ``product``
(the exact bought part: maker and part number). On a
``"heat_set_insert"`` or ``"magnetic"`` interface the
fastener names that hardware (``family``
``"heat_set_insert"`` or ``"magnet"``) and may give
``hole_diameter_mm`` and ``hole_depth_mm`` (the pocket
as drawn) and, for an insert, ``install_temp_c`` (the
iron temperature, one value or ``[low, high]``); an
assembly guide prints what is given.
motion: Optional joint motion as a dict or JSON object
string, for a joint that moves after printing (part B
relative to part A, in the assembly's frame): ``kind``
(``"hinge"``, ``"slider"``, ``"ball"`` or ``"gear"``),
``axis_point_mm`` (a point on the axis; a ball joint's
centre), ``axis_direction`` (the axis as x, y, z),
``range_min`` and ``range_max`` (degrees for a hinge,
ball or gear with 0 the pose as modelled, millimetres
for a slider), and optionally ``mating`` (the gap class
the clearance is judged in; follows the kind when
omitted), and ``continuous`` (``true`` for a hinge or
gear that turns without end, such as a crankshaft; its
range is 0 to 360). Omit it for a joint that does not move.
mechanism: Optional place of this joint in a mechanism, as a
dict or JSON object string; the joint must declare a
``motion``. One of:
``{"driver": true}`` -- this is the joint that is turned
or pushed; every other moving joint follows it. Declare
it before the others. It runs through the joint's own
range, or ``"range": [low, high]`` to play a narrower one;
a ``continuous`` joint turns round and round.
``{"coupled_to": <joint number>, "kind": "gear", "ratio":
<number>}`` -- this joint turns ``ratio`` times the named
joint (negative when it turns the other way, as an
external gear pair does); ``"kind": "rack"`` with
``pitch_radius_mm`` or ``"kind": "screw"`` with
``lead_mm`` joins a joint that turns and one that slides.
``{"rests_on": "<part id>"}`` -- part B is held only by
this hinge and rides on the named part under its own
weight (a cam's lever, a pawl); optionally
``bearing_radius_mm``, the radius of the hinge's pin.
Omit it for a joint that is not part of a mechanism.
prints_separately: ``True`` when the two parts are printed
apart and put together by hand. Their gap is then
checked as a fit to assemble (and, with ``motion``, to
keep moving) and never as two surfaces that could fuse
on the plate. Leave ``False`` for a print-in-place joint.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"assembly_json": "<assembly_json>",
"part_a_id": "<part_a_id>",
"part_b_id": "<part_b_id>"
},
"name": "add_assembly_interface"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| motion | No | Optional joint motion as a dict or JSON object string, for a joint that moves after printing (part B relative to part A, in the assembly's frame): ``kind`` (``"hinge"``, ``"slider"``, ``"ball"`` or ``"gear"``), ``axis_point_mm`` (a point on the axis; a ball joint's centre), ``axis_direction`` (the axis as x, y, z), ``range_min`` and ``range_max`` (degrees for a hinge, ball or gear with 0 the pose as modelled, millimetres for a slider), and optionally ``mating`` (the gap class the clearance is judged in; follows the kind when omitted), and ``continuous`` (``true`` for a hinge or gear that turns without end, such as a crankshaft; its range is 0 to 360). Omit it for a joint that does not move. | |
| fastener | No | Optional FastenerSpec as a dict or JSON object string. Supported keys include ``size``, ``family``, ``length_mm``, ``length_range_mm``, ``head_type``, ``drive_type``, ``surface_type``, ``quantity_per_interface``, ``notes``, ``driver`` (the driver the screw takes, as the kit's supplier states it, e.g. ``"2 mm hex key"``) and ``product`` (the exact bought part: maker and part number). On a ``"heat_set_insert"`` or ``"magnetic"`` interface the fastener names that hardware (``family`` ``"heat_set_insert"`` or ``"magnet"``) and may give ``hole_diameter_mm`` and ``hole_depth_mm`` (the pocket as drawn) and, for an insert, ``install_temp_c`` (the iron temperature, one value or ``[low, high]``); an assembly guide prints what is given. | |
| mechanism | No | Optional place of this joint in a mechanism, as a dict or JSON object string; the joint must declare a ``motion``. One of: ``{"driver": true}`` -- this is the joint that is turned or pushed; every other moving joint follows it. Declare it before the others. It runs through the joint's own range, or ``"range": [low, high]`` to play a narrower one; a ``continuous`` joint turns round and round. ``{"coupled_to": <joint number>, "kind": "gear", "ratio": <number>}`` -- this joint turns ``ratio`` times the named joint (negative when it turns the other way, as an external gear pair does); ``"kind": "rack"`` with ``pitch_radius_mm`` or ``"kind": "screw"`` with ``lead_mm`` joins a joint that turns and one that slides. ``{"rests_on": "<part id>"}`` -- part B is held only by this hinge and rides on the named part under its own weight (a cam's lever, a pawl); optionally ``bearing_radius_mm``, the radius of the hinge's pin. Omit it for a joint that is not part of a mechanism. | |
| part_a_id | Yes | ID of the first part in the interface. | |
| part_b_id | Yes | ID of the second part in the interface. | |
| joint_type | No | Type of joint (default ``"clearance_fit"``): ``"snap_fit"``, ``"press_fit"``, ``"interference_fit"``, ``"clearance_fit"``, ``"loose"``, ``"tongue_groove"``, ``"threaded"``, ``"glued"``, ``"magnetic"`` or ``"heat_set_insert"``. A screw into a brass insert is two interfaces on the same two parts: ``"threaded"`` with the screw as ``fastener``, and ``"heat_set_insert"`` with ``part_b_id`` the part the insert is melted into. Default: "clearance_fit". | |
| clearance_mm | No | Clearance gap in mm (default 0.2); for a round joint, the difference between the two diameters. For ``"interference_fit"`` pass a NEGATIVE value (the part is intentionally larger than its socket); interference geometry is the entire point. Default: 0.2. | |
| assembly_json | Yes | JSON string of the current assembly state. | |
| prints_separately | No | ``True`` when the two parts are printed apart and put together by hand. Their gap is then checked as a fit to assemble (and, with ``motion``, to keep moving) and never as two surfaces that could fuse on the plate. Leave ``False`` for a print-in-place joint. Default: false. | |
| magnet_polarity_aligned | No | Only meaningful when ``joint_type == "magnetic"``. ``True`` declares the designer has confirmed which poles face each other in each magnet pocket; ``None`` means unknown. Downstream tooling refuses to ship a hand-wavy "make sure they pull together" instruction when polarity is unknown. |