> For the complete documentation index, see [llms.txt](https://docs.openbrim.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.openbrim.org/templates/cadd/rect-cadd.md).

# Rectangle

A **Rectangle** is a four-sided closed shape defined by a center point, width, and height — with optional rotation about the center. In bridge drawings you'll use it for pier outlines in plan, abutment footprints, footing plans, deck panels, plate steel, bearing pads, anchor pockets, and any rectangular region that should be parameterized by Width × Height rather than four corner points.

To draw: click once to place the first corner, then click again at the opposite corner. The center, width, and height are computed from those two clicks.

## Geometry

**Name:** Identifier within the parent CAD document. Must be unique.

**Level:** The layer controlling color, line weight, and dash style. Typical: "Substructure" for pier outlines, "Foundation" for footings, "Hardware" for plates and bearings.

**Center X:** Horizontal coordinate of the rectangle's center.

**Center Y:** Vertical coordinate of the rectangle's center.

**Width:** Length along the horizontal direction (before rotation). The rectangle extends `Width / 2` to either side of the center.

**Height:** Length along the vertical direction (before rotation). The rectangle extends `Height / 2` above and below the center.

**Rotation:** Rotation about the rectangle's center, applied after Width × Height layout. Positive is counter-clockwise. Use this to draw skewed pier footprints in plan, or to lay out plates that aren't axis-aligned.

**Perimeter (readonly):** `2 × (Width + Height)`. Useful for formwork take-offs.

**Area (readonly):** `Width × Height`.

**Diagonal (readonly):** Diagonal length, computed for spreadsheet display.

## Editing

**Move the rectangle:** drag any edge (away from a corner) to translate as a whole.

**Resize from a corner:** drag a corner handle to change Width and Height simultaneously. The opposite corner stays fixed.

**Resize from a midpoint:** drag a side midpoint to change only Width or only Height. The opposite side stays fixed.

**Rotate:** drag the rotation handle (outside the bounding box) to set the rotation. The center stays fixed.

**Snap:** the four corners and the four side midpoints are exposed as snap points.

## Notes

When the parent CAD document is driven by an alignment, a rectangle drawn in flat coordinates is bent so each side follows the alignment — straight horizontal sides become arcs over horizontal curves, and corners shift to keep the shape closed. For pier footprints in plan, this gives you a footprint that actually follows the bridge geometry without redrawing it when the alignment changes. For details that should stay axis-aligned regardless of alignment curvature (a steel plate elevation, for example), put the rectangle in a CAD document that is **not** alignment-driven.

If you need explicit corner control instead of Width × Height (a four-point trapezoidal shape, a skewed-quadrilateral footprint), use a Container with four points instead — that bypasses the Width × Height parameterization and lets you place each corner directly.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.openbrim.org/templates/cadd/rect-cadd.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
