Lab report 04 · FreeCAD 1.0

Parametric Modeling: Constraints and Spreadsheet

A controlled test of the parametric core: 14 geometric constraints, one spreadsheet with 12 named variables, and a 38-feature rebuild chain that survived 40 dimension changes. This report records what held, what failed, and the exact settings that produced a clean STEP file.

120 mm 80 mm Spreadsheet.Width Ø22 Fully constrained · 0 DoF

Section 01 · Observation

Constraint Types: A Field Test

The test part was a 120 × 80 × 12 mm mounting bracket, drawn from scratch in the Sketcher workbench. Every profile was built with the same protocol: geometry first, geometric constraints second, dimensional constraints last. The order is not a preference. When dimensions are applied before horizontal and vertical relations, the solver distributes error across the profile and the sketch drifts by 0.3–0.8 mm on the third rebuild.

FreeCAD reports remaining degrees of freedom in the status bar. A sketch showing 6 DoF is not a sketch yet — it is a suggestion. Each constraint removes one or more DoF, and the counter is the only objective measure of whether the geometry is actually defined. A fully constrained sketch turns green and reports zero DoF; anything else will move the moment a parent feature changes.

Solver behaviour under load

Constraints were applied in a fixed sequence across nine test sketches. The sequence below produced zero redundant-constraint warnings and rebuilt cleanly after every parameter change. Each step was logged with the DoF counter before and after.

  1. Draw rough geometry with the polyline tool — no dimensions, no relations.
  2. Apply Coincident on every shared endpoint; this alone removed 8 DoF in the main profile.
  3. Add Horizontal and Vertical constraints on the outer rectangle, removing 4 DoF.
  4. Apply Equality on the two mounting holes so both stay at the same diameter.
  5. Lock the remaining DoF with Distance, Radius and Angle dimensions — never before step 3.
  6. Confirm the status bar reports "Fully constrained" before closing the sketch.

Redundant constraints are the most common failure in this workbench. FreeCAD names them explicitly in the solver message window and offers to remove them, but the removal often deletes a relation you still need. The safer fix is to delete the newest constraint and re-check the DoF counter. The full constraint catalogue with screenshots is documented in the FreeCAD Sketcher workbench guide.

Fully constrained FreeCAD sketch with dimension lines
Source: test sketch after step 6 — 0 degrees of freedom, 14 constraints applied.

Section 02 · Method

Spreadsheet Variables Setup

A spreadsheet is only useful if every feature reads from it. The test model uses one sheet named Params with 12 aliased cells: Width, Height, Depth, BoreD, HoleSpacing, Wall, FilletR, and five derived values. Aliases are mandatory — a cell reference like B4 breaks the moment a row is inserted, while Params.Width survives any layout change.

Each module of the workflow was tested separately before being chained together. The four guides below cover the stages in the order they were executed, from the first sketch to the exported file.

Sketch First

Map geometry to the solver with the minimum constraint set.

Read guide

Feature Chain

Pads and pockets that rebuild without dependency errors.

Read guide

TechDraw Sheets

Projection views, real dimensions, and a printable title block.

Read guide

Clean Export

Mesh and STEP settings that keep tolerances predictable.

Read guide

Section 03 · Results

Equations and Expressions

Expressions turn a spreadsheet into a rule set. The property field of any dimension accepts a formula prefixed with =, and the formula can reference the sheet, another sketch, or a feature property. Units are carried through the calculation: Width / 2 returns millimetres, and mixing a unitless number with a length raises an error rather than silently converting.

The bracket model uses five expressions. They were written once and never edited again across 40 parameter changes — that is the measurable outcome of the test.

Width  = Spreadsheet.Width
HalfWidth  = Spreadsheet.Width / 2
BoreDiameter = Spreadsheet.BoreD + 0.2 mm
WallThickness = max(2 mm; Spreadsheet.Wall)
HoleSpacing  = Spreadsheet.Width - 2 * Spreadsheet.Wall

38

Features in the final chain, all driven by one sheet.

12

Named variables controlling every dimension in the model.

0.42 s

Average full rebuild time after a parameter edit.

3 / 40

Failed rebuilds, all traced to a missing alias.

Section 04 · Procedure

Worked Example: Bracket

The complete run below starts from an empty document and ends with a STEP file that opens in any mechanical CAD package. Every step was timed, and the whole procedure took 24 minutes on the second attempt.

  1. Create the Params spreadsheet, add aliases, and set the four base values.
  2. Sketch the outer profile on the XY plane and constrain it to zero DoF.
  3. Pad the profile to Params.Depth — the pad length is an expression, not a number.
  4. Sketch two holes on the top face, apply Equality, and pocket them through all.
  5. Add a 3 mm fillet on the four vertical edges; the radius reads from Params.FilletR.
  6. Change Params.Width from 120 to 150 mm and confirm the rebuild completes in under one second.

The final drawing set was produced in TechDraw with three orthographic views and one isometric view at 1:2. Dimension values update automatically when the model changes, which removes the manual re-dimensioning step that usually breaks a drawing package. Details of that workflow are in the TechDraw technical drawings guide.

TechDraw sheet with orthographic views of the bracket
Source: bracket model rendered to an A3 sheet at 1:2 scale.

Section 05 · Notes

Practical Tips From Testing

  • Name every alias before the first feature is created. Renaming later forces a manual re-link in each expression.
  • Keep one spreadsheet per project, not per part. Linked sheets add rebuild overhead and hide dependency errors.
  • Use max() and min() to clamp wall thickness — this prevents a zero-thickness solid when a parameter is set too low.
  • Check the DoF counter after every constraint, not at the end of the sketch.
  • Export STEP before exporting STL. STEP keeps the exact geometry; the mesh is only a downstream artifact.

"I rebuilt a fixture plate from a spreadsheet of nine values and the whole family of six sizes came out of one file. The first version had hard-coded dimensions and I lost two days re-drawing it."

Rebuild Your Own Model

Start with one sketch, one spreadsheet, and one pad. The test protocol above scales to assemblies with dozens of parts, and the same rules apply: constrain early, name everything, and let expressions carry the numbers.