Skip to content
Tutorials Center
My learning

Topics

Lesson 11 of 38 ยท Drawing Commands

Rectangles, Polygons and Regular Shapes in AutoCAD

Use the RECTANG command with dimensions, area, rotation, chamfer, fillet, width and elevation options, and the POLYGON command with inscribed and circumscribed options, with vertex math.

Rectangles and regular polygons (hexagons, octagons) are fast to make and produce one tidy object each. This lesson covers RECTANG and POLYGON, their options, and how the numbers behind them work.

RECTANG

Home > Draw > Rectangle, or REC. The basic form: pick the first corner, then the opposite corner. The result is a closed polyline, one object, not four lines. That matters: you can select it with a single click, offset it as a unit, and read its area from Properties.

The prompt: Specify first corner point or [Chamfer/Elevation/Fillet/Thickness/Width]: and after the first corner: Specify other corner point or [Area/Dimensions/Rotation]:.

Typing exact sizes

The easiest way to make a rectangle of an exact size: after the first corner, type relative coordinates for the other corner: @4000,3000. Or choose Dimensions (D), enter length, width, then click to pick which quadrant the rectangle goes in. Area (A) asks for an area plus either length or width, and calculates the other. Rotation (R) rotates the whole rectangle by an angle you type or pick, before placing.

Corner treatments

  • Chamfer (C) takes two distances and cuts every corner.
  • Fillet (F) takes a radius and rounds every corner.
  • Width (W) sets a polyline line width (for thick outlines).
  • Elevation (E) and Thickness (T) are for 3D placement.

Important: these settings are sticky. If a rectangle comes out with rounded corners you did not ask for, a previous Fillet value is still active. Reset it with REC, F, 0 (and Chamfer 0), then Esc.

POLYGON

POL draws a regular polygon with 3 to 1024 equal sides. Sequence: enter the number of sides, then either Center point or Edge.

  • Edge (E): pick the two end points of one side; the polygon is built from that edge.
  • Center: pick the centre, then choose Inscribed in circle (vertices touch the circle; the radius is centre-to-vertex) or Circumscribed about circle (sides touch the circle; the radius is centre-to-side, the "apothem"), then the radius.

Why two options? A hexagonal nut is specified by the distance across flats (circumscribed), whereas a hexagon that has to fit inside a round bar is specified by the circle it must fit inside (inscribed). A polygon is also a closed polyline. Other regular shapes: a "star" is made with PLINE and polar entry, because there is no star command.

Vertex math

For an inscribed polygon with n sides and radius R, vertex k is at angle (360/n) x k from the starting direction: (cx + R cos(a), cy + R sin(a)). The side length is 2 R sin(180/n). For a circumscribed polygon with apothem a, the vertex radius is R = a / cos(180/n).

Python Stand-in: POLYGON vertices, inscribed and circumscribed

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

A hexagon inscribed in a circle of radius 10 has sides of exactly 10. A hexagon circumscribed about radius 10 has a vertex radius of about 11.547 and sides about 11.547, so "across flats" 20.

Rectangle options in code

This stand-in builds a rectangle with rotation and optional corner chamfer, to show what RECTANG calculates internally. It returns the polyline vertices.

Python Stand-in: rectangle from first corner, size, rotation and chamfer

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Practical examples

  1. Door opening: REC, pick a corner, D, 900, 50, pick the side. A 900 x 50 leaf.
  2. Concentric frames: draw one rectangle, then OFFSET it inward by the wall thickness (see Offset, Mirror and Arrays).
  3. Bolt pattern: a polygon plus circles at its vertices (use POLYGON for locations, endpoint snap for circle centres, then erase the polygon).

Editing the resulting polyline

Since rectangles and polygons are polylines, EXPLODE turns them into separate lines, and PEDIT can change width or join them to other polylines. Stretching a corner grip moves two sides together, which keeps the shape closed.

Common mistakes

  • Treating a rectangle as four lines and trying to select each side separately.
  • A leftover Fillet or Width setting changing a later rectangle.
  • Choosing inscribed when the design is specified "across flats".
  • Entering the other corner as an absolute coordinate when the size was meant to be relative; add the @.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. A rectangle drawn with RECTANG is:

    RECTANG creates a single closed polyline object.
  2. 2. A bolt head is specified 'across flats'. Which POLYGON option matches?

    Circumscribed uses the distance to the flat sides (apothem), which is the across-flats half-size.
  3. 3. A new rectangle has rounded corners you did not request. Why?

    Rectangle options such as Fillet and Chamfer persist until you reset them to 0.
  4. 4. How long is each side of a hexagon inscribed in a circle of radius 10?

    Side = 2 R sin(180/6) = 2 x 10 x 0.5 = 10.

Summary

  • RECTANG draws a closed polyline by two corners, Dimensions, Area and optional Rotation, Chamfer, Fillet and Width.
  • Chamfer and Fillet settings persist, reset them to zero when unwanted.
  • POLYGON takes 3 to 1024 sides, by Center (inscribed or circumscribed) or Edge.
  • Both results are single polylines; explode them only when you need separate lines.

Next: Polylines and Splines