KufCad

Exercise: a rectangle with parametric size

This exercise builds a rectangle whose height is always half its width, then changes the width.

A rectangle
Figure 10.28 — Draw any rectangle with the RECTANGLE command.
  1. Draw a rectangle (REC).
  2. Keep the sides horizontal / vertical: GCHORIZONTAL on the bottom side, GCHORIZONTAL on the top side, GCVERTICAL on the left side, GCVERTICAL on the right side. The rectangle becomes a closed polyline when the first constraint is applied.
Rectangle with geometric constraints
Figure 10.29 — The four icons H H V V show that the sides are held horizontal / vertical.
  1. DCLINEAR, click the two ends of the bottom side, place the dimension, type w=100.
  2. DCLINEAR again on the right side, type h=w/2.
Rectangle with two dimensions
Figure 10.30 — Width w = 100, height h = w/2.
  1. Open the Parameters Manager (PARAMETERS): you see w = 100 and h = w/2 (value 50).
  2. Change w and h follows. The figure shows the result created with w=140: h becomes 70 by itself.
Rectangle after changing the width
Figure 10.31 — The same rectangle with w = 140: h = w/2 is recomputed.