Skip to main content

Slot

A stadium — two parallel lines closed by two semicircular caps — in one gesture: adjustment slots, keyways, open notches. The tool writes two lines and two arcs with the constraints of a slot, so the length, the width and the position all stay editable.

In the viewport

  1. Click Slot on the sketch toolbar. The button opens a menu with one toggle, Centered: anchor the slot at its midpoint instead of at its first cap centre.
  2. Click the first cap centre (or the midpoint, with Centered on). The X / Y pill places it exactly; a click that snaps onto a vertex or the origin gets a constraint written for it.
  3. Move in the direction of the slot. A drag close to the horizontal or the vertical snaps onto the axis; hold Ctrl to keep the exact angle. Click the second cap centre — or type the D centre distance and press Enter.
  4. The pill switches to R. Move to set the cap radius and click, or type it and press Enter.

Typed values become dimensions: the length is a distance between the two cap centres, the width a radius on the first cap. Clicked values stay guesses.

A 40 mm slot, R8, from the origin along the X axis

The code behind it
bracket.part.js
import { sketch, line, arc, origin, xAxis } from 'fluidcad/core';
import { coincident, tangent, equal, distance, radius } from 'fluidcad/constraints';

sketch("xy", () => {
// One Slot gesture: the first cap centre clicked on the origin, the
// mouse dragged along the X axis, 40 typed for the centre distance
// and 8 for the radius. Two lines and two half-circle caps,
// counter-clockwise from the lower line.
const lower = line([0, -8], [40, -8]);
const right = arc([40, -8], [40, 8], [40, 0]);
const upper = line([40, 8], [0, 8]);
const left = arc([0, 8], [0, -8], [0, 0]);
// Closed and smooth at all four junctions.
coincident(lower.end(), right.start());
coincident(right.end(), upper.start());
coincident(upper.end(), left.start());
coincident(left.end(), lower.start());
tangent(lower, right);
tangent(right, upper);
tangent(upper, left);
tangent(left, lower);
// Both caps share one radius; the first arc drawn carries it.
equal(right, left);
// The typed length is the distance between the two cap centres.
distance(left.center(), right.center(), 40);
radius(right, 8);
// The anchor snapped onto the origin, and the second cap centre onto
// the X axis while dragging: those two snaps fix where the slot sits
// and which way it points.
coincident(left.center(), origin());
coincident(right.center(), xAxis());
})

What the tool writes: two lines and two half-circle arcs, coincident and tangent at each of the four junctions, and equal across the two caps. The parallel sides follow from the tangents, so no parallel is needed.

The axis snap is not a constraint

Snapping the drag onto the horizontal only draws the slot straight. Its orientation stays a free degree of freedom unless a cap centre snapped onto something — in the example both did, the origin and the X axis, which is what holds it. Otherwise select a side and click Horizontal or Vertical, or dimension both cap centres.

Centered

With Centered on, the first click is the slot's midpoint and the caps grow out in both directions. No vertex sits on the midpoint, so a snapped anchor is written as a midpoint between the two cap centres rather than a coincident:

A 50 mm slot centred on the origin

The code behind it
bracket.part.js
import { sketch, line, arc, origin } from 'fluidcad/core';
import { coincident, tangent, equal, distance, radius, midpoint, horizontal } from 'fluidcad/constraints';

sketch("xy", () => {
// Centered: the click on the origin is the slot's midpoint, and the
// caps grow out both ways. 50 typed for the centre distance, 6 for the
// radius.
const lower = line([-25, -6], [25, -6]);
const right = arc([25, -6], [25, 6], [25, 0]);
const upper = line([25, 6], [-25, 6]);
const left = arc([-25, 6], [-25, -6], [-25, 0]);
coincident(lower.end(), right.start());
coincident(right.end(), upper.start());
coincident(upper.end(), left.start());
coincident(left.end(), lower.start());
tangent(lower, right);
tangent(right, upper);
tangent(upper, left);
tangent(left, lower);
equal(right, left);
distance(left.center(), right.center(), 50);
radius(right, 6);
// No slot vertex sits on the centre, so the snapped origin is written
// as the midpoint between the two cap centres.
midpoint(origin(), left.center(), right.center());
// The gesture snapped to the axis, but a snap is not a constraint: the
// slot could still turn about its centre. Horizontal on a side ends that.
horizontal(lower);
})

By hand

There is no slot() statement. Write the two lines and two arcs from the example with their coincidents, tangents and the equal on the caps; dimension the distance between the cap centres for the length and a radius on one cap for the width. Position it through the cap centres — coincident(left.center(), origin()), or a distance from a sketch axis — and orient it with horizontal / vertical on a side.

A slot cut through material is the usual way to make an open notch: let one cap hang outside the part and the cut leaves the mouth open. The upper alignment clamp tutorial does exactly that.