@rulecad/flexures

Parts that move by bending: leaf springs, guides, serpentine springs and notch hinges, each with its stiffness, its strain, and how it prints.

npm 0.5.18sourceMITNode >=20runs in this page
npm install @rulecad/flexures

Try it

Reference

Compliant mechanisms for printed parts: flexures that move by bending instead of turning on a pin. Each one is a JSCAD shape and a model: its stiffness, the strain its material sees at a travel, and the travel a strain allows. Needs JSCAD, @rulecad/fea for its finite-element checks, and @rulecad/fixings, whose snap pins it passes on. Part of rulecad.

import { leaf, leafModel, parallelGuide, parallelGuideModel, serpentine, notchHinge, notchHingeModel, printable } from '@rulecad/flexures';

const spring = { length: 40, thickness: 1.26, width: 8 };          // mm: along x, bending along y, width up z
const pla = { E: 2680, strainLimit: 0.02, name: 'PLA' };           // MPa, and the strain it may see
const m = leafModel(spring, pla);
m.stiffness;        // 0.17 N/mm
m.travel(0.02);     // 16.9 mm: how far before 2% strain
m.strain(5);        // 0.0059 at 5 mm
leaf(spring);       // the shape

printable({ ...spring, travel: 5 }, { line: 0.42, layer: 0.2, wall_min: 0.84 }, pla, m);
// [{ level: 'pass', text: '1.26 mm thick: 3 lines of 0.42 mm', code: 'flexure.lines' }, { level: 'pass', text: 'at 5 mm of travel the material sees 0.59% strain, within PLA limit of 2.0%', ... }]

The flexures

ShapeStiffnessStrain at travel δ
leafA cantilever: fixed at one end, pushed at the tipE w t³ / 4L³3tδ / 2L²
fixedGuidedFixed at one end, the other moved without turningE w t³ / L³3tδ / L²
parallelGuideTwo fixed-guided leaves and a shuttle: a linear bearing with no parts2 E w t³ / L³3tδ / L²; the shuttle drops 3δ² / 5L
serpentinen leaves end to end, zigzagging: a long spring in a short spaceE w t³ / nL³3t(δ/n) / L²
notchHingeA thin neck between two round notches: a pivot with no play2 E w t^(5/2) / 9π√R, N·mm a radian4θ√(t/R) / 3π, times about 1.2 for the notch
bistableTwo shallow arches clamped at both ends, joined in the middle: pushed, they snap over and stay (a switch, a latch)384 EI / L³ at the start of a push2π²ht / L² on the way over; bistable when h > 2.31t (Qiu, Lang and Slocum 2004)
livingHingeA thin strip between two blocks that foldsEI / l, N·mm a radiantθ / 2l
compoundGuideTwo parallel guides in series, one folded back inside the other: a linear bearing with no dropE w t³ / L³3t(δ/2) / L²; no drop
letJointA hinge cut into a flat sheet: torsion bars either side of a slot, turning about an axis in the sheet (Jacobsen et al. 2009)2 / (2/k_t + 1/k_b), N·mm a radian: half-bars GJ / L_t, end bridges EI / L_bthe bars' shear (as von Mises) or the bridges' bending, whichever is more
letArrayLET joints in series across a fold and in parallel along it: a hinge that folds further, or holds its linem k / none joint's at θ / n
constantForceA slider-crank with a leaf coupler (Howell): the slider's force stays within ±5% over about a quarter of the leaf's lengthforce(stroke), flat {from, to, force}0.85 × 2.65 t Θ / 2l, the leaf's pseudo-rigid-body angle Θ
ellipticalHingeA notch hinge with half-ellipse notches, longer along the beam for less stress at an angle (Smith 2000)∫ dx / EI(x) along the notch, N·mm a radian; the circle within a few % of notchHinge1.2 × t K θ / 2 E I at the neck
cartwheelTwo leaves crossing at a hub inside a rim, joined where they cross: a pivot that prints flat16 EI / s × (1 + 3 r / s + 3 r² / s²), N·mm a radian, spokes s from a hub r2tθ / s × (1 + 1.5 r / s)
filletHingeA flat neck l long between notches with rounded corners: bends along the whole flat, so it turns far further than a notch as deep (Lobontiu 2003)∫ dx / EI(x) along the notch, N·mm a radian; EI / l with small rounds, the circular notch with no flatthe moment kθ at the neck, times about 1.2 for the corners (an estimate)
hyperbolicHingeNotches whose neck thickens as a hyperbola: bends close to its middle, so it keeps its axis; stiffer and shorter in angle than an elliptical notch of the same size∫ dx / EI(x) along the notchas filletHinge
spiralSpringA strip wound round a hub, its outer end in a boss, ends thickened to twice the strip: a torsion return that prints flatabout EI / L (Wahl 1963); worked out with the hub's centre held (Castigliano), within 1% of the beam solverthe moment along the strip times t / 2EI; tθ / 2L when the hub floats
pinnedLeafA stiff link on two corner-filleted pivots: moves as a link on two pins, stiff along itself where a plain leaf bucklesthe profile as a guided beam; near 2K / Lp² for pivots K = EI / l, Lp apartthe profile's, at the pivots' necks
xyStageTwo parallel guides in series at right angles: a stage that moves along x and yxyStageModel: 2 E w t³ / L³ each axis; 2 E w t / L along the leavesa guide's 3tδ / L², the worse axis; each guide's drop 3δ² / 5L strays the other axis
splitTubeA thin tube slotted along its length between closed collars, printed standing: a torsion pivotG (2πr − s) t³ / 3L (Roark: an open section), about a hundredth of the closed tube's√3 G t θ / L E (the shear as a tensile strain); warns that its twist shears the layers
butterflyPivotFour blade pairs in series, all turning about one axis, the drift of each pair running against the next's (Henein et al. 2003): a pivot that keeps its axisbutterflyPivotModel: a pair 8EI/L × (1 + 3a/L + 3a²/L²), a the blades' inner ends from the axis; the pivot a quarter of that; drift from the beam solvert/L × (2 + 3a/L) at a quarter of the turn
rollingJointTwo rollers held by crossed bands, one each way: they roll on each other with no friction or play (a CORE). Four parts: two rollers standing, two bands flatrollingJointModel: none of its own; it turns twice as far as the contact moves, until a roller meets a lugt / 2ρ at every angle, ρ = R + t/2 (Halverson et al. 2007)
xyThetaStageThe XY stage with a cartwheel on its stage: x, y and a turn about zxyThetaStageModel: the guides' 2 E w t³ / L³ (a little less at the hub, as the guides turn); about z the cartwheel in series with the stage turning, 2 E A c² / L + 2 E I / L a guidethe guides' 3tδ / L² or the spokes', the worse
snapHookA cantilever with a hook: pushed in it deflects and springs back behind the catchthe leaf's; force at the undercut, insertion and removal with friction μ (BASF, Bayer)3ty / 2L² at the undercut y
ratchetWheel, ratchetPawlSaw teeth on a pin and a leaf pawl: a one-way clickratchetModel: the pawl's lift a tooth high and the click along the rimthe pawl's, at the tooth height
foldedGuideA shuttle on two folds, each a beam out to a floating truss and back to an anchor: a compound guide in a shorter boxE w t³ / L³3t(δ/2) / L²; no drift
pinJointA pin, a ring with an arm and a cap, printed in place a support gap apart: the joint to compare the flexures againstnot compliant: pinJointCheck reads the printer's fit and support gap, and gives the ring's play—
snapPin, snapSocketA barbed, slotted peg that clicks into a hole, printed standing. These live in @rulecad/fixings now and are passed on here unchangedsnapPinModel: two snap hooks' worth of force, insertion and removal3ty / 2L² in each half
travelStopTwo posts at a leaf's tip where the strain limit says its travel must end, less a margin: the rule as a shape—at: factor × travel(strainLimit)
contactLeafA leaf with a stop bar beside it: free until the beam touches, stiffer after; two rates in one springfirst the leaf's, second a cantilever propped at the stop (12EI / b²(3a + 4b), b past the stop), meeting at contact3tδ / 2L² before contact, then the larger of the root's and the stop's moments
parallelogramA four-bar with a notch hinge at each corner: the coupler moves sideways and stays parallel, rising a little4K / L² at the couplerthe hinges' at θ = asin(δ / L)
tweezersTwo arms on a fixed-guided spring: squeeze to close the jaws; the simplest compliant gripperE w t³ / L³ at the fingers3tδ / L² at a squeeze δ
gripperJawsTwo jaws, each on a parallel guide with a stop both ways, resting closed and opened by a servo's double horn: the springs grip, so it holds with the power offgripperJawsModel: the guide's 2 E w t³ / L³ in series with the bar's 3 E I / l³, the grip k (w - g) / 2 on an object w acrossthe guide's 3tδ / L² at the horn's stroke
curvedLeafA leaf drawn as an arc, so its rest is the middle of its working range: a spring that works from a loaded restE w t³ / 4L³3tδ / 2L² from the curved rest, either way; preset t / 2ρ already in the curve
angleStopPosts at a pivot's arm end where its strain limit says the turn must end, less a margin—angle: factor × angle(strainLimit)
fourBarA four-bar on four short flexures: a crank-rocker turns a small swing into another; crank = rocker and coupler = ground make a parallelogramfourBarModel: K = 1 / ∫ dx / EI at each joint, the crank's torque dU/dθ from the joints' ½ K ψ²t ψ / 2l at the most turned joint (ψ its turn)
sliderCrankA crank, a coupler and a slider on a parallel guide, every joint a flexure: a press near the toggle, a pump's strokesliderCrankModel: the joints' and the guide's energy; the push (T - dU/dθ) / \|dx/dθ\|the joints' and the guide's 3tδ / L²
bridgeAmplifier, rhombusAmplifierFour links on in-line flexures between input and output blocks (the bridge) or corners (the rhombus): the input pushed apart, the output comes together about cot α times as far2K / L² sin²α at the input; the beam solver's ratio beside cot αt Δα / 2l, Δα from cos α' = cos α + u / 2L
leverAmplifierOne link on one flexure, pushed a from its pivot, its far end b out moving b / a times as farK / a² at the inputt (u / a) / 2l
tiltedBistableA shuttle on two straight leaves tilted toward it: pushed past the roots' line it snaps on and stays (Jensen and Howell)2 (EA/L sin²α + 12EI/L³ cos²α) at rest; the snap from the beam solverthe solver's, along the way over
buckledSwitchA strip printed longer than its frame, squeezed past buckling when fitted: it bows either way, and switches with the same push each way (Vangbo)buckles at 4π²EI / L²; rises (2/π) √(L s - π²t²/3); the snap from the beam solverthe solver's, fitted and switched
tiltedTristableTwo tilted-leaf bistables in series: the frame's leaves carry a stage, the stage's leaves carry the shuttle. It rests in three places: as printed, one pair over, both over (Oh and Kota)each pair's rise L sin α; the rests and the pushes from the beam solverthe solver's, along the way through both
forceGaugeA platform on a parallel guide with a needle, and a post with a tick cut every step newtons where the beam solver puts the needle: a spring balance printed in one piece24EI / L³ (two fixed-guided leaves); the solver's with the rounds3tδ / L² at the range, kept under half the limit
slipClutchA hub with curved arms, a bump on each tip in a notch of the ring round it: past a set torque the bumps ride out and it clicks round. A torque limiter and a detenteach arm EI / r³ (φ/2 - sin 2φ / 4) at its tip; slips at n r P (μ + tan α) / (1 - μ tan α)the solver's at the bump's lift, kept under half the limit

L length, t thickness (across the bend), w width (up the print), R a notch's radius, h an arch's rise, l a strip's length, s a spoke's length, r a hub's radius, y a hook's undercut, I = wt³/12, J a bar's torsion constant, θ an angle in radians. Each <name>Model(shape, material) gives stiffness, strain(travel), travel(strain) and stress(travel); the notch hinge's are in angles.

Printed flat

Every flexure is drawn with its length along x, bending along y, and its width up z. Printed that way, it bends within its layers, where the filament's own strength is. A flexure that bends across its layers pulls them apart, and that's the one that snaps.

printable(shape, printer, material, model) says how it prints, as findings like @rulecad/printcheck's: the thickness in whole extrusion lines (and at least two of them: line and wall_min from the printer's rules), the width in whole layers, and the strain at the travel against the material's strainLimit. Give it stop: false and it warns that nothing bounds the flexure's travel before the limit; give it the stop's travel and it checks that against the limit. travelStop draws the stop where the limit says.

Bent for real: the elastica

Beam theory holds while a leaf's travel is a few times its thickness. Past that the leaf curls, its tip comes nearer along x, and it stiffens. elastica(leaf, material, { force }) or { travel } integrates Euler and Bernoulli's beam with its exact curvature along the leaf (Bisshopp and Drucker 1945), and gives the tip's travel, how much it has shortened and turned, the strain at the root, and the secant stiffness. leafFlexed(leaf, material, load) draws the leaf bent, for a picture of the spring at work or a fit check at full travel. Checked against the published values: tip travel 0.3017 and 0.4935 of the length at load parameters PL²/EI of 1 and 2.

elastica({ length: 40, thickness: 0.84, width: 8 }, { E: 2680 }, { travel: 20 });
// { force: 1.35, travel: 20, shortening: 6.6, angle: 0.79, strain: 0.018, stiffness: 0.068, centreline: [...] }

Out of the plane: the LET joint

Every flexure above bends within its layers. The LET joint is the one that doesn't: it is the natural hinge for a flat sheet, a slot pattern whose torsion bars twist about an axis lying in the sheet, so a panel folds up out of the bed. Printed, its bars twist about an axis in the layer plane and its end bridges bend across the layers, so PLA cracks here sooner than anywhere else: PETG, nylon or TPU, and a sheet several layers thick. letJointModel gives the joint's stiffness, each half-bar's twist and each bridge's bend at an angle, and the angle a strain allows.

Folding: sheets printed flat that fold up

A lamina-emergent mechanism is printed as a flat sheet and folds up out of it: panels joined by hinges that lie in the sheet. Here a hinge is either an array of LET joints or a living hinge (a thin web on the bed, with the panels' sides above it sloped back at 45°). In the pseudo-rigid-body model each hinge is a row of pins: an LET joint turns about its centre on the sheet's mid-plane, a living hinge about the middle of its web. So a folded pose is the panels, and the lands between an array's joints, turned about those pins, and it can be checked before anything is printed.

LET arrays. letArray draws series LET joints one after another across the fold and parallel side by side along it, between two panels; letArrayModel gives its stiffness, its strain at a fold and the fold a strain allows. Joints in series share the angle, so the hinge folds further for the same strain; joints in parallel share the moment. One joint folds until the rigid parts either side meet: its pinch.

import { letArrayModel, flexureMaterial } from '@rulecad/flexures';
const petg = { ...flexureMaterial({ modulus: 1810, strength: 34, name: 'PETG' }), nu: 0.38 };
const m = letArrayModel({ width: 30, thickness: 1.2, bar: 0.84, slot: 1, bridge: 1.5, series: 4 }, petg);
m.strain(Math.PI / 2); // 0.0065: 0.65% at 90°, against PETG's 1.25%
m.stiffness;           // 1.72 N·mm a radian: 2.70 N·mm holds a wall at 90°
m.across;              // 24.72 mm of sheet the four joints take across the fold

One such joint folds 43.4° within PETG's limit, so four in series fold 90° at 1.93 times the margin.

A sheet that folds. foldSheet(sheet, folds) takes panels (outlines in the flat sheet) and hinges (a line, the panel on each side, and the hinge's sizes), and draws the sheet flat as printed, in one piece, or folded (folds in degrees for each hinge; a positive fold lifts its to panel off the bed). Where two arrays' bands meet near a corner they can cut a bit off a panel that no hinge holds; that bit is left out, so nothing prints loose. Two arrays whose joints would meet at a corner (wider than the panel left between their bands) are refused (fold.strips): they would print joined. foldSheetModel gives each hinge's model and where every body is at a set of folds.

foldCheck(sheet, material, { poses }) checks each pose on the way from flat, in steps stages (default 6):

The bodies are the panels less their hinges' bands, each the sheet's thickness. The bars and webs bend, so they are left out of the clash check; the strain check covers them. Its geometry is manifold-3d's, so foldSheet and foldCheck are async.

The workspace example flexures/tray is a tray printed flat in PETG: a 60 mm base and four 20 mm walls, each wall on four LET joints in series. Folded to 90°, each joint sees 0.65% strain and every two parts stay over 1.2 mm apart on the way up. Half of each wall's height goes into its joints, so it stands about 10 mm above them. It weighs 7.2 g (PETG 1.27 g/cm³, an estimate). The walls spring back flat unless something holds them: a latch, or what the tray holds. The assembly flexures/tray-fit shows it flat and with its walls standing (its tray.fold pose), and checks the block it holds against both.

The Miura fold. miura(p, fold) draws a Miura sheet: parallelograms with sides a and b at angle, in rows and columns. It is printed flat as panels on a web over the whole sheet, so the first layer is the whole sheet. Each panel is set back from its creases by half the web's width and sloped back at 45°. A Miura sheet folds rigidly: one number, fold (the facets' tilt off the bed, 0 flat to 90° folded flat), sets every crease, and the facets keep their sides and angle. miuraModel(p, material) gives the sheet at a fold (its cell, its size, its vertices, every crease's turn and whether it closes the panels' tops), each crease's strain and pinch, and the furthest it folds before a crease strains past the limit or pinches. On a 0.4 mm web 2 mm wide, PETG folds a Miura sheet only 3.6°: Miura sheets want a material that stretches, such as TPU or polypropylene, or a web much wider than its thickness.

QuantityFormulaSource
LET array stiffnessm k / n, n joints in series and m in parallel, k one joint'ssprings in series and in parallel, as Jacobsen et al. 2009 build the single joint
LET array strain at a fold θone joint's strain at θ / nthe same
LET joint pinchπ - 2 atan(h / 2c), c = slot / 2 + bar + slot, from the pin to the rigid parts' endsgeometry
Gap between the panels folded flatp (sin(π / n) + sin(2π / n) + ... + sin((n - 1)π / n)) - h, p the joints' pitchgeometry
Living hinge straint θ / 2l, t the web's thickness and l its widthHowell 2001 (small-length flexural pivot)
Living hinge pinchπ - 2 max(atan(t / l), atan((h - t / 2) / (l / 2 + h - t))), the panels sloped back 45°geometry
Miura cell at a tilt θH = a sin θ sin γ, L = √(a² - H²), V = a b cos γ / L, S = √(b² - V²); vertex (i, j) at (i L + (j mod 2) V, j S, (i mod 2) H)derived here; the same cell as Schenk and Guest 2013
Miura crease turnsbetween columns 2θ; between rows acos((H²S² - H²V² + L²S²) / (H² b² + L²S²))the facets' normals
Kresling sidesa² = h² + 2R²(1 - cos φ), b² = h² + 2R²(1 - cos(φ - 2π/n)), polygon side 2R sin(π/n)geometry
Kresling's second stable statetwist π + 2π/n - φ0, height² = a² - 2R²(1 - cos φ1) (both states keep a and b)derived here from Guest and Pellegrino 1994's geometry
Kresling's panels between the stateseach side and diagonal a bar E t (2A / L) / L, A its triangle's area: an estimateestimate
A Kresling crease's turn, printed to the other statethe change in its fold; at the floor and ring, the change in the triangle's lean about its edge, atan2(u_z, u · out)geometry
Waterbomb side creases' droope_m = δ + acos(cos(π/n) / ρ), ρ = √(cos²(π/n) cos² e_c + sin² e_c), δ = atan2(sin e_c, cos(π/n) cos e_c), from c · m = cos(π/n)derived here: each sector keeps its angle π/n
Waterbomb's endsin e_c = cos(π/n): the corner creases fold 180°, the side creases 180° - 360°/nthe same

The Kresling fold. kreslingModel({ sides, radius, height, twist }, material) is a tube of triangles between two polygons, the top turned against the bottom. Its triangles are fixed by one stable state; with the same triangles it stands again at a second, shorter and turned further, and between the two its panels must stretch, so it snaps from one to the other (it is bistable, not rigid-foldable). The model gives both states with each crease's fold, the flat pattern, and with a panel thickness the energy and force at any height, the barrier between the states and the most stretch on the way. With a hinge it gives each state's crease strain and the web width a crease would need for the material's limit. Six sides on a 20 mm radius, 30 tall turned 100°, stands again at 20.64 mm turned 140°; its diagonals fold over 150° there, which a 0.4 mm PETG web would need over 40 mm of width to take. Flat, a Kresling cell wants a material that bends far. In TPU (the rule set tpu), printed standing in one of its states, it is drawn:

import { kreslingTube, kreslingTubeModel, waterbomb, waterbombModel, flexureMaterial } from '@rulecad/flexures';
import tpuRules from '@rulecad/rules/tpu.json' with { type: 'json' };

const t = tpuRules.rules;
const tpu = flexureMaterial({ modulus: t.modulus.value, strength: t.strength.value, flex_strain: t.flex_strain.value, density: t.density.value, name: 'TPU' });
const tube = { sides: 6, radius: 20, height: 30, twist: 100, wall: 0.8, panel: { thickness: 1.6 }, hinge: { flex: 4 } };
const k = kreslingTubeModel(tube, tpu);
k.turns;    // { side: 65.35, diagonal: 49.05, floor: 30.24, ring: 30.24 } degrees, printed to the second state
k.strain;   // 0.1140: 11.4% on the 0.8 mm webs, 2.19 times under TPU's 25%
k.overhang; // 37.19 degrees from vertical, its steepest underside
k.grams;    // 4.68
kreslingTube(tube); // one piece, standing on its floor

The Kresling tube in TPU. kreslingTube(p) draws the tube standing in the state it is given (height, twist): a solid floor (cap, 1.2 mm) under the bottom polygon, the wall of triangles wall thick out from the axis, and a ring on the wall's top (rim, 2 mm) that keeps the top a polygon. Each triangle carries a panel inside it, panel.thickness in all, set back from its three creases by the web (hinge.flex) and sloped back 3:1, so the creases bend and the panels do not. The wall's own lean is about 19° on these sides; the panels' slopes add to it, and 3:1 keeps the steepest underside under the 45° the printer takes. kreslingTubeModel(p, material) gives both states, each crease's turn from the printed state to the other (the sides, the diagonals, and the floor's and ring's edges), each web's strain t ψ / 2l there (t the wall, a little more than the web's true thickness square to a leaning face, so the strain is not understated), the panels' stretch and the push over the barrier (the panels as bars, an estimate), the steepest underside of the drawn solid, and the grams. Printed, it is stress-free in its first state; pushed down and turned, it snaps to the second. In PETG the same webs see 11.4% against a limit of 1.25% and it fails by name (flexure.strain). The kit's slicer check (@rulecad/printcheck) passes the floor and the ring but warns of specks of 0.3 mm², its smallest region, at the panels' sloped edges from 9 to 23 mm up: look at those in a slicer's preview before printing.

The waterbomb base. waterbomb(p, fold) draws a waterbomb base (Hanna and others): a regular polygon of sides corners on radius, its 2n creases from the middle to the corners and to the sides' middles, each sector a triangle with its angle π/n at the middle. Printed flat in TPU it is the Miura's build, the web over the whole sheet and a panel on each sector. Folded, the middle stands up and the corners and sides go down, the side creases further: one number, the corner creases' droop fold, sets all of them while every sector keeps its angle. waterbombModel(p, material) gives the side creases' droop, every crease's fold, the middle's height and the reach, each web's strain and the side creases' pinch, the furthest fold that passes, and the grams. Four corners on 40 mm, panels 1.6 on webs 0.4 thick and 5.2 wide, fold to the end (45°, the side creases hanging straight down, the corner creases folded flat) at 12.08% in TPU, 2.07 times under its limit, in 3.97 g; in PETG the same webs stop the corners under 10°.

Pinned where it must be: the constant-force mechanism

constantForce is a slider-crank whose coupler is a leaf fixed to the slider (Howell, Midha and Murphy 1994): pushed in, the slider's force is there almost at once and holds within ±5% from the first millimetre to about a quarter of the leaf's length, because the leaf bends further as the crank's lever shortens. The ground pin sits a little beside the slider's line (the model's offset), so the leaf prints straight and the crank starts at its rest angle. The crank turns too far for any flexure, so it is pinned: constantForce draws the coupler (a slider block, the leaf, a boss at its tip) and constantForceCrank the crank with a boss at each end, for pins of filament. constantForceModel gives force(stroke), the flat stretch, the leaf's strain(stroke) and the stroke a strain allows. The force scales with the leaf's thickness cubed: 1.7 N at three lines (1.26 mm) on a 40 mm leaf 8 mm wide in PLA, 13 N at six.

Gripper jaws: a servo opens, springs grip

gripperJaws draws a two-jaw gripper for a hobby servo, printed flat in one piece. Each jaw sits on a parallel guide (two leaves, so it slides without turning) and rests closed, its face half the gap jaws.gap from the middle. The servo's double horn turns between the jaws' bars and pushes them apart to open. Let go, the guides spring back and grip whatever is between the jaws. The servo only opens, so the gripper holds with the power off and the servo never stalls on a load. Each guide has a contact stop both ways: a tongue from the root block between its leaves, its round end in a slot in the moving fork, stopping the jaw stop.open out and stop.close in.

Why the horn opens and the springs close: a horn's arm pushes only with the round of its tip, and only in directions within 90° of where the arm points. Turning between two bars it points outward at both, so its tip's top meets each bar's flat inner face cleanly, with the lever r cos a. Pushing the jaws closed from between them would need the side of the arm on a corner.

import { gripperJaws, gripperJawsModel, flexureMaterial } from '@rulecad/flexures';
const p = { width: 16, leaf: { length: 37, thickness: 0.84, apart: 14, fillet: 1 }, bar: { inner: 14, width: 5 },
  horn: { reach: 18, open: 65 }, jaws: { from: 20, to: 30, gap: 2 }, stop: { open: 4.8, close: 0.85, tongue: 10 } };   // mm and degrees
const petg = flexureMaterial({ modulus: 1810, strength: 34, name: 'PETG', density: 1.27 });
const m = gripperJawsModel(p, petg, { torque: 0.1765, payload: 0.1, accel: 300 });           // an SG90, 100 g
m.stroke;     // 4.56 mm each jaw opens
m.grip(10);   // 2.73 N a jaw on an object 10 mm across
m.rated;      // 9.41: the narrowest object held twice over
m.at;         // where the root blocks, forks, stops and bars are, to build a palm round it
gripperJaws(p);                  // the shape, at rest; { part: 'ground' | 'upper' | 'lower' } for one piece of it

The model's findings, in the kit's one shape (level, text, code, values): gripper.drive (the stroke and the push), gripper.servo (the servo against the springs, at full open where its lever is shortest and the springs pull hardest), gripper.bar (a warning when the bar bends more than a tenth as much as the guide), gripper.grip (what the grip holds, and on which sizes), gripper.holds, gripper.stop (each stop, and how far a jaw goes when the servo drives the horn on past open at its full stall torque, as a stalled servo pushes, against travelStop's 0.8 of the strain limit: the horn turns until the stops hold it, or through to 90°, its toggle; held with less than the margin asked while the toggle's travel is past 0.8, it warns), the leaves' print findings (flexure.lines, flexure.stop, flexure.strain) and gripper.mass. rests names each default it leaned on. Bad input is refused by name before any sums, with what would be accepted.

QuantityFormulaSource
Horn at restr sin a + tip = bar's inner face, so a = asin((inner - tip) / r)geometry
Stroker sin(a_open) - (inner - tip)geometry
Push on each barT / (2 r cos a), T the servo's stall torque times share (0.6) to open; driven past open, the whole stall torquestatics; the share is an estimate, as the kit's grip check's
Guide2 E w t³ / L³; its drop 3δ² / 5LHowell 2001
Bar3 E I / l³, I = w b³ / 12, from the fork to the jaws' middleYoung and Budynas 2002
Jaw1 / (1 / guide + 1 / bar)springs in series
Grip on an object w acrossk (w - gap) / 2 a jaw, up to the widest that goes in, gap + 2 stroke - 2 print gapsHooke's law
Held2 μ grip against m (g + a), at the margin askedCoulomb friction; μ 0.4 is an estimate
Tongue1 / ∫ (ℓ - s)² / E I(s) ds at its pinunit-load method, Young and Budynas 2002
Driven past openeach tip d = r sin a - (inner - tip) out; its jaw x from x + F(x) / k_bar = d, F(x) = k_guide x + k_tongue (x - stop) past the stop, the bar 3 E I / l³ from the fork's front to the tip (r cos a in front of the axis for the upper arm, behind it for the lower)springs in series and in parallel
Held by the stops(F upper + F lower) r cos a = the stall torque, the first angle it reaches it; if it never does, the horn turns to 90° and d = r - (inner - tip)statics

The grip rises with the object's width, so the gap at rest picks the sizes a gripper is for. The arm's jaws (below) rest 2 mm apart: 50 g held twice over from 5.7 mm across, 100 g from 9.4 mm, up to 10.5 mm.

Against the arm's hand-built gripper

The workspace example examples/bench has both on the arm: arm/gripper, drawn by hand (each finger on one long leaf, the horn closing them), and arm/jaws, this generator with a palm round it (the same yoke block and screws, the same SG90 and horn, the servo on two posts above the print). arm/jaws-check sweeps the horn from rest to open: nothing collides, and the horn clears the front post by 0.5 mm at rest.

Hand-built arm/gripperarm/jaws
Printed37.1 g in one print (3 pieces in its check)53.5 g in one print: 39.3 g of jaws and stops, 14.2 g of yoke block, spine and posts
Grip1.46 N a finger, on anything up to 8 mm0.68 N/mm a jaw past the 2 mm gap: 2.05 N at 8 mm, 2.91 N at 10.5 mm
50 g at 300 mm/s²2.3 times over2 times over from 5.7 mm across
100 g (the upright arm's payload)1.2 times: warns2 times over from 9.4 to 10.5 mm across
Rests onthe lever 0.38 (an estimate) and μ 0.4μ 0.4 and the servo's share 0.6 (estimates); no lever
Contactthe horn's arm passes through the finger's flat (25 mm³ overlap allowed in its check)the horn's tip on the bar's flat face
Servoholds the grip, stalled, while it carriesopens, then lets go; 2.1 times the springs at full open
Stopsnoneboth ways on each jaw; the servo driven on at its full torque stalls at 69° with a jaw at 4.98 mm, which bends the leaves to 75% of their strain limit; the stops resist 2.16 times its stall torque
Tool point85 mm from the yoke's screws105 mm

Swapped into the upright arm (arm/arm-upright, the jaws on the forearm's yoke in the gripper's place), with the arm's tool mass (lift.tool_mass, 0.148 kg with the hand-built gripper) raised by the jaws' extra 16.4 g to 0.164 kg, the arm still checks clean: nothing collides through its poses, the shoulder's motor has 2.13 times the torque it needs (1.204 N m against 2.563; 2.22 times with the hand-built), the elbow's 5.57 times (6.88), the tool still reaches its whole box with 66 mm to spare, and the accuracy budget moves from 2.361 to 2.376 mm against 2.5.

So it can replace it: it holds the upright arm's 100 g where the hand-built one warns, with no estimated lever and no stalled servo, at 16.4 g more and 20 mm more reach. What it gives up is range: twice over at 100 g only on objects 9.4 to 10.5 mm across. A different object size wants a different gap at rest.

Linkages, amplifiers and things that click

A compliant linkage is a rigid machine with each pin replaced by a short flexure. The pseudo-rigid-body model (Howell 2001, chapter 5) moves its links as the rigid machine's would, and puts a torsion spring at each pin: a joint of length l and thickness t is as stiff as 1 / ∫ dx / EI along it, which is EI / l without rounds, and a turn ψ strains it t ψ / 2l. The input needs the torque the springs' energy asks. Each joint's flexure lies on the line halfway between its two links, and rounds into a disc (a knuckle) on each, so no corner it meets is square. Every model here also runs the beam solver on the drawn flexures, where the springs-and-pins sums stop being enough.

import { fourBar, fourBarModel, bridgeAmplifierModel, tiltedBistableModel, buckledSwitch, buckledSwitchModel } from '@rulecad/flexures';

const pla = { E: 2680, strainLimit: 0.02, density: 1.24, name: 'PLA' }, flex = { length: 6, thickness: 0.84 };
const m = fourBarModel({ ground: 40, crank: 15, coupler: 40, rocker: 30, angle: 60, width: 6, flex }, pla);
m.kind;          // 'crank-rocker'
m.swing;         // [11.2, 11.9] degrees down and up before a joint reaches 2%
m.torque(10);    // 75.6 N·mm at the crank, 10° on (the beam solver: 75.5)

The figures for that four-bar, and for one of each of the others, all in PLA, 6 mm wide, joints 6 mm by 0.84 mm:

PartWhat the model saysGrams
fourBar, links 15, 40, 30 on 40each joint 159.9 N·mm a radian; swung ±9.0° (0.8 of the limit) the rocker turns 3.4°5.2
bridgeAmplifier, links 20 at 10°cot 10° = 5.67; over 0.1 mm the rigid links give 5.93 and the drawn flexures 5.76; the links lie flat at 0.608 mm of input5.7
tiltedBistable, leaves 30 at 8°rises 4.18 mm; 7.39 N switches it, 1.00 mm in; it rests again 5.95 mm down, and 1.21 N brings it back (1.82 N on a rigid frame); 1.65% on the way13.7
buckledSwitch, strip 50 squeezed 0.4the frame gives 0.082 mm; the strip pushes its pockets with 15.8 N and bows 2.19 mm; 7.00 N switches it either way; 1.62%10.6 (strip and frame)
FormulaWhere it is usedSource
K = 1 / ∫ dx / EI(x); EI / l without rounds; strain t ψ / 2leach jointHowell 2001, small-length flexural pivot
cos μ = (b² + c² - BD²) / 2bc; keep μ within 40° to 140°four-bar transmission angleNorton, Design of Machinery, a rule of thumb
x = r cos θ + √(l² - (r sin θ - e)²); F = (T - dU/dθ) / \|dx/dθ\|slider-crankrigid kinematics; virtual work
v = 2L (sin α - sin α'), cos α' = cos α + u / 2L; k = 2K / L² sin²αbridge, rhombusrigid kinematics; the joints' energy
k = 2 (EA/L sin²α + 12EI/L³ cos²α)tilted bistable at resttwo fixed-guided beams
δ / H = a² l / EItilted bistable's frame: a root's move out for its thrust Hthe bar a cantilever from its middle under the moment H a
P = 4π²EI / L²; h = (2/π) √(L s - π²t²/3)buckled switchEuler, clamped ends; first buckled mode

Three rests, a scale and a clutch

import { tiltedTristableModel, forceGauge, forceGaugeModel, slipClutch, slipClutchModel } from '@rulecad/flexures';

const pla = { E: 2680, strainLimit: 0.02, density: 1.24, name: 'PLA' };
const t = tiltedTristableModel({ outer: { length: 45, angle: 7 }, inner: { length: 32, angle: 7 }, thickness: 0.84, width: 6 }, pla);
t.places;        // [0, 7.93, 13.31] mm down: where it rests
const g = forceGaugeModel({ length: 40, thickness: 0.8, width: 6, range: 1.5, step: 0.5 }, pla);
g.ticks;         // [{ force: -1.5, at: 5.39, long: false }, ...]: a tick for each step, mm along y
const c = slipClutchModel({ radius: 15, thickness: 1.2, width: 6, depth: 1 }, pla, { torque: 30 });
c.torque;        // 73.5 N·mm: past this it slips
PartWhat the model saysGrams
tiltedTristable, leaves 45 and 32 at 7°rises 5.48 and 3.90 mm; 2.83 N takes it to its middle rest, 7.93 mm down, and 5.08 N to its last, 13.31 mm down; 0.55 N and 0.43 N bring it back; 1.84% on the way42.6
forceGauge, leaves 40 by 0.8, to 1.5 N0.276 N/mm (24EI / L³ without the rounds: 0.257); 5.39 mm and 0.93% at 1.5 N; ticks 1.78 mm apart; the needle drops 0.45 mm7.5
slipClutch, bore 15, three arms 1.2 thickeach arm 1.559 N/mm (the curved cantilever: 1.56); a 1 mm lift takes 1.49 N, so it slips at 73.5 N·mm; 0.55%; 12 clicks a turn7.9 (hub and ring)
FormulaWhere it is usedSource
1 / k = r³ (φ/2 - sin 2φ / 4) / EIa slip clutch's arm, a radial load at its tipCastigliano on a circular arc, M = P r sin θ
T = n r P (μ + tan α) / (1 - μ tan α)a slip clutch's slip torquethe BASF and Bayer snap-fit guides' wedge
k = 24EI / L³; drop 3δ² / 5La force gauge's guidetwo fixed-guided beams (Howell 2001)

Two more bistables, and gear teeth with no play

import { youngBistableModel, tensuralBistableModel, splitToothGear, splitToothGearModel } from '@rulecad/flexures';

const pla = { E: 2680, strainLimit: 0.02, density: 1.24, name: 'PLA' };
const y = youngBistableModel({ spacing: 46, thickness: 0.84, width: 6 }, pla);
y.second;        // 60.7 degrees: the coupler's turn to where it rests again
const t = tensuralBistableModel({ length: 18, spacing: 12, angle: 7, thickness: 0.84, width: 6 }, pla);
t.solvedTension; // 22.1 N in each thin segment through the middle
const g = splitToothGearModel({ module: 2, teeth: 24, width: 6, bore: 5 }, pla);
g.hold;          // 76.6 N·mm carried with no backlash
PartWhat the model saysGrams
youngBistable, spacing 46, arms 0.8413.64 N·mm turns the coupler, 12° on; past 30.6° it turns on by itself and rests 60.7° round (the four-bar: 61.8°); 5.12 N·mm brings it back; 0.99% on the way, 0.5% held over (2.03 times under 2%)9.1 (mover 5.6, ground 3.4, pins)
tensuralBistable, segments 18 at 7°, anchors 12 apart2.76 N switches it, 1.14 mm in; past 3.06 mm it snaps on and rests 5.67 mm along; 0.88 N brings it back; 33.6 N in each thin segment through the middle on a rigid slab, 22.1 N as drawn; 0.99% (2.02 times under 2%)21.6
splitToothGear, module 2, 24 teetheach half 16.98 N/mm, pushed back 0.1 mm: 1.7 N on each flank, 0.33%; no backlash up to 76.6 N·mm; a half closes its slit at 5.11 N (1.01%); at the hold 0.67% (2.99 times under 2%)11.9
FormulaWhere it is usedSource
K = γ Kθ EI / l at each coupler joint; ε = Kθ Θ t / 2lYoung bistable's four-barUS 6215081 (γ 0.85, Kθ 2.65); Howell 2001, the fixed-pinned segment
δ = c (1 - cos α); T = EA δ / 2atensural bistable through the middlethe chain's closure, the slab rigid
1/k = cos²α (∫ (r - ρ)² / EI dρ + ∫ dρ / κGA)a split tooth's half along the flank's normalCastigliano, Timoshenko's shear (κ 5/6)
T = 2 F rbsplit-tooth gear's holdtwo preloaded flanks on one tooth
Fclose = w / c (c the tip's movement per newton along the pitch tangent at the pitch point, bending and shear); closed at rest 2 F / Fclose of w; the stop at Fclose past the holdsplit-tooth gear's slitthe two flanks of a tooth: their forces add to 2 F up to the hold, then the driving one alone

Composing mechanisms

A mechanism is several flexures placed against each other. Three helpers make that a matter of naming rather than arithmetic:

import { size, ports, report, constantForce } from '@rulecad/flexures';
const trigger = size.constantForce({ force: 10, stroke: 8, width: 8, material: pla }, x1c);   // { leaf: 70, thickness: 3.36, crank: 35, … }
const pin = ports('constantForce', trigger).pin.at;                                             // where the crank's pin goes
report([{ name: 'trigger', kind: 'constantForce', params: trigger, travel: 8, stop: 10 }], x1c, pla).ok;

Requirements belong in the design's variables, each with its rule and source, as the printer's and the material's do; the sizing helpers read them from there.

Displacement first

The strain in a beam depends on how far it bends against its length and thickness, not on how hard it's pushed, so a compliant mechanism is sized by its travel (Howell; the BYU one-piece blaster, Lewis et al., PLOS ONE 2026): the travel and the strain limit set the length for a thickness, and the force comes last, from the width, which doesn't change the strain at all. size.forTravel(kind, job, printer) works that way round for the leaf, the fixed-guided beam, the parallel, compound and folded guides and the serpentine. Give force (at full travel) or energy (N·mm) to store. Leave width out and it takes the thinnest whole-line thickness at the shortest length that keeps the strain under the limit times a margin, and makes it as wide (whole layers) as the force needs. Give width when the print fixes it (a mechanism printed on its side is as wide as the print is tall), and the thickness sets the force instead: the thinnest that reaches it, lengthened to give just that. The result says its ratio, travel over length: the same ratio is the same strain at any size, so a design scales.

size.forTravel('parallelGuide', { travel: 12, energy: 50, width: 14, material: petg }, x1c);
// { length: 87.8, thickness: 2.1, width: 14, force: 8.33, energy: 50, strain: 0.0098, ratio: 0.137 }

Shaped beams: tapers and rounds

A leaf, a fixed-guided beam and a parallel guide's leaves take three more parameters. taper (0 to 1) shapes the beam's thickness to its bending moment: at 1 it is a uniform-strength beam, thick where it bends most and thin where it bends least, so the strain is the same all along it. least is the thinnest it may get (the thinnest wall that prints). fillet rounds the beam where it meets its block, at each end that's held, and into runs it on into the block so they join. thickness is then the most it is.

A square inside corner, where a bar meets its block, concentrates the strain. On a printed part that corner is where it yields and stays bent. A round of about the beam's thickness brings it back to beam theory's. A fully tapered beam bends 1.7 times as far as a bar before it reaches the same strain, and stores 1.7 times the energy. beamModel integrates the beam's own profile, rounds included, and size.forTravel takes a shape to size one.

size.forTravel('parallelGuide', { travel: 12, energy: 50, width: 14, material: petg, shape: { taper: 1, fillet: 2, least: 0.84 } }, x1c);
// 71 mm leaves, against 88 for bars

flexureMaterial(rules) makes the material from its rule set's modulus and strength: the strain it may see is its strength over its modulus (where it starts to yield) over a safety factor (1.5). That ratio is the figure of merit for flexures: PLA's is about 1.5%, PETG's 1.9%, nylon's higher. A flexure sized at a strain past it bends for good.

Lamina mechanisms

Working printed blasters and toys are one flat drawing printed on its side: every flexure bends within its layers, everything that moves stands on the bed, and every clearance is a slot in the drawing. lamina(spec) (async) takes a mechanism drawn that way and checks it as it will print and move:

The findings, each pass or fail with its code:

CodeWhat
lamina.freeAt rest, everything clears what it isn't joined to by the printer's gap, and each flexure touches only its two bodies, in one place each: else it prints fused
lamina.attachedEach flexure runs into its bodies, not just along an edge (an edge join prints as two pieces)
lamina.seatEach curve's end flare and run on lie inside its body (a seat added where they wouldn't); one hanging out of a frame drawn as it is fails
lamina.sequence, lamina.collideNothing runs into anything in any state or on the way; a step into a state a catch holds may settle on the catch
lamina.jam, lamina.followNo driver jams on a follower, and no follower has to give past its limit
lamina.holdsA catch holds: the joint pushing back towards rest jams on it. It says the least friction it holds at, and how far the catch must move to let go. A catch that bites presses into what it holds as it's moved: what it holds is cammed back out of it first
lamina.strainEach flexure's strain at the most it is moved, against the limit, by beam theory
lamina.peakEach flexure's real peak strain, by finite elements: the flexure and a band of each body it meets, laid on a grid of squares, held beyond the band at its root and pushed at its tip to the travel it reaches. A peak at a square inside corner fails: the strain there has no bound, and it's where a print yields. A spiral spring's hub, or a body turning about its own middle, is not a push along a line: it says so (info), and its strain is the model's
lamina.coilsA spiral spring's coils close up as it winds: a warning with their gap at rest, since the stop sweeps the bodies and not the coils. Stop it before they touch, and check a wide turn with the beam solver
lamina.stopSomething hard stops each flexure before its strain limit, scaled by its finite-element peak (swept from rest, so a stop that is jumped over doesn't count)
lamina.energyWhat each state stores, and the forces
lamina.forceThe force a hand needs along each driven step, from the physics: a force curve. Over a hand's 50 N, it jams
lamina.releaseWhere a body is let go of on the way (a latch letting go), and how far the hand had moved, with what force
lamina.heldLet go of in a state a catch holds, the body stays, and the force the catch takes (the physics, with physics.friction or frictionless, so cautious)
lamina.biteWhich way the held load pushes the catch: from the physics' contact forces, normal only, against how each contact point moves as the catch lets go. Under check.bite (5°) into the catch, it holds by friction or its own spring alone, and a printed catch slips
lamina.carriedA loose part (a disc) is held over and under, its middle over a bridge and a floor, loaded and all through the shot while it's in the frame
lamina.tripPulling the trigger lets the catch go: how far and how hard the finger pulled, against the force the catch held
lamina.holesEach fastener hole through a flooded frame is all frame: inside the outline, clear of the moving parts' room
lamina.homeAt the end of the sequence, everything is back where it started
lamina.beamsEach flexure's strain all the way through, bending as far as it bends
lamina.requiresA driven step's force curve does what you asked: its peak, its click (the fall after the peak), its end
lamina.fireLet go and stepped through time: each body's top speed, and the disc's exit speed and energy against a limit. A disc given less than fire.least (default a quarter) of what the springs stored fails, saying where the rest is as it leaves
lamina.roomIn every frame, planned and as the physics moved it, the shot included, nothing that moves runs into the frame deeper than half the gap (a flexure where it's anchored aside)

It returns the printed parts (body, the drawing extruded, after an optional finish for 3D work such as holes through it, and any loose parts), the findings, the energy in each state, and frames along the sequence with the flexures drawn bent, for an animation. A design that returns it is checked by cad check, and cad animate plays its sequence. The plane's geometry is manifold-3d's (Clipper2): JSCAD's 2D booleans are not robust enough for clearance checks a tenth of a millimetre fine.

The launcher's flat action is a worked example (examples/bench/projects/launcher/objects/flat.js): a pusher on a two-leaf spring, a tab to cock it, and a trigger that is its own sear, with a catch that leans back so it holds however slippery the plastic. examples/bench/projects/mechanisms has a key with a tactile click and a wave spring.

As it would behave: the physics

The kinematic checks above move each joint the way its model says and look for collisions. lamina then solves the mechanism as it would behave (physics.mjs): each flexure with a centreline (leaf, fixed-guided, guides, serpentine, wave spring, pivot pair, shaped or not) becomes a chain of large-deflection beams (beams.mjs), each body a rigid body, and everything touches everything it meets, flexures themselves included. A hand works it through the sequence: a joint the next state sets to a new value is driven there; one it keeps is held; one it drops, or one a catch holds in the next state, is let go of, gradually, so the mechanism finds where it rests. The hand's force along each driven step is the force curve; the frames are the solved shapes, each flexure's outline bent along its centreline.

The slow stages are kept between builds when a store is given, laminaCache({ get, put, salt }) (cad gives one, in the workspace's .cache/stages/): the physics (about 17 of a launcher's 22 minutes), a flooded frame's probe (the mechanism solved once more without the frame, for the room it needs), the kinematics (the sequence walked, each state, the latches, the strain and stops) and the frame's finite elements. Each is keyed by what it is made from (the mechanism in the plane: parts, joints, states, sequence, holds, material, height, the checks' settings; nothing of the straps, guides or finish, and for the kinematics nothing of the physics) and by salt, which is this library's own code, so a change to a strap, a check after them or a rule's words finds them at once, and any change to what they were made from runs them again. What a stage keeps is JSON (its findings, and what the later stages read of it, typed arrays as arrays), and a build gets the same copy whether it came from the store or was just made. LAMINA_TIMES=1 prints each stage's time.

The beam solver stands on its own too: beamSystem({ bodies, beams }), equilibrium(sys, { held, loads }) (Newton's method on the energy; a held unknown reports the force to hold it). It agrees with beam theory at small deflections, with the elastica to 0.1% at large ones, with a parallel guide's stiffness and drop, and buckles a column at the Euler load.

Modules

place(module, { name, at, angle }) turns and moves a sub-mechanism (its ground, bodies, joints, followers, states and named ports) and prefixes its names; combine(placed, extra) joins placed modules into one lamina spec. The push-push latch is built from a plunger module and a track module placed at the plunger's pin port.

More flexures

Springs that turn, and hinges that bend further

Pivots that keep their axis, a joint that rolls, and a stage that turns

Shaped by the solver: curves

A curve flexure is a spline through a few points, its thickness easing from point to point. It has no straight runs and no corners. start and end set the directions it leaves its root and meets its tip, held for a short lead so it meets each block square. mirror adds its mirror image across a line, so two arms either side of an axis pull together and their sideways pulls cancel. A curve has no formula, so its model is the beam solver's: its stiffness, its strain and energy at a travel, and the travel a strain allows, large deflections and all.

shapeCurve(job) finds the curve for a job. Its ends stay fixed: where it grows from and what it moves. It gets a box of room, a travel, an energy to store there, and a range of thicknesses. CMA-ES then moves every point and thickness until the beam solver says it stores the energy with the least peak strain, inside its room. No bend may be tighter than bend thicknesses (default 2), where a curved beam's inside fibre takes much more than beam theory says. No two parts of it may come within apart of each other (default 1 mm), at rest or fully moved: nearer, they may print fused and slap together when it fires. Each end leaves its block square for lead, and flares into it in a true round (fillet). That round is drawn for a face square to the end, so in a lamina each body a curve ends on gets that face: a seat, a block square to the end as wide as the flare and a margin, running in past the run on, rounded into the body. Where the body is already there it disappears into it. Where the end is oblique to the body's edge, or near it, the seat stands out of it as a shoulder, and lamina.seat says so. A flooded frame builds its own block at each root; those ends are only checked. The lamina also checks that a curve keeps the print gap from itself. Give width as a range and it is solved at the widest, then printed as tall as the energy needs: force goes with height, strain doesn't.

With moves: 'turn' and about: [x, y], its tip turns travel degrees about that point, as a lever on a hinge there would, and its force is the moment: a spring that is a hinge, shaped to put the hinge where you want it.

A plain leaf joint takes gamma, where along it its tip turns about (from the tip, as a share of its length): 0.85, Howell's, for a leaf pushed at its tip; ½ for one turned by a moment, which bends round evenly about its middle. The launcher's sear hangs on such a leaf, on the line its catch is pushed along: the spring's pull is the leaf's tension, and a trigger blade turns it.

Give it onRound to watch it work: after each round it's told every shape tried, and the best so far (its path, thickness, drawn-back shape, strain and energy), and returning true stops the search. @rulecad/cad's liveShape serves a page that draws them as they come, with a stop button.

Free-form points wander into tangles, so start it from a shape of the right kind. meander({ root, tip, legs, lo, hi }) folds an arm into its room as legs joined by round bends. Each arm must be long enough to spread the travel's strain (for a 12 mm stroke at 1%, 14 cm or more of a three-line arm), and a meander is how that length fits. From there the shaping moves everything. The launcher's in-line action (launcher/inline) is shaped this way, from five legs.

const job = { root: [44, 35], tip: [0, 5], start: 270, end: -90, region: { lo: [-18, 5.6], hi: [46, 35] }, gap: 0.3,
  thickness: [1.26, 4], moves: 'x', travel: -12, energy: 50, mirror: 0, width: [10, 20], margin: 0.8,
  guess: meander({ root: [44, 35], tip: [0, 5], legs: 5, lo: 7.5, hi: 33 }) };
const r = shapeCurve({ ...job, material: petg });
// r.params: the curve, ready for a lamina joint ({ kind: 'curve', params: r.params }); r.width, r.energy, r.strain

Joints that aren't flexures

pinJoint prints a pin, a ring with an arm and a cap as one piece, the ring a clearance from the pin and a support gap off the base and under the cap, so it breaks free with a twist and turns with a little play. It is the joint to compare the flexures against, and the one to use where a part must turn further than any flexure lets it (the constant-force mechanism's crank). pinJointCheck(joint, printer) says whether the clearance meets the printer's fit and the gaps its support gap, and how far the ring can rock. snapPin and snapSocket join two printed parts with a click: a barbed peg split down the middle, each half a snap hook, pushed into a hole; snapPinModel gives the forces, and the barb's back angle decides whether it holds for good (90) or can be pulled apart (45, the default, which also prints standing with no overhang).

Where snap pins live. A snap pin's job is to hold two parts together, so snapPin, snapSocket and snapPinModel moved to @rulecad/fixings, with the snap-hook sums they need written there. This package passes the same three functions on, so v.flexures.snapPin, the launcher and the joints sampler draw exactly what they drew before. Use fixings for a new design: there a snap pin is also named (snap pin 4x6), its socket takes its clearance from the printer's snap_clearance, its mass and its push-in and pull-out forces are reported, an assembly's fit can name it, and the holds coupon (examples/bench/projects/benchmarks/objects/holds-coupon) measures its socket and barb. Everything whose bending is its job stays here: snapHook, the ratchets, pinJoint printed in place, and the travel and angle stops. The annular snap, a lid that clicks on to a round box (issue 76), holds two parts together too, so it was built in fixings (annularSnapModel, annularBead, annularGroove) and is not passed on here.

In a lamina, a curve joint given a pin turns on a pin printed in place instead of bending about its own middle: { kind: 'curve', params, from: 'slide', to: 'pawl', pin: { d: 3, at: [x, y], under } }. The post stands on the from body and the to body has a hole round it, the printer's fit (printer.fit, or clearance) wider. In 3D the post stands on a floor (under, a 2D shape from the post to its body, base thick, six layers by default) and is capped by a cone flaring out at 45° by lip (1 mm). The carried body is cut back a support gap (lift) over the floor wherever it ever passes over it and under the cap. The pin carries the load: in the physics it is a stiff tie between the two bodies at the pin's centre, free to turn. The curve only springs the turn (a pawl's bias), so its strain comes from the physics rather than its own model. lamina.pin fails a post with no floor joining it to its body, and reports how tall the carried body turns on it. Across the plane, the cap and the floor hold the carried body to the post's body after their lift.

Lattices: a block that springs

A block of honeycomb cells between two solid plates is a soft spring: pressed, its slanted walls bend, so it gives many times more than solid plastic would. Lean the slanted walls inwards (a re-entrant, or auxetic, honeycomb) and the block's sides draw in when it is pressed instead of bulging out, and its walls see less strain for the same travel.

import { latticeCell, latticeBlock, latticeBlockModel, latticeFindings, flexureMaterial } from '@rulecad/flexures';

const petg = flexureMaterial({ modulus: 1810, strength: 34, name: 'PETG', density: 1.27 }); // strain limit 1.25%
const block = { slant: 10, upright: 15, angle: -20, thickness: 0.84, depth: 6, across: 2, rows: 4, plate: 3 };
const m = latticeBlockModel(block, petg);
m.stiffness;              // 5.09 N/mm: 5 N presses it 0.98 mm
m.travel(petg.strainLimit); // 2.03 mm before the walls reach PETG's limit: 2.06 times the travel at 5 N
m.buckling.force;         // 30.3 N: past it the walls buckle and the block softens sharply
m.poisson;                // -0.45: its sides draw in
m.grams;                  // 3.72
latticeBlock(block);      // the shape: 38.4 x 52.3 x 6 mm, every inside corner rounded
latticeFindings({ ...block, travel: 0.98 }, { line: 0.42, layer: 0.2 }, petg, m); // lines, openings, layers, strain, buckling

The cell is drawn in the bed's plane: upright walls of length h along y, slanted walls of length l at an angle θ to x (below 0 for re-entrant), every wall t thick and b deep (its height off the bed). Printed on its face, every wall bends within its layers. across counts whole cells along x (the rows between have half cells at the sides), rows the cell rows from plate to plate; each plate cuts its row's uprights at their middles.

latticeCell(cell, material) gives the cell's own properties, from the slanted walls' bending (Gibson and Ashby):

PropertyFormula
Density against solid(t/l)(h/l + 2) / (2 cos θ (h/l + sin θ))
Young's modulus along x, E1E (t/l)³ cos θ / ((h/l + sin θ) sin² θ)
Young's modulus along y, E2E (t/l)³ (h/l + sin θ) / cos³ θ
Poisson's ratio, pulled along x, ν12cos² θ / ((h/l + sin θ) sin θ)
Poisson's ratio, pulled along y, ν21(h/l + sin θ) sin θ / cos² θ
Shear modulus, G12E (t/l)³ (h/l + sin θ) / ((h/l)² (1 + 2h/l) cos θ)
A wall's peak strain for a strain ε along x3 (t/l) cos θ / abs(sin θ) × ε
A wall's peak strain for a strain ε along y3 (t/l)(h/l + sin θ) / cos θ × ε
Stress along y at which the uprights buckleE n² π² (t/l)³ / (24 (h/l)² cos θ), n = 0.686
The narrowest opening, gap (geometry)the least of 2 l cos θ - t (between the uprights) and cos θ (h + 2 l sin θ) - t (straight across between two opposite slanted walls); re-entrant, the least of 2 l cos θ - t and h + 2 l sin θ - t / cos θ (up y between its inward points)

A regular honeycomb (h = l, θ = 30°) has E1 = E2 = 2.31 E (t/l)³ and ν = 1; its buckling stress is 0.22 E (t/l)³. The formulas leave out the walls' stretching, so they hold while the walls are thin (t / l under about 0.25), and the end-fixity factor n = 0.686 is that of a regular cell, an estimate for others.

latticeBlockModel(block, material) solves the whole block as a frame of beams in @rulecad/fea: each wall a beam on its centreline, joined rigidly where walls meet, the bottom plate held and the top plate pressed straight down. It gives the stiffness, the most strain any wall sees at a travel (bending and stretch together), the force and travel at which the walls first buckle (each wall cut in four for that), the sides' strain at mid-height over the press's, the size, the volume and the grams. estimate is E2 over the block's face, b W / H, for comparison:

latticeFindings checks that the walls are whole printed lines (lattice.lines), each cell's narrowest opening is at least two lines so its walls print apart (lattice.gap), the depth is whole layers (lattice.layers), the cells lie in the bed's plane (lattice.direction), the walls' strain at the travel is within the material's limit (lattice.strain) and the travel is short of buckling (lattice.buckle). A cell whose walls would cross, fill it, or lean too little or too far is refused by name (lattice.cross, lattice.thick, lattice.angle).

PETG's strain limit keeps a lattice's travel short: the block above, 52 mm tall, gives 2 mm. A plain honeycomb of the same walls gives less, as its walls bend more for a press. A softer, longer spring wants thinner walls against longer cells, more rows, or a material that bends further (TPU).

The bench has this block as flexures/lattice (npx cad check flexures/lattice).

Kirigami: rotating squares

A sheet cut by slots into squares, each joined to its four neighbours by a narrow neck at one corner, is a stretchable panel. Pulled by two opposite sides, its squares turn, alternately one way and the other, and the sheet grows both ways at once: a Poisson's ratio of -1 (Grima and Evans). It is also far softer in its plane than the plate it was cut from. The same cell tiled is the chiral lattice of rotating squares.

import { rotatingSquares, rotatingSquaresModel, neckHingeModel, kirigamiFindings, flexureMaterial } from '@rulecad/flexures';

const petg = flexureMaterial({ modulus: 1810, strength: 34, name: 'PETG', density: 1.27 }); // strain limit 1.25%
const sheet = { pitch: 10, neck: 0.84, slot: 1.68, depth: 2, across: 6, rows: 6 };
const m = rotatingSquaresModel(sheet, petg);
m.E;            // 7.47 MPa in its plane, 242 times softer than PETG
m.stiffness;    // 12.44 N/mm pulled by its sides
m.limit;        // { stretch: 0.93 mm, turn: 2.42° at each neck, force: 12.1 N, sheet: 1.56% }
m.grams;        // 6.64
rotatingSquares(sheet); // the shape: 60 x 60 x 2 mm, one piece
kirigamiFindings({ ...sheet, stretch: 0.4 }, { line: 0.42, layer: 0.2 }, petg, m); // necks, slots, layers, strain

Through every vertex of the square grid runs one slot, along x and along y in turn, slot wide with round ends. Each stops a neck short of the slots either side, so every neck has a slot's round end (radius r, half the slot) on one side and another slot's straight side on the other: a one-sided notch hinge, neck (w) wide at its narrowest and depth (b) deep. Printed flat, every neck bends within its layers.

neckHingeModel gives a neck's stiffness and its peak strain for a turn. Both come from the kit's own plane-stress finite elements (@rulecad/fea), tabulated for r / w from 0.5 to 6 (25 cells across the neck, the round end's cells taking the share of them that is solid). neckFE(rho) solves one neck and gives any row again.

r / wStiffness over E b w²Peak strain per radian
0.50.049440.401
10.040880.297
20.031590.211
40.023470.153
60.019520.126

The thin-neck formula, 2 E b w^2.5 / (9π √(2r)) (Paros and Weisbord's, a one-sided notch taken as a two-sided one of twice the radius), gives the same trend but a stiffer neck: 1.22 times at r / w = 1, 1.05 times at 6. It leaves out the squares' give round the neck's roots. The peak strain is on the round side: 1.27 times the straight side's at r / w = 1.

The sheet's model, for squares of pitch a:

QuantityFormula
Each neck's place on its square's side, from a corner (geometry)d = r + w / 2
The square through a square's four necks: side, turn at rests = √((a - d)² + d²), α0 = atan(d / (a - d))
The sheet's width across n squares, at a turn αX = n s (cos α + sin α)
Each neck's turn2 (α - α0): neighbours turn opposite ways
In-plane modulus at rest (energy of the necks; Grima and Evans's model)E = 8 K / (s² b (1 - sin 2α0)), ν = -1
The pull across the sheet (N necks of stiffness K)F = (dU / dα) / (dX / dα), U = N ½ K (2 (α - α0))²

The formula for E is worked here from the necks' energy over a cell of four squares (eight necks); Grima and Evans give the rigid squares' Poisson's ratio of -1. Large turns are counted in the pull. The squares are taken as rigid (an estimate: their own bending is left out, beyond what the neck's finite elements count round its roots).

kirigamiFindings checks that the necks are whole printed lines (kirigami.neck), the slots at least two lines wide (kirigami.slot), the thickness whole layers (kirigami.layers), the squares in the bed's plane (kirigami.direction) and the necks' strain at a stretch against the material's limit (kirigami.strain). A pitch too small for its slots and necks, a slot end outside the table, or fewer than two squares each way is refused by name (kirigami.pitch, kirigami.radius, kirigami.count).

PETG's strain limit keeps the stretch small: a neck turns about 2.4° at r / w = 1, so the sheet above stretches 1.6% before its necks reach the limit. A larger round end lets a neck turn further (5.7° at r / w = 6), at the cost of wide slots. Its use in PETG is a soft, auxetic panel; a stretch of tens of percent wants TPU.

The bench has a 5 by 5 panel as flexures/kirigami (npx cad check flexures/kirigami).

Negative- and zero-stiffness cells

A shallow arch clamped at both ends, pushed at its middle, gives less push back the further it goes over part of its travel: its stiffness there is negative. Two cosine arches side by side, joined at the middle (bistable, after Qiu, Lang and Slocum), make the cell. Put a positive spring beside it, as stiff as that negative stiffness, and the two cancel: the pair holds about the same force over a range of travel. That is a zero-stiffness, statically balanced cell, a weight carried anywhere in the range.

import { curvedCellModel, balancedCellModel, flexureMaterial } from '@rulecad/flexures';

const petg = flexureMaterial({ modulus: 1810, strength: 34, name: 'PETG' });
const arch = { length: 80, rise: 2.5, thickness: 0.84, width: 6 };
const b = balancedCellModel(arch, petg);
b.cell.stiffness;  // 5.12 N/mm at rest
b.cell.negative;   // { from: 1.03, to: 3.99, least: -1.319 N/mm, at: 2.54 } mm pushed
b.spring;          // 1.319 N/mm: the positive spring that cancels it
b.flat;            // { from: 1.58, to: 3.44, span: 1.86, force: 4.39 N }: within 10% of 0 stiffness
b.leaves;          // { length: 37.2, count: 11 }: what a printed spring of leaves takes

curvedCellModel runs the beam solver (beams.mjs, large deflections) on the two drawn arches, the shuttle pushed along -y with its slide and turn left free, and gives the force curve with its slope at each step, the stiffness at rest, the push where it gives (snap), the range where the slope is negative, whether it stays over (bistable) and where (second), and the beams' most strain. It stays over when the rise is over 2.31 thicknesses (Qiu et al.); below that it springs back, though its stiffness still turns negative past the snap. A rise under about a thickness has no negative stiffness at all, and says so (cell.negative).

balancedCellModel adds a straight-line spring (by default as stiff as the arches' least slope) and finds the travel round that point where the pair's slope stays within 10% of the spring's (within), and the force there. It also sizes a printed spring for it: fixed-guided leaves side by side, each 12 E I / l³ with strain 3 t δ / l² (Howell), each as long as it must be to stay within half the strain limit at the far end of the range.

That sizing is why the balanced cell is a model here and its spring is not drawn: a spring soft enough (1.3 N/mm) yet carrying 4.4 N at a low strain must hold its energy in a lot of plastic. The cell above wants eleven leaves of 37 mm, 409 mm of leaf against the arches' 160 mm. Leaves in series (a wave spring) cannot do it at all: each leaf carries the whole force, so its strain allows only a few millimetres of leaf. An arch balanced this way is a large part.

The balanced strip cell. The compact answer is the buckled switch's strip, squeezed into its frame, balanced at its middle. Held square, as the switch's pad is, the strip goes over in its symmetric shape and is negative only near its middle. Free to turn, it goes over S-shaped, and its force falls in a straight line, the same negative stiffness most of the way across (Vangbo): a straight spring cancels all of it. So balancedStrip(p, material) makes the pad a ring round a disc printed in place in it (a pin, so the pad turns freely), the disc on the knob's stem, and the knob presses into a carriage on two leaves from one post on the frame (a parallel guide, free to draw in at its ends, so its force stays straight; leaves held at both ends would stretch and stiffen).

import { balancedStrip, balancedStripModel } from '@rulecad/flexures';

const cell = { length: 90, thickness: 0.84, width: 6, squeeze: 0.28, base: 12 };
const c = balancedStripModel(cell, petg);
c.negative; // -0.133 N/mm: the strip alone at its middle, its pad turned 6°
c.spring;   // { stiffness: 0.147, thickness: 0.84, length: 44.03 }: two leaves, 10% over the strip
c.flat;     // { from: -1.30, to: 1.82, span: 3.11, force: 0.012 N }: within 10% of 0 stiffness
c.margin;   // 2.33: strip, stem and leaves at 0.54% against PETG's 1.25%
c.grams;    // 19.0, strip and frame
balancedStrip(cell, petg); // the strip (its disc and stem printed in place in the ring) and the frame, side by side

balancedStripModel runs the beam solver on the strip, the pin, the stem and the leaves together: squeezed with the knob at the middle, then pushed the strip's rise either way. The spring is sized to the strip (10% over, so the middle stays stable; a softer one fails by name, cell.stable) and its leaves to stay within half the strain limit over the rise. Flat over 3.11 mm with two 44 mm leaves, where the arch above wanted 409 mm of leaf for 1.86 mm. The pin's 0.3 mm of play and its rub are left out of the model, and the knob is taken as held without play (a press fit, an estimate).

Developable mechanisms: a four-bar in a tube's wall

A developable mechanism is made of pieces of a surface: at rest it is the surface and nothing stands out of it; moved, its links leave the surface, outward or inward (Nelson and others). On a cylinder whose joints' axes run along it, the mechanism is a planar one seen end on: a four-bar whose joints are four points on the wall's circle, its links the arcs of wall between them, the rest of the tube its ground. A grip's housing that grows a bump under the fingers, or a tube whose side opens, is one.

import { tubeFourBar, tubeFourBarModel, tubeFourBarFindings, flexureMaterial } from '@rulecad/flexures';

const petg = flexureMaterial({ modulus: 1810, strength: 34, name: 'PETG', density: 1.27 });
const tube = { radius: 20, wall: 2.5, height: 20, joints: [200, 140, 60, -20], hinge: { flex: 8, thickness: 0.84 } };
const m = tubeFourBarModel(tube, petg);
m.travel;    // [-8.8, 8.8]: the input's turn each way at PETG's strain limit, degrees
m.at(-4.4);  // turns, strain 0.63%, torque -89.8 N·mm, how far each link stands out of the tube and in
m.grams;     // 6.69
tubeFourBar(tube); // the tube, standing, one piece
tubeFourBarFindings({ ...tube, turn: -4.4 }, { line: 0.42, layer: 0.2 }, petg, m); // webs, layers, strain, gap, surface

joints gives the four hinges' places round the tube in degrees, in order: the input's hinge on the ground, the input to the coupler, the coupler to the output, the output's hinge on the ground. The links move as the rigid four-bar's (the pseudo-rigid-body model, Howell), each hinge a torsion spring at its web's middle:

QuantityFormula
A link's lengththe chord between its two hinges, 2 R sin(arc / 2)
The coupler's far hingewhere the circles about the input's moved end and the output's ground hinge meet, on the side it lies at rest
A hinge's bending lengthl_eff = l - 2 rr + 2 ∫ (t / t(s))³ ds over each round corner, t(s) = t + 2 (rr - √(rr² - s²))
Each hinge's stiffnessE I / l_eff, I = H t³ / 12 (a living hinge)
Each hinge's straint ψ / 2 l_eff at a turn ψ (at the web's thin middle)
The input's torquethe slope of Σ ½ K ψ² with the input's turn
How far a link stands out or inthe most and least distance of its wall's middle from the axis, less R

Each hinge is the wall thinned to a web on its middle by a pocket from the outside and one from the inside, each pocket's corners at the web rounded (radius rr, the pocket's depth or half the web if less). The rounds thicken the web's ends, so it bends as a shorter one: on the bench tube the 8 mm web is 6.34 mm thin and bends as 7.20 mm, about 11% stiffer than the 8 mm figure (m.hinge.length). A positive turn takes the input out of the tube, a negative one in. Printed standing, every hinge's axis is up z, so it bends within its layers, and the first layer is the tube's whole ring. A web is straight on a curved wall, so its length is kept under √(2 R (wall - t)), where its ends stand a quarter of the pockets' cut off the wall's middle (developable.hinge).

tubeFourBarFindings checks the webs in whole printed lines (developable.web), the length in whole layers (developable.layers), the hinges' strain at the input's turn (developable.strain), the links that are not joined apart (developable.gap), and says how far each link stands out and in (developable.surface). Joints out of order, arcs too short for two hinges, or a wall thicker than the radius are refused by name (developable.*).

The bench has this tube as flexures/tube.

On a cone. With the joints' axes on a cone's rulings, which all meet at its apex, the mechanism is a spherical four-bar about the apex (Hyatt, Magleby and Howell): each link turns about the apex, and a link's length is the angle between its two joints' axes. coneFourBar(p) draws it standing on its wide end, the wall leaning in by the cone's half-angle angle, each hinge a web down a ruling cut by pockets from both faces with round corners; the inside overhangs by that angle and nothing else does. coneFourBarModel(p, material) closes the loop on the sphere and gives what the tube's model gives; coneFourBarFindings adds developable.overhang.

import { coneFourBar, coneFourBarModel, coneFourBarFindings } from '@rulecad/flexures';

const cone = { radius: 26, angle: 20, wall: 2.5, height: 20, joints: [200, 140, 60, -20], hinge: { flex: 7, thickness: 0.84 } };
const c = coneFourBarModel(cone, petg);
c.links;    // { input: 19.69, coupler: 25.40, output: 25.40, ground: 37.49 } degrees between the axes
c.hinge;    // { stiffness: 306.79 N·mm a radian, length: 6.20, width: 21.28 }: each web as long as the slant
c.at(-3.7); // strain 0.61% (2.05 times under PETG's limit), torque -92.9 N·mm; the input and coupler 1.47 mm in
c.grams;    // 8.29
QuantityFormula
A joint's axis(-sin κ cos q, -sin κ sin q, cos κ), up its ruling to the apex
A link's lengthacos(u_i · u_j) = acos(sin²κ cos(q_j - q_i) + cos²κ)
The output's turn ψC0 turned ψ about D keeps B · C = B0 · C0: a cos ψ + b sin ψ + c, a = B · C0 - (B · D)(D · C0), b = B · (D × C0), c = (B · D)(D · C0)
A hinge's stiffnessE b t³ / 12 l_eff, b = H / cos κ, the slant

As the angle goes to 0 the apex goes far off and the cone four-bar is the tube's, joint for joint (the test holds them to 0.001°).

What the models are good for

Beam theory and the pseudo-rigid-body model, good while a flexure's travel is a few times its thickness; past that, the elastica above for a leaf (the other flexures' large-deflection models are on the roadmap). The material's strain limit is yours to set: PLA is brittle and creeps when held bent; PETG and nylon last far longer; living hinges want TPU or polypropylene. Measured limits, with their sources, belong in the material's rule set. A rubber's strength over its modulus (3.2 for TPU 95A) is no limit at all, so flexureMaterial takes the rule set's flex_strain for it (25% for the kit's tpu, an estimate: neither maker's sheet gives a fatigue limit) and refuses a rubber without one.

Sources