docs / Remove material

Remove material

Cut into a solid: bolt holes, pockets, slots, plain subtraction.

hole() places a bore by position on a named face. You give it where the hole goes and it builds the cutting cylinder for you. u and v are millimetres from the centre of that face.

const plate = box(80, 50, 10);

return plate
  .hole('top', { u: -20, v: 0, diameter: 8, depth: 'through' })
  .hole('top', {
    u: 20,
    v: 0,
    diameter: 6,
    depth: 'through',
    counterbore: { diameter: 12, depth: 4 },
  })
  .finish('aluminium');
JavaScript is off — the listing above is the whole example.

Calls

CallWhat it does
Shape.subtract(...others) => ShapeBoolean difference (this minus others).
ParamRef.subtract(other: number | ParamRef<number>) => ParamRef<number>Build a ParamRef whose value equals this ParamRef minus other.
Shape.hole(face: FaceSelector | string, opts: { u, v, diameter, depth?: number | "through", upToFace?: FaceRef, counterbore?: { diameter, depth }, countersink?: { diameter, angleDeg? } }) => ShapeDrill a single hole.
Shape.holes(face: FaceSelector | string, opts: { positions: Array<{u,v}>, diameter, depth?, upToFace?, counterbore?, countersink? }) => ShapeDrill N holes in one feature record.
Shape.cutout(profile: PathBuilder | Sketch, opts: { face: FaceSelector | string, depth?: number | "through", upToFace?: FaceRef, depthMode?: "blind" | "symmetric" }) => ShapeSketch-driven subtractive extrude for irregular shapes hole() can't express (slots, D-shapes, keyhole pockets).