sheet_context
Retrieve a sheet region's classified vector segments, text spans, and hatch families as structured data, with decimation controls and content-derived hatch IDs for mapping plan regions to legend swatches.
Instructions
The sheet's STRUCTURE in one call and one frame: the classified vector segments, the positioned text spans, and the hatch-family instances of a region — everything the engine itself floods against, exposed as data instead of pixels. Use it when you need to REASON about a region rather than look at it: which lines bound this space and at what pen weight, what the region says, and which periodic fill pattern covers it. The join is the point — all three arrive in image px with no reconciliation left to do, and the reply echoes the post-clamp region so passing that same rect to view_sheet gives you the matching render by construction. Hatch families carry a content-derived id (same pattern spec ⇒ same id, anywhere on the sheet), so matching a plan region to a legend swatch is comparing two ids, not guessing from a render — read the legend region, read the room region, match ids, and cite both bboxes as evidence. Decimation is declared, ordered, and counted on every reply: segments shorter than min_len_px drop first (invisible ink), then a max_segments cap applies LONGEST-FIRST so walls survive and hatch strokes go; kept + dropped always reconciles to total_in_region, and whole segments drop with their meta intact — nothing is ever simplified or merged, because these are classified segments and a merge would rewrite the classification. A scan returns has_vector_linework: false with empty vectors — absence of linework, never a claim the region is blank. Coordinates are image px at render scale 2.0: PDF pt × 2, origin top-left, y down (the browser canvas's native space). Sheet payloads carry dims in both px and pt.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sheet | Yes | ||
| region | No | Rect in image px (origin top-left, y down); omit for the full sheet | |
| min_len_px | No | Drop segments shorter than this (default 2 — one PDF point at render scale 2.0, below any pen width). 0 keeps everything | |
| max_segments | No | Segment cap, applied longest-first (default 4000). The reply's dropped.cap says exactly what a smaller region would recover |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | Yes | ||
| text | Yes | ||
| hatch | Yes | ||
| sheet | Yes | ||
| region | Yes | The region actually resolved, post-clamp — pass this same rect to view_sheet and the render is in the same frame by construction | |
| vectors | Yes | ||
| sheet_px | Yes | ||
| has_vector_linework | Yes | false = a scan: vectors and hatch are empty because there are none, not because the region is blank |