Skip to main content

Revolute

A revolute mate is a hinge: the two connectors share an origin and a Z axis, and the second part is free to rotate about it. It is the joint of a lever on a pivot, a door on its hinge, a wheel on an axle.

Free motionrotation about Z

In the viewport

  1. Click Revolute on the assembly toolbar and pick the two connectors — the fixed part's pivot first, then the swinging part's.
  2. The part snaps onto the pivot. Drag it in the viewport and it swings about the axis.
  3. Rotate sets the rest angle in degrees (30° in the picture); Limits bound the swing (degrees); Offset shifts the hinge point in the driver's frame — any axis, so a lever can hinge beside a connector rather than on it.
  4. Click Apply. The joint's row in the Joints panel offers Animate…, which sweeps the angle between the limits — see Animating a joint.

Lever hinged on the base plate at 30°, held by its pin

The code behind it

The lever's pivot frame is a plane connector at its pivot hole, facing down like the underside it lies in, so it meets the plate's upward bore frame face-to-face and the lever sits flat on the plate. The pin is a second, fastened mate:

lever.part.js
lever.part.js
import { part, sketch, line, circle, extrude, fillet, color, plane, select, connector } from 'fluidcad/core';
import { face } from 'fluidcad/filters';
import { coincident, distance, fix, horizontal, vertical } from 'fluidcad/constraints';

// A lever: 60 × 16 × 8 mm bar with rounded corners, a Ø8 pivot hole at one
// end and a Ø6 hole at the other. The pivot hole sits on the part's origin.
export const lever = part('Lever', () => {
sketch('xy', () => {
const b = line([-8, -8], [52, -8]);
const r = line([52, -8], [52, 8]);
const t = line([52, 8], [-8, 8]);
const l = line([-8, 8], [-8, -8]);
coincident(b.end(), r.start());
coincident(r.end(), t.start());
coincident(t.end(), l.start());
coincident(l.end(), b.start());
horizontal(b);
horizontal(t);
vertical(r);
vertical(l);
fix(b.start(), [-8, -8]);
distance(b.start(), b.end(), 60);
distance(r.start(), r.end(), 16);
fillet(6, b, r, t, l);
circle([0, 0], 8);
circle([44, 0], 6);
});
extrude(8);
color('tomato');

// The pivot frame: the part's XY plane at the hole, facing down like the
// underside it lies in — Z out of the bottom face, ready to meet a
// plate's upward frame face-to-face.
connector('pivot', plane('-xy'));
// Where the pin's head seats: the top face's frame moved back to the
// hole (the face centre is 22 mm along the bar).
connector('pinSeat', select(face().planar().onPlane('xy', 8))).offset(-22, 0, 0);
});
pin.part.js
pin.part.js
import { part, sketch, circle, extrude, chamfer, color, select, connector } from 'fluidcad/core';
import { face } from 'fluidcad/filters';

// A headed pivot pin: Ø8 × 18 shaft under a Ø12 × 3 head, tip chamfered.
export const pin = part('Pivot pin', () => {
sketch('xy', () => {
circle([0, 0], 8);
});
const shaft = extrude(-18); // down from the head's underside
sketch('xy', () => {
circle([0, 0], 12);
});
extrude(3); // the head, fused onto the shaft
chamfer(1, shaft.endEdges());
color('goldenrod');

// Under the head: the face that seats on whatever the pin goes through.
connector('head', select(face().planar().onPlane('xy', 0)));
// The tip face, Z pointing out of the pin.
connector('tip', shaft.endFaces());
});
lever-assembly.assembly.js
import { assembly, insert, mate } from 'fluidcad/core';
import { plate } from './asm-plate.part.js';
import { lever } from './asm-lever.part.js';
import { pin } from './asm-pin.part.js';

export const leverAssembly = assembly('lever-assembly', () => {
const base = insert(plate).grounded();
const arm = insert(lever).translate(0, 0, 40);
const pivotPin = insert(pin).translate(0, 0, 70);

// Revolute leaves one degree of freedom: rotation about the shared Z.
// The lever's pivot frame lands on the plate's bore frame, so the lever
// lies on the plate and swings about the bore. .rotate() sets the rest
// angle and .limits() bounds the swing, both in degrees.
mate('revolute', base.connectors.bore, arm.connectors.pivot).rotate(30).limits(-45, 45);

// The pin is fastened to the lever, head seated over the hole — it
// swings with the lever.
mate('fastened', arm.connectors.pinSeat, pivotPin.connectors.head);
});

Options

mate('revolute', base.connectors.bore, arm.connectors.pivot)
.rotate(30) // rest angle, degrees about the shared Z
.limits(-45, 45) // swing bounds, degrees
.offset(0, 0, 2) // lift the hinge 2 along the driver's Z
.flip() // hinge from the other side

The pivot axis

The axis is the connectors' Z. A face connector on the face the part rests on gives a hinge perpendicular to that face — the usual case. For a hinge along an edge, put the connector on the edge itself: a straight-edge frame has Z along the edge, a circular-edge frame has Z along the circle's axis.