Skip to content

Linear Bearing Pillow Block (cutaway) ​

Linear Bearing Pillow Block (cutaway), rendered in the brepjs playground
Mechanical · 209 lines▶ Run it in the playground

A pillow block of the 8 mm class with its linear ball bushing on a shaft, in cutaway. The block and the bushing dimensions, the four ball rows, the mass and the M3 and M4 threads are published figures. The M3 cap screws are true helical screws in the tapped holes of the plate. The kernel measures the mass of the unit and of the bushing from the volumes. The ball circuits, the retainer, the seals, the snap rings and the plate are a display model.

Code ​

This is the full program. The playground runs it in your browser without a change.

ts
import { compound, cut, cutAll, cylinder, extrude, face, getBounds, line, loft, measureVolume, polygon, revolve, rotate, sphere, threePointArc, translate, unwrap, wire } from 'brepjs/quick';
import { color } from 'brepjs/playground';

// Linear-bearing pillow block of the 8 mm class on its shaft, in cutaway. The units are millimetres.
// The block and the bushing dimensions, the four ball rows, the mass and the M3 and M4 threads are published figures.
// The ball circuits, the retainer, the seals, the snap rings and the plate are a display model.
interface BlockParams {
  cutaway?: number; // degrees of the block and the bushing sleeve to cut away, 0 to 200 (0 = closed unit)
  travel?: number; // position of the block along the shaft, -20 to 20
  seals?: boolean; // false makes an open bushing
}

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 BLOCK = { height: 22, width: 34, length: 30, body: 32, shoulder: 18, flange: 6, radius: 11, centre: 11 };
const HOLES = { across: 24, along: 18, tap: 4, tapDepth: 8, bolt: 3 }; // M4 taps, or M3 bolts through them
const BUSHING = { bore: 8, outside: 15, length: 24, grooveSpan: 17.5, grooveWidth: 1.1, grooveDiameter: 14.3, rows: 4 };
const CATALOGUE_G = { unit: 52, bushing: 13.5 };
const DENSITY = { aluminium: 2.7e-3, steel: 7.81e-3, resin: 1.41e-3, rubber: 1.2e-3 }; // grams per cubic millimetre
const CAP_SCREW = { head: 5.5, headHeight: 3, socket: 2.5, length: 25, thread: 18 }; // M3 x 25 socket head cap screw
const M3 = { major: 3, minor: 2.459, pitch: 0.5 }; // metric coarse thread
const M4 = { major: 4, minor: 3.242, pitch: 0.7 };

// ---- display model
const BALL = 1.588; // ball diameter
const TRACK = { height: 4.6, turn: 1.15, pitch: 1.6, count: 9, slack: 0.1 }; // each circuit lies in a flat plane beside the shaft
const SLEEVE = { relief: 6.7, rib: 9 }; // relief radius, and half angle of each raceway rib in degrees
const RETAINER = { inner: 4.15, outer: 5.5, half: 10.4 };
const RING = { groove: 7.85, inner: 6.3, width: 1 };
const PLATE = { width: 50, length: 46, height: 5 };
const SHAFT = 80;
const PLAY = 0.08; // radial play between a screw thread and its tapped hole

const Z: P3 = [0, 0, 1];
const lathe = (pts: P2[], angle = 2 * Math.PI): Shape => {
  const profile = own(unwrap(polygon(pts.map(([r, z]): P3 => [r, 0, z]))));
  return unwrap(revolve(profile, { axis: Z, angle })) as Shape;
};
// A closed loop of arcs [from, via, to] and lines [from, to].
const loop = (parts: P3[][]) => own(unwrap(wire(parts.map((p) => own(p.length === 3 ? threePointArc(p[0]!, p[1]!, p[2]!) : line(p[0]!, p[1]!))))));
const turnZ = (s: Shape, degrees: number): Shape => own(rotate(s, degrees, { axis: Z }) as Shape);
const volume = (shapes: Shape[]): number => shapes.reduce((sum, s) => sum + unwrap(measureVolume(s)), 0);

// 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 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): [number, number, number] => [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;
};

// The unit is built with the shaft on Z and the mounting face at y = -centre. The last lines lay it down.
function unit({ cutaway: asked = 90, travel = 0, seals = true }: BlockParams = {}) {
  const cutaway = Math.min(200, Math.max(0, asked));
  const rs = BUSHING.bore / 2;
  const ro = BUSHING.outside / 2;
  const half = BUSHING.length / 2;
  const rb = BALL / 2;
  const load = rs + rb; // a loaded ball touches the shaft
  const t1 = Math.sqrt(load * load - TRACK.height * TRACK.height);
  const t2 = t1 + 2 * TRACK.turn;
  const run = ((TRACK.count - 1) * TRACK.pitch) / 2;
  const first = 45 - (Math.atan2((t1 + t2) / 2, TRACK.height) * 180) / Math.PI; // a whole circuit shows in the cutaway
  const quarter = [0, 1, 2, 3].map((k) => first + (360 * k) / BUSHING.rows);

  // Balls of one circuit: a loaded row, a return row farther from the shaft, and one ball in each turn.
  const row = Array.from({ length: TRACK.count }, (_, i) => -run + i * TRACK.pitch);
  const centres: P3[] = [...row.map((z): P3 => [TRACK.height, t1, z]), ...row.map((z): P3 => [TRACK.height, t2, z])];
  centres.push([TRACK.height, t1 + TRACK.turn, run + TRACK.turn], [TRACK.height, t1 + TRACK.turn, -run - TRACK.turn]);
  const circuit = own(compound(centres.map((at) => own(sphere(rb, { at })))) as Shape);
  const balls = quarter.map((deg) => turnZ(circuit, deg));

  // Retainer: a resin tube. One racetrack channel for each circuit opens to the shaft under the loaded row.
  const w = rb + TRACK.slack;
  const floor = TRACK.height - w;
  const tm = t1 + TRACK.turn;
  const track = (r: number): P3[][] => [
    [[floor, tm - r, -run], [floor, tm - r, run]],
    [[floor, tm - r, run], [floor, tm, run + r], [floor, tm + r, run]],
    [[floor, tm + r, run], [floor, tm + r, -run]],
    [[floor, tm + r, -run], [floor, tm, -run - r], [floor, tm - r, -run]],
  ];
  const channel = own(unwrap(extrude(own(unwrap(face(loop(track(TRACK.turn + w)) as never, [loop(track(TRACK.turn - w)) as never]))), [ro - floor, 0, 0])) as Shape);
  const tube = own(lathe([[RETAINER.inner, -RETAINER.half], [RETAINER.outer, -RETAINER.half], [RETAINER.outer, RETAINER.half], [RETAINER.inner, RETAINER.half]]));
  const retainer = unwrap(cutAll(tube, quarter.map((deg) => turnZ(channel, deg)))) as Shape;

  // Sleeve: two outside grooves, a raceway rib over each loaded row, and relief everywhere else.
  const g1 = BUSHING.grooveSpan / 2;
  const g0 = g1 - BUSHING.grooveWidth;
  const rg = BUSHING.grooveDiameter / 2;
  const blank = own(lathe([
    [load + rb, -run], [SLEEVE.relief, -run], [SLEEVE.relief, -half], [ro - 0.3, -half], [ro, -half + 0.3], [ro, -g1], [rg, -g1], [rg, -g0], [ro, -g0],
    [ro, g0], [rg, g0], [rg, g1], [ro, g1], [ro, half - 0.3], [ro - 0.3, half], [SLEEVE.relief, half], [SLEEVE.relief, run], [load + rb, run],
  ]));
  const ribAt = (Math.atan2(t1, TRACK.height) * 180) / Math.PI;
  const gap = 360 / BUSHING.rows - 2 * SLEEVE.rib;
  const relief = own(lathe([[RETAINER.outer - 0.05, -run - 0.2], [SLEEVE.relief, -run - 0.2], [SLEEVE.relief, run + 0.2], [RETAINER.outer - 0.05, run + 0.2]], (gap * Math.PI) / 180));
  const sleeve = own(unwrap(cutAll(blank, quarter.map((deg) => turnZ(relief, deg + ribAt + SLEEVE.rib)))) as Shape);

  // Seals and snap rings at both ends.
  const lip: P2[] = [[SLEEVE.relief, 10.6], [SLEEVE.relief, 11.8], [5, 11.8], [rs, 11.2], [rs, 10.9], [5, 10.6]];
  const rubber = (seals ? [1, -1] : []).map((side) => own(lathe(lip.map(([r, z]): P2 => [r, side * z]))));
  const snap = [1, -1].map((side) => {
    const [a, b] = [side * half, side * (half + RING.width)];
    return turnZ(own(lathe([[RING.inner, a], [RING.groove, a], [RING.groove, b], [RING.inner, b]], (320 * Math.PI) / 180)), -70);
  });

  // Block: an extruded section, then the bore with two ring grooves and four mounting holes in one cut.
  const [hw, hb, hl] = [BLOCK.width / 2, BLOCK.body / 2, BLOCK.length / 2];
  const base = -BLOCK.centre;
  const shoulder = BLOCK.shoulder - BLOCK.centre;
  const sx = Math.sqrt(BLOCK.radius * BLOCK.radius - shoulder * shoulder);
  const section: P2[][] = [
    [[-hw, base], [hw, base]], [[hw, base], [hw, base + BLOCK.flange]], [[hw, base + BLOCK.flange], [hb, base + BLOCK.flange]], [[hb, base + BLOCK.flange], [hb, shoulder]],
    [[hb, shoulder], [sx, shoulder]], [[sx, shoulder], [0, BLOCK.radius], [-sx, shoulder]], [[-sx, shoulder], [-hb, shoulder]],
    [[-hb, shoulder], [-hb, base + BLOCK.flange]], [[-hb, base + BLOCK.flange], [-hw, base + BLOCK.flange]], [[-hw, base + BLOCK.flange], [-hw, base]],
  ];
  const prism = own(unwrap(extrude(own(unwrap(face(loop(section.map((p) => p.map(([x, y]): P3 => [x, y, -hl]))) as never))), [0, 0, BLOCK.length])) as Shape);
  const e = half + RING.width;
  const bore = own(lathe([[0, -hl - 1], [ro, -hl - 1], [ro, -e], [RING.groove, -e], [RING.groove, -half], [ro, -half], [ro, half], [RING.groove, half], [RING.groove, e], [ro, e], [ro, hl + 1], [0, hl + 1]]));
  const spots = [1, -1].flatMap((sx2) => [1, -1].map((sz): P2 => [(sx2 * HOLES.across) / 2, (sz * HOLES.along) / 2]));
  const up: P3 = [0, 1, 0];
  const drills = spots.flatMap(([x, z]) => [
    own(cylinder(HOLES.bolt / 2 + 0.2, BLOCK.shoulder + 2, { at: [x, base - 1, z], axis: up })),
    own(cylinder(HOLES.tap / 2, HOLES.tapDepth + 1, { at: [x, base - 1, z], axis: up })),
  ]);
  const block = own(unwrap(cutAll(prism, [bore, ...drills])) as Shape);

  // Four cap screws go through the block into tapped holes in the plate. Each thread is one helical tooth.
  const hex = Array.from({ length: 6 }, (_, i): P3 => [(CAP_SCREW.socket / Math.sqrt(3)) * Math.cos((i * Math.PI) / 3), (CAP_SCREW.socket / Math.sqrt(3)) * Math.sin((i * Math.PI) / 3), CAP_SCREW.headHeight - 1.6]);
  const [rc, rm, end, plain] = [M3.minor / 2, M3.major / 2, -CAP_SCREW.length, CAP_SCREW.thread - CAP_SCREW.length];
  const stud = own(lathe([[0, end], [rc - 0.2, end], [rc, end + 0.2], [rc, plain], [rm, plain], [rm, 0], [CAP_SCREW.head / 2, 0], [CAP_SCREW.head / 2, CAP_SCREW.headHeight - 0.3], [CAP_SCREW.head / 2 - 0.3, CAP_SCREW.headHeight], [0, CAP_SCREW.headHeight]]));
  const flank = 0.42 * M3.pitch;
  const socketed = own(unwrap(cut(stud, own(unwrap(extrude(own(unwrap(polygon(hex))), [0, 0, 2]))))) as Shape);
  // Screws and hole threads are built on Z with the head seat at z = 0, then stood on the block.
  const stand = (s: Shape): Shape => own(rotate(s, -90, { axis: [1, 0, 0] }) as Shape);
  const atSpots = (s: Shape): Shape[] => spots.map(([x, z]) => own(translate(s, [x, shoulder, z]) as Shape));
  const screws = atSpots(stand(own(compound([socketed, helixTooth(rc, rm, M3.pitch, end + 0.2 + flank, plain - flank, 0)]) as Shape)));
  const seat = -BLOCK.shoulder; // the mounting face, in the frame of a screw
  const plateThread = atSpots(stand(helixTooth(rm + PLAY, rc + PLAY, M3.pitch, seat - PLATE.height + flank, seat - flank, M3.pitch / 2)));
  const tapThread = atSpots(stand(helixTooth(M4.major / 2, M4.minor / 2, M4.pitch, seat + 0.42 * M4.pitch, seat + HOLES.tapDepth - 0.42 * M4.pitch, 0)));
  const corner = 4;
  const [pw, pl] = [PLATE.width / 2, PLATE.length / 2];
  const outline: P3[] = [[-pw + corner, base, -pl], [pw - corner, base, -pl], [pw, base, -pl + corner], [pw, base, pl - corner], [pw - corner, base, pl], [-pw + corner, base, pl], [-pw, base, pl - corner], [-pw, base, -pl + corner]];
  const slab = own(unwrap(extrude(own(unwrap(polygon(outline))), [0, -PLATE.height, 0])) as Shape);
  const plate = unwrap(cutAll(slab, spots.map(([x, z]) => own(cylinder(M3.major / 2 + PLAY, PLATE.height + 2, { at: [x, base - PLATE.height - 1, z], axis: up }))))) as Shape;

  // Mass from the kernel volumes of the whole parts, before the cutaway.
  const bushing = volume([sleeve, ...balls]) * DENSITY.steel + volume([retainer]) * DENSITY.resin + volume(rubber) * DENSITY.rubber;
  const grams = { bushing, unit: bushing + volume([block]) * DENSITY.aluminium + volume(snap) * DENSITY.steel };

  // Cutaway: a wedge about the shaft, centred between the top and the +X side. Screws in the wedge go with it.
  const sweep = (Math.max(cutaway, 1) * Math.PI) / 180;
  const wedge = turnZ(own(lathe([[0, -hl - 2], [40, -hl - 2], [40, hl + 2], [0, hl + 2]], sweep)), 45 - cutaway / 2);
  const open = (s: Shape): Shape => (cutaway > 0 ? own(unwrap(cut(s, wedge)) as Shape) : s);
  const kept = screws.filter((s) => {
    const b = getBounds(s);
    const at = (Math.atan2(shoulder, (b.xMin + b.xMax) / 2) * 180) / Math.PI;
    return Math.abs(at - 45) > cutaway / 2;
  });
  const shaft = own(lathe([[0, -SHAFT / 2], [rs - 0.5, -SHAFT / 2], [rs, -SHAFT / 2 + 0.5], [rs, SHAFT / 2 - 0.5], [rs - 0.5, SHAFT / 2], [0, SHAFT / 2]]));
  const slid = own(translate(shaft, [0, 0, Math.min(20, Math.max(-20, travel))]) as Shape);

  // Lay the shaft along Y, with the plate under the block.
  const lay = (shapes: Shape[]): Shape => rotate(own(compound(shapes)), 90, { axis: [1, 0, 0] }) as Shape;
  return {
    block: lay([open(block), ...(cutaway > 100 ? [open(own(compound(tapThread) as Shape))] : tapThread)]), sleeve: lay([open(sleeve)]), balls: lay(balls), retainer: lay([retainer]), rubber: lay([...rubber.map(open), ...snap.map(open)]),
    screws: lay(kept), plate: lay([plate, ...plateThread]), shaft: lay([slid]), grams,
  };
}

const part = freeing(() => unit());
console.log(
  'Mass: ' + part.grams.unit.toFixed(1) + ' g for the unit from the kernel volumes (catalogue ' + CATALOGUE_G.unit + ' g), of which the bushing is ' +
    part.grams.bushing.toFixed(1) + ' g (catalogue ' + CATALOGUE_G.bushing + ' g).',
);

export default [
  color(part.block, '#f5f2ea'),
  color(part.sleeve, '#a9b1ba'),
  color(part.balls, '#f2f4f7'),
  color(part.retainer, '#12b5b0'),
  color(part.rubber, '#48515c'),
  color(part.screws, '#8d96a0'),
  color(part.plate, '#48515c'),
  color(part.shaft, '#c3c9d1'),
];

Functions used ​

compound cut cutAll cylinder extrude face getBounds line loft measureVolume polygon revolve rotate sphere threePointArc translate unwrap wire color

▶ Run Linear Bearing Pillow Block (cutaway) in the playground

Released under the Apache 2.0 License.