FreeCAD Linear Pattern Tutorial: Space Copies Evenly

November 17, 2026 · FreeCAD + Claude Course (part 9)

▶ Watch on YouTube & subscribe to The Stack Underflow

Five hooks on a 180 mm strip should leave 20 mm at both ends. We typed 180, the strip’s width, in LinearPattern’s Length box. The fifth hook landed 20 mm past the end, floating in mid-air, and FreeCAD only warned. In Extent mode, Length runs from the start of the first hook to the start of the last: 180 - 20 - 20 - 20 = 120.

The one-line version: Length = strip - 2 x margin - 1 hook, written as a formula on the spreadsheet names, then measure both ends.

Last verified in our lab: 16 November 2026 (FreeCAD 1.1.4; freecad-mcp 0.1.28; Claude Code 2.1.308 with Claude Sonnet 5.5; Linux in Docker).

The words first

  • LinearPattern: repeats a feature along a direction (Part Design workbench).
  • Occurrences: how many copies in total; it counts the first hook too.
  • Extent mode: Length is the distance from the first copy’s start to the last copy’s start. (LinearPattern also has a Spacing mode, where you type the step.)

By hand (FreeCAD 1.1.4)

Start file (one hook, Params 180 / 5): rack-start.FCStd

  1. Params (spreadsheet): rack_width 180, width 20, margin 20, hooks 5. Measure: the strip’s end edge, Ctrl-click the hook’s outer edge: 20.00 mm.
  2. Select the Hook, Part Design, LinearPattern.
  3. Direction: Base X-axis (the default, Horizontal sketch axis, sends copies out from the strip).
  4. Occurrences 5 (it counts the first hook too). Mode: keep Extent.
  5. Length = strip - 2 margins - 1 hook = 120. OK.
  6. Better: type = in Length and use a formula: Params.rack_width - 2 * Params.margin - Params.width. Occurrences: Params.hooks.

What we measured

SetupHooks start atLeft endRight endResult
Length 180, 5 occurrences20, 65, 110, 155, 200 (4 steps of 45)20.00 mmfifth hook floats 20.00 mm past the end (Measure); hook 4 to the end only 5.00 mm2 solids
Length 120-20.00 mm (Measure)20.0 (by code)one solid, 96,500 mm³, 10 mm of air between hooks
Formula, strip 220, 6 hooksLength 16020.00 (Measure)20.0 (by code)a typed 120 there leaves 60 at the right end (by code)

FreeCAD’s only warning for the floating hook: “One transformed shape does not intersect the support (3 times)”. With the Body’s Allow Compound set to false, FreeCAD drops the copy instead (4 hooks), checked by code. “By code” is a script that reads the model. Exporting for printing is lesson 5; we printed nothing.

Then with Claude

Claude Code, freecad-mcp only; one run each, not a general result (amounts are Claude Code’s /cost):

  • Run 1, one sentence, “five hooks spread evenly across the 180 millimetre strip” ($0.15): a LinearPattern with Length and Occurrences bound to Params, the same formula. It kept the 20 mm margin without being asked and offered equal 13.3 mm gaps as another option. Our check by code: 5 hooks, 20.0 / 20.0, one solid.
  • Run 2, plus “keep 20 mm at each end, use a pattern, measure both ends” ($0.20): the same build. It reported 20.0 / 20.0, worked out in code, not with the Measure tool. Ours agree.

Neither run saved the file.

Your turn, no AI

Open the start file, set the strip to 220 and hooks to 6. What Length gives 20 mm at both ends? Type it, then measure both ends.

The course

Sources

  • The lab: scripts, logs, tests and every measurement above

Change notes

  • 20 Nov 2026: first published, from the lesson’s lab results of 15-16 Nov 2026.

Not affiliated with or endorsed by the FreeCAD project, the freecad-mcp project or Anthropic. Found a mistake? Tell us in the video’s comments and we’ll correct this page.

Found this useful? The deep version lives on YouTube — new breakdowns of how AI dev tools actually work, weekly.

Subscribe on YouTube →

Prefer email? Get the free newsletter: one failure, traced step by step, about once a week.