E01 · F07 — Polygon aligned in its box
Benefit hypothesis: the designer chooses where a regular polygon sits in the room its box leaves — e.g. its flat base on the bottom of the box — so that a face lands on an integer coordinate, in line with the rectangles and ports drawn next to it, instead of floating at a fraction (a triangle in 100 × 100 has its base at y = 93.30127 when centered).
Product Owner's idea (2026-10-10, after F02): the flat face of a polygon, always at the bottom, should be able to touch the bottom of its box, with a choice of top, center or bottom, and likewise of left, center or right. A new feature: F02 is done and keeps its criteria.
Refined with the Product Owner on 2026-10-10 and 2026-10-11 (started with /run).
Decided in refinement (Product Owner, 2026-10-10 and 2026-10-11)
- Anchor on a 3 × 3 grid; one horizontal (left, center, right) and one vertical (top, center, bottom) alignment.
- Default: center, as before: F02's drawing is unchanged.
- The anchor is an intention, always stored, even where it moves nothing.
- The anchor places the sharp-cornered polygon; the radius rounds inwards without moving it. A flat face keeps touching at any radius (the incircle is tangent to every side); only a rounded vertex leaves the edge.
- No "always touch" option (Product Owner, 2026-10-11, option A): left out of F07. Confirmed at the validation as not useful: a polygon is used to attach things to the face that touches its box, and with such an option, anchored bottom right, measures from that face would no longer make sense. It is recorded so that the idea is not proposed again without a new need.
- Nine places kept (validation, 2026-10-11): the Product Owner noted that only five places are useful for a polygon and left the choice to the agent; a corner place holds both alignments, the one that counts follows the box (
docs/domain/shapes.md). - Rotation comes after the anchor: the box rotates with its content (recorded in F04).
- Later, the anchor belongs to every element placed in a layout box (Q21, epic E13); F07 stays limited to the polygon in its own box, and E13 reuses its 3 × 3 anchor.
Acceptance criteria
- A regular polygon stores a horizontal alignment (left, center, right) and a vertical alignment (top, center, bottom); a polygon drawn with center and center is exactly F02's; any other value is refused.
- The alignment places the sharp-cornered polygon in the room its box leaves: left puts its leftmost point at x = 0, right its rightmost at x = width, top its topmost at y = 0, bottom its base at y = height, as written in the output (5 decimals); a triangle in 100 × 100 anchored at the bottom has its base at y = 100 and its apex at y = 13.39746.
- On the axis the polygon fills, the alignment changes nothing in the drawing, and is still stored and shown.
- The corner radius rounds inwards without moving the polygon: a face on the anchored side keeps touching it at any radius, a rounded vertex leaves it.
- In the playground, a 3 × 3 grid shows and changes the polygon's anchor, usable with the keyboard as a radio group; it starts at the center.
Stories
In delivery order.
| ID | Type | Title | Status |
|---|---|---|---|
| SP-003 | Spike | Research for F07 | done |
| EN-009 | Enabler | Align a fitted shape in its box | done |
| US-009 | User story | Polygon anchored in its box | done |
| CHK-003 | Checkpoint | Checkpoint in the middle of F07 | done |
| US-010 | User story | Choose the anchor in the playground | done |
| AUD-003 | Audit | Audit F07: polygon aligned in its box | done |
| VAL-003 | Validation | Validate F07 on the reference cases | done |
Feature plan
| Acceptance criterion | Realized by | Verified by |
|---|---|---|
| 1 — alignments stored, center by default | US-009 | [F07.AC1] tests (US-009, US-010: 6), VAL-003 |
| 2 — placement on the anchored edges | SP-003, EN-009, US-009 | [F07.AC2] tests (EN-009, US-009, US-010: 8), VAL-003 |
| 3 — no move on the filled axis | EN-009, US-009 | [F07.AC3] tests (EN-009, US-009, US-010: 4), VAL-003 |
| 4 — radius does not move the polygon | US-009 | [F07.AC4] tests (US-009, US-010, AUD-003 property), US-010 card, VAL-003 |
| 5 — 3 × 3 anchor grid in the playground | US-010 | [F07.AC5] playground tests (US-010: 3), VAL-003 |