Add Spring
add_springAdd a helical compression spring to a FreeCAD model by specifying wire diameter, outer diameter, free length, and coils; returns geometry and steel spring rate for mechanism sizing.
Instructions
Add a helical compression spring: a round wire swept along a cylindrical helix.
All lengths in mm; angles n/a. wire_diameter: wire (stock) diameter d, mm. outer_diameter: spring outer diameter OD, mm (must be > wire_diameter). free_length: uncompressed overall length along the axis, mm. coils: number of turns (active coils), may be fractional. kind: 'compression' (only supported mode in v1; end coils are not squared yet). placement: optional [x, y, z] mm translation of the spring's base.
Geometry: mean coil diameter D = outer_diameter - wire_diameter; coil pitch = free_length / coils. Spring rate is computed for STEEL (shear modulus G = 79.3 GPa) as k = Gd^4 / (8D^3*coils), reported in N/mm.
Returns {handle, name, volume (mm^3), mean_diameter (mm), free_length (mm), coils, kind, solid_height (mm, = coils*wire_diameter, the fully-compressed block height), spring_rate_n_per_mm (N/mm)}. Use free_length, solid_height and spring_rate_n_per_mm to spec the spring into a mechanism (available travel = free_length - solid_height; force = spring_rate_n_per_mm * deflection).
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": {
"wire_diameter": "<wire_diameter>",
"outer_diameter": "<outer_diameter>",
"free_length": "<free_length>",
"coils": "<coils>"
},
"name": "add_spring"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | compression | |
| name | No | Spring | |
| coils | Yes | ||
| placement | No | ||
| workspace | No | Run this call in this named workspace | |
| free_length | Yes | ||
| wire_diameter | Yes | ||
| outer_diameter | Yes |