← All tutorials · Kerfwise

Tutorial 15 of 16

Parametric sketches and model parameters

Intermediate 10 min

Build a profile from lines and arcs with constraints, drive its dimensions by named parameters, read the degrees of freedom and change the whole model by editing one value.

Footprints in Form Studio are fixed lists of points. A parametric sketch describes the outline by rules instead: this edge is horizontal, this arc touches both edges, the width is W. Kerfwise solves the rules, extrudes the closed outline and re-solves it when a parameter changes. The solver is the same engine as the kerfwise-sketch-constraint-solver tool.

1. Start a sketch

Open Form Studio, choose New form and leave the selection empty. In the Properties panel, choose New parametric sketch. The editor opens with three parts: Parameters at the top, Sketch below and Solution on the side with a drawing and a status line.

Under Starter sketch, pick Panel with a rounded corner and choose Load starter. The parameters W = 600, D = 400, R = 100 and T = 19 are added. The status line reads The sketch is fully constrained: every point is defined. Below it you see 10 variables, 10 equations, Jacobian rank 10, 0 degrees of freedom.

2. Read the drawing and the tables

In the drawing, p1 is a square because it is fixed. The other points are filled green circles, which means the constraints define them. A point that can still move is drawn as an open orange circle and listed as Free in the Points table.

The Lines, arcs and circles table lists each element with its points. The arc round has the points c, p3, p4: centre, start and end. Arcs always run counter-clockwise from start to end. Construction keeps helper geometry out of the outline.

The Constraints table shows each rule with its elements, its value or expression and its state. t1 and t2 make the arc tangent to the right and top edges, and fillet sets its radius to R.

3. Change a dimension

In Parameters, change the expression of R to 150. The drawing updates while you type, and the arc centre moves to (450, 250). Expressions may use the parameters above them: write D as W / 2 and the depth follows the width.

Type a name in Solid name, for example Rounded panel, and choose Add sketch solid. The solid appears with the evaluated Extrusion height T = 19 mm.

4. Find redundant and conflicting rules

Select the solid and choose Edit sketch. Choose Add constraint, set the type to Horizontal distance, the elements to p1, p2 and the value to W - 1. The status line turns red: These constraints contradict each other: c1, width. Remove or change one of them. Both rules ask for a different width. Update sketch solid now refuses with Resolve the conflicting constraints before applying the sketch. Choose Delete in the row of c1 and the sketch is fully constrained again.

A rule that only repeats another one, such as a second width of exactly W, is reported as Redundant. The sketch still solves.

5. Change the whole model

With the solid selected, choose Model parameters. Set W to 900 and T to W / 50, then choose Apply parameters. The message Parameters applied: 1 sketch solid updated. appears, and the panel is now 900 × 400 × 18 mm. Every sketch solid in the model uses the same table, so one change updates them all. Undo reverts it in one step.

If a sketch cannot be solved with the new values, it keeps its old shape and the dialog names it.

Good to know

  • Coordinates are millimetres with Y up, even when the form uses inches.
  • Fix one point and make one line horizontal or vertical first. That removes the three freedoms of moving and turning the whole sketch.
  • Editing Footprint points directly turns the solid back into a plain footprint and removes its sketch. Mirror solids creates copies without a sketch.
  • Sketches are saved in the form file and in the project the solver tool returns, so the API and the app share them.

Ready to try it?

Launch Kerfwise →