Quick-Release Camera Plate

A quick-release camera plate of the RC2 type in the lever clamp of a ball head. The plate size, its mass and the 1/4-20 camera screw are published figures. The screw is a true helix in the tripod bush of a camera, and the bush is cut in half to show the two threads in mesh. The kernel measures the mass of the plate with its screw and pad and prints it beside the catalogue value. The dovetail section, the pockets under the plate, the clamp, the lever and the ball head are a display model.
Code
This is the full program. The playground runs it in your browser without a change.
ts
import { box, compound, cut, cutAll, cylinder, edgeFinder, extrude, fillet, fuseAll, line, loft, measureVolume, polygon, revolve, rotate, sphere, torus, translate, unwrap, wire } from 'brepjs/quick';
import { color } from 'brepjs/playground';
// Quick-release camera plate of the RC2 type in the clamp of a ball head.
// The plate size, its mass and the 1/4-20 camera screw are published figures.
// The dovetail section, the pockets under the plate, the clamp, the lever and the ball head are a display model.
// The camera screw is in the tripod bush of a camera. The bush is cut in half to show the two threads in mesh.
// Units are millimetres. The plate slides along Y and the lever is on the -X side before the last turn.
interface PlateParams {
release?: number; // 0 = clamped, 1 = lever open and plate lifted out
tilt?: number; // ball head tilt in degrees, -25 to 25
}
type P2 = [number, number];
type P3 = [number, number, number];
type Shape = ReturnType<typeof cylinder>;
// Kernel shapes live in WASM memory. Every temporary goes through own(). freeing() runs a build and then frees them all.
const owned: { delete(): void }[] = [];
const own = <T extends { delete(): void }>(s: T): T => {
owned.push(s);
return s;
};
const freeing = <T,>(build: () => T): T => { try { return build(); } finally { owned.splice(0).forEach((s) => s.delete()); } }; // also when the build throws
// ---- published figures
const PLATE = { length: 52.8, width: 42.2, height: 11.2 }; // 2.08 x 1.66 x 0.44 in
const CATALOGUE_G = 40.5;
const THREAD = { major: 6.35, minor: 4.98, pitch: 1.27 }; // 1/4-20 UNC
const M6 = { major: 6, minor: 4.917, pitch: 1 }; // metric coarse thread of the lock screw
const DENSITY = { aluminium: 2.7e-3, steel: 7.85e-3, rubber: 1.2e-3 }; // grams per cubic millimetre
// ---- display model
const FLANK = { flat: 3, top: 8.2, inset: 2.5 }; // dovetail flank of the long sides
const PAD = 1; // rubber pad on the plate
const POCKET = { from: 6, to: 17, half: 22, depth: 7.2 }; // cast pockets under the plate
const KNOB = { radius: 8.6, recess: 9.2, depth: 4.5, height: 3 }; // head of the camera screw
const BODY = { x: 31, y: 28, depth: 16, jaw: 9 };
const LEVER = { pivot: [-28.2, -20] as P2, open: 40, jaw: [-4, 18] as P2, end: 48 };
const BALL = { radius: 17, centre: -38, neck: 9 };
const HOUSING = { radius: 24, top: -32, bottom: -76 };
const BUSH = { radius: 5.5, height: 6.5 }; // tripod bush of the camera
const LOCK = { stud: 12, hole: 14 }; // threaded stud of the lock knob and its tapped hole
const block = (x0: number, x1: number, y0: number, y1: number, z0: number, z1: number): Shape =>
own(box(x1 - x0, y1 - y0, z1 - z0, { at: [(x0 + x1) / 2, (y0 + y1) / 2, (z0 + z1) / 2] }));
const prism = (pts: P3[], by: P3): Shape => own(unwrap(extrude(own(unwrap(polygon(pts))), by))) as Shape;
// A closed profile in the (r, z) half-plane, revolved about Z.
const lathe = (pts: P2[]): Shape => own(unwrap(revolve(own(unwrap(polygon(pts.map(([r, z]): P3 => [r, 0, z])))), { axis: [0, 0, 1] }))) as Shape;
const volume = (s: Shape): number => unwrap(measureVolume(s));
// A helical thread tooth about +Z, from z = from to z = to. Its crest passes the +X side at z = ref.
// tip > core is the thread of a screw on a core, tip < core is the thread in a hole. hand 1 is a right-hand thread.
const FACETS = 12; // sections of the smooth loft in each turn. Each flank is one helical face
const SLACK = 0.998; // keeps the tooth a hair clear of its core or its bore
const PLAY = 0.1; // radial play between a screw thread and its mating thread
const helixTooth = (core: number, tip: number, pitch: number, from: number, to: number, ref: number, hand: 1 | -1 = 1): Shape => {
const root = tip > core ? core / SLACK : core * SLACK;
const crest = tip > core ? tip : tip / SLACK;
const half = 0.42 * pitch;
const n = Math.max(2, Math.round(((to - from) / pitch) * FACETS));
const sections = Array.from({ length: n + 1 }, (_, j) => {
const z = from + ((to - from) * j) / n;
const a = hand * 2 * Math.PI * ((z - ref) / pitch);
const at = (r: number, dz: number): P3 => [r * Math.cos(a), r * Math.sin(a), z + dz];
const pts = [at(root, -half), at(crest, 0), at(root, half)];
return own(unwrap(wire(pts.map((p, i) => own(line(p, pts[(i + 1) % 3]!))))));
});
return own(unwrap(loft(sections, { ruled: false }))) as Shape;
};
function quickRelease({ release = 0.8, tilt = 0 }: PlateParams = {}) {
const t = Math.min(1, Math.max(0, release));
const lean = Math.min(25, Math.max(-25, tilt));
const stage = (from: number, to: number): number => Math.min(1, Math.max(0, (t - from) / (to - from)));
const w = PLATE.width / 2;
const l = PLATE.length / 2;
const top = PLATE.height - PAD;
const r = THREAD.major / 2;
// Plate: a dovetail section along Y, clipped corners, cast pockets, a recess and a hole for the screw.
const flank = (side: 1 | -1, y: number, outer: number): P3[] => [
[side * w, y, 0], [side * w, y, FLANK.flat], [side * (w - FLANK.inset), y, FLANK.top], [side * (w - FLANK.inset), y, outer],
];
const blank = prism([...flank(1, -l, top), ...flank(-1, -l, top).reverse()], [0, PLATE.length, 0]);
const clips = [-1, 1].flatMap((sx) => [-1, 1].map((sy) => prism([[sx * (w + 1), sy * (l - 6), -1], [sx * (w + 1), sy * (l + 1), -1], [sx * (w - 6), sy * (l + 1), -1]], [0, 0, top + 2])));
const pockets = [-1, 1].map((s) => block(Math.min(s * POCKET.from, s * POCKET.to), Math.max(s * POCKET.from, s * POCKET.to), -POCKET.half, POCKET.half, -1, POCKET.depth));
const hole = own(cylinder(r, PLATE.height + 2, { at: [0, 0, -1] }));
const plate = own(unwrap(cutAll(blank, [...clips, ...pockets, hole, own(cylinder(KNOB.recess, KNOB.depth + 1, { at: [0, 0, -1] }))]))) as Shape;
const pad = own(unwrap(cut(block(-w + 5, w - 5, -l + 4, l - 4, top, PLATE.height), hole))) as Shape;
// Camera screw: a disc head in the recess, a plain shank in the plate, the thread above the pad, and a folding ring to turn it.
const rc = THREAD.minor / 2;
const half = 0.42 * THREAD.pitch;
const tip = PLATE.height + 4.4 * THREAD.pitch;
const stem: P2[] = [[0, KNOB.depth - KNOB.height], [KNOB.radius, KNOB.depth - KNOB.height], [KNOB.radius, KNOB.depth], [r, KNOB.depth], [r, PLATE.height], [rc, PLATE.height], [rc, tip - 0.4], [rc - 0.4, tip], [0, tip]];
const screw = own(compound([lathe(stem), helixTooth(rc, r, THREAD.pitch, PLATE.height + half, tip - 0.4 - half, 0)]) as Shape);
const ring = own(torus(7, 0.7, { at: [0, 0, KNOB.depth - KNOB.height - 0.7] }));
// Tripod bush of the camera on the pad: the mating thread, half a pitch from the thread of the screw. The lever side is cut away.
const bushTop = PLATE.height + BUSH.height;
const tube = own(unwrap(cut(own(cylinder(BUSH.radius, BUSH.height, { at: [0, 0, PLATE.height] })), own(cylinder(r + PLAY, BUSH.height + 2, { at: [0, 0, PLATE.height - 1] }))))) as Shape;
const away = block(-BUSH.radius - 1, 0, -BUSH.radius - 1, BUSH.radius + 1, PLATE.height - 1, bushTop + 1);
const bush = [tube, helixTooth(r + PLAY, rc + PLAY, THREAD.pitch, PLATE.height + half, bushTop - half, THREAD.pitch / 2)].map((s) => own(unwrap(cut(s, away))) as Shape);
// Clamp: a body with a fixed jaw on +X and an end stop, and a lever with the moving jaw on -X.
const base = block(-BODY.x, BODY.x, -BODY.y, BODY.y, -BODY.depth, 0);
const round = own(unwrap(fillet(base, edgeFinder().inDirection('Z').findAll(base), 5))) as Shape;
const fixedJaw = prism([...flank(1, -BODY.y + 5, BODY.jaw), [BODY.x, -BODY.y + 5, BODY.jaw], [BODY.x, -BODY.y + 5, 0]], [0, 2 * BODY.y - 10, 0]);
const stop = block(-12, 12, l, BODY.y, -1, 4);
const body = own(unwrap(fuseAll([round, fixedJaw, stop]))) as Shape;
const [px, py] = LEVER.pivot;
const jaw = prism([...flank(-1, LEVER.jaw[0], BODY.jaw), [px + 2, LEVER.jaw[0], BODY.jaw], [px + 2, LEVER.jaw[0], 0]], [0, LEVER.jaw[1] - LEVER.jaw[0], 0]);
const arm = block(px - 2.8, px + 2.7, py, LEVER.end, 0, BODY.jaw);
const grip = own(cylinder(5, BODY.jaw + 3, { at: [px, LEVER.end, 0] }));
const lever = own(unwrap(fuseAll([arm, jaw, grip, own(cylinder(2.75, BODY.jaw, { at: [px, py, 0] }))]))) as Shape;
const pin = own(cylinder(2, BODY.jaw + 1.5, { at: [px, py, 0] }));
const swung = own(rotate(own(unwrap(cut(lever, pin))) as Shape, LEVER.open * stage(0, 0.4), { at: [px, py, 0] }) as Shape);
const catchPin = own(cylinder(2.5, 5, { at: [-14, -BODY.y, -8], axis: [0, -1, 0] })); // brass safety catch
// Ball head: the ball and its neck under the clamp, a housing with a spherical seat, a lock knob and a base.
const ball = own(unwrap(fuseAll([own(sphere(BALL.radius, { at: [0, 0, BALL.centre] })), own(cylinder(BALL.neck, -BODY.depth - BALL.centre, { at: [0, 0, BALL.centre] }))]))) as Shape;
const hr = HOUSING.radius;
const shell = lathe([[0, HOUSING.bottom], [hr, HOUSING.bottom], [hr, HOUSING.top - 2], [hr - 2, HOUSING.top], [0, HOUSING.top]]);
const housing = own(unwrap(cut(shell, own(sphere(BALL.radius, { at: [0, 0, BALL.centre] }))))) as Shape;
const lock = [own(cylinder(3.5, 7, { at: [0, hr, -60], axis: [0, 1, 0] })), own(cylinder(9, 11, { at: [0, hr + 7, -60], axis: [0, 1, 0] }))];
// The lock knob turns an M6 stud in a tapped hole of the housing. Both threads are built on Z and then laid on the knob axis.
const [mc, mm, mf] = [M6.minor / 2, M6.major / 2, 0.42 * M6.pitch];
const onKnob = (s: Shape): Shape => own(translate(own(rotate(s, -90, { axis: [1, 0, 0] })), [0, hr, -60]) as Shape);
const stud = onKnob(own(compound([own(cylinder(mc, LOCK.stud, { at: [0, 0, -LOCK.stud] })), helixTooth(mc, mm, M6.pitch, -LOCK.stud + mf, -mf, 0)]) as Shape));
const tapped = onKnob(helixTooth(mm + PLAY, mc + PLAY, M6.pitch, -LOCK.hole + 1 + mf, -0.5 - mf, M6.pitch / 2));
const drilled = own(unwrap(cut(housing, own(cylinder(mm + PLAY, LOCK.hole + 1, { at: [0, hr - LOCK.hole, -60], axis: [0, 1, 0] }))))) as Shape;
const flange = lathe([[0, HOUSING.bottom - 5], [hr + 3, HOUSING.bottom - 5], [hr + 3, HOUSING.bottom - 1.5], [hr + 1.5, HOUSING.bottom], [0, HOUSING.bottom]]);
// Mass of the plate set from the kernel volumes.
const grams = volume(plate) * DENSITY.aluminium + (volume(screw) + volume(ring)) * DENSITY.steel + volume(pad) * DENSITY.rubber;
// Release: the lever opens, the plate moves off the fixed jaw, then it lifts out.
const out: P3 = [-(FLANK.inset + 0.7) * stage(0.4, 0.55), 0, 26 * stage(0.55, 1)];
// The clamp side tilts about the centre of the ball. Then the model turns so that the lever faces +X.
const posed = (shapes: Shape[], v: P3 = [0, 0, 0]): Shape => rotate(own(rotate(own(translate(own(compound(shapes)), v)), lean, { axis: [0, 1, 0], at: [0, 0, BALL.centre] })), 180) as Shape;
const still = (shapes: Shape[]): Shape => rotate(own(compound(shapes)), 180) as Shape;
return {
plate: posed([plate], out),
pad: posed([pad], out),
screw: posed([screw, ring], out),
bush: posed(bush, out),
body: posed([body]),
lever: posed([swung]),
brass: posed([pin, catchPin]),
ball: posed([ball]),
housing: still([drilled, tapped, flange]),
lock: still([...lock, stud]),
grams,
};
}
const part = freeing(() => quickRelease());
console.log('Plate with screw and pad: ' + part.grams.toFixed(1) + ' g from the kernel volumes. The catalogue has ' + CATALOGUE_G + ' g.');
export default [
color(part.plate, '#12b5b0'),
color(part.pad, '#2b3138'),
color(part.screw, '#c3c9d1'),
color(part.bush, '#d3a956'),
color(part.body, '#8d96a1'),
color(part.lever, '#ff5a1f'),
color(part.brass, '#d3a956'),
color(part.ball, '#f5f2ea'),
color(part.housing, '#8d96a1'),
color(part.lock, '#48515c'),
];Functions used
box compound cut cutAll cylinder edgeFinder extrude fillet fuseAll line loft measureVolume polygon revolve rotate sphere torus translate unwrap wire color