FreeCAD Assembly Tutorial: Make a Hook Slide onto a Rail
▶ Watch on YouTube & subscribe to The Stack Underflow
Two parts that should slide need a gap between them. With no gap they touch; with a typo they overlap and jam. In FreeCAD 1.1.4 an assembly shows how parts move, but its Assembly workbench has no interference or clearance tool: a hook that overlaps the rail still slides straight back on, with no message. So you check the fit yourself, with two numbers: the shared volume (Intersection) and the measured gap (Measure).
The one-line version: write the slot as rib + 2 x gap, then check that Intersection says 0 and Measure reads the gap on both sides.
Last verified in our lab: 14 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
- Component: a part placed in an assembly.
- Grounded: fixed in place, so the other parts move relative to it.
- Slider joint: lets a part move along one direction only.
- Intersection: a new solid made of the space two parts share (FreeCAD names it Common). Its volume should be 0.
- Touching is not a fit: a gap of 0 shares no volume, but a printed part needs room to move.
The parts
A hook’s T-slot on a rail’s T-rib. The slot was typed 11.6 against a 12 mm rib, so the two parts share 72.0 mm³.
By hand (FreeCAD 1.1.4)
- Assembly workbench: New Assembly, Insert Component, the rail and the hook (ground the first part? No).
- Hide the originals (Space). Select Rail001, Toggle Grounded.
- Slider Joint: click Rail001 in the tree, Ctrl-click Hook001, OK.
- Drag the hook up off the rail and back down: nothing stops it.
- Part workbench: the hook body, Ctrl-click the rail body, Intersection (the result is named Common).
- With Common selected: Check Geometry, tick Expand shape content, Run check, open Shape Content: Volume 72.0.
- Spreadsheet:
slot = rib + 2 x gap. Gap 0 gives slot 12: Intersection volume 0.0, no warning. Touching, not a fit. - Gap 0.4, Recompute: slots 6.8 and 12.8 (the rib stays 6 and 12).
- Bottom view, Measure: the slot’s wall edge, then Ctrl-click the rib’s edge facing it: 0.40 mm. The other side: 0.40 mm.
What we measured
| Slot | Shared volume | Gap each side |
|---|---|---|
| Typo, 11.6 | 72.0 mm³ (2 solids); 72.0 again after the drag | 0.2 mm too tight (by code) |
| Gap 0, slot 12 | 0.0, no warning | 0.0 (by code) |
| Gap 0.4, slot 12.8 | 0; still 0 after dragging up the whole rail and back (by code) | Measure 0.40 mm, both sides filmed |
Why leave a gap: Prusa’s guide says “An initial good measurement for movable parts is at least 0.3 mm.” Holes print a little smaller, and the first layer prints a little wider. Exporting both parts for printing is lesson 5. We printed nothing.
Then with Claude
Two runs over freecad-mcp, both given the gap-0 file:
- Run 1, “make this hook slide onto this rail as an assembly”: without being asked, it checked the shared space (0.0) and wrote “No interference, so the rib fits the T-slot exactly”. It made the assembly and grounded the rail; its slider script hit an error and our cost guard (a spending cap per run) stopped the run. Our check: 0.0 shared, 0.0 + 0.0 mm, and a slider attached to neither part.
- Run 2, plus “leave 0.4 mm each side, check for interference, measure both sides”: it set the gap to 0.4 and read the slot widths 6.8 / 12.8. Our cost guard stopped it while it read the Assembly code: no assembly, no joint, no overlap check, no per-side numbers. Our check: 0.4 + 0.4 mm, 0 shared. Not scored, not re-run.
Run 1’s “fits exactly” is the trap this lesson is about: 0 shared volume means touching, not a gap.
Your turn, no AI
Build the hook and rail with the slot written as rib + 2 x gap and the gap at 0. Run Intersection and read the volume. Then set the gap to 0.4 and measure both sides. Why can’t the gap-0 hook slide onto a printed rail?
The course
- Previous: Lesson 7: fixes for Claude connection errors · the hook from lesson 6
- Start of the course: Lesson 1: connect Claude to FreeCAD
- The same hook and rail in SolidCraft: SolidCraft course, lesson 8
- The lab for this lesson: freecad-course-lab/out/fc8
Sources
Read 14 November 2026:
- FreeCAD wiki: Assembly Workbench: introduced in FreeCAD 1.0
- Prusa: Modeling with 3D printing in mind: “at least 0.3 mm” for movable parts
- Bambu Lab wiki: X-Y hole contour compensation: holes print smaller
- Prusa: Elephant foot compensation: the first layer prints wider
- The lab: scripts, logs and every measurement above
Change notes
- 16 Nov 2026: first published, from the lesson’s lab results of 14 Nov 2026.
Not affiliated with or endorsed by the FreeCAD project, the freecad-mcp project, Prusa Research, Bambu Lab 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.