get_sheet_vectors
Return a sheet's raw vector strokes as flat point arrays with per-segment flags, luminance, and layer index so you can build your own geometry.
Instructions
The STROKES — the sheet's vector layer exactly as the engine is fed it, so you can run your own geometry against what the app sees (#367). view_sheet lets you look, read_sheet_text lets you read, sheet_context classifies a region; this returns the raw extractor output that all of them and every shape verb (the wall network's pen weights, symbol_sweep's matching) work from: flat points [x1, y1, x2, y2, …] in image px, one meta byte per segment (low nibble flags: 1 curve chord, 2 clip-only, 4 fill-only, 8 polyline arc; pen width = meta >> 4), per-segment stroke luminance, the drawn figure each segment belongs to (subpath ordinal), the sheet's placed-image area, and its PDF layer table with a per-segment layer index (sheet_info.layers names and classifies the same ids). Nothing is classified, decimated, or merged here — segments arrive whole, in extraction order, undecimated, which is the point: a reader can build its own room finder, symbol matcher, or wall classifier on the same array and commit through the existing verbs with provenance intact. Paged, never clipped silently: a dense sheet runs to hundreds of thousands of segments, so the reply carries limit (default 20000 segments, ceiling 100000) and the ledger offset + returned + dropped === total on every page; dropped is exactly what passing next_cursor as cursor recovers. region keeps every segment that intersects the rect (endpoints untouched — the same keep test sheet_context uses, so total here equals sheet_context's total_in_region) and echoes it post-clamp. Read-only and stateless — no shape, condition, or scale is touched. A scan has no strokes: the verb refuses and names view_sheet as the path. 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 |
|---|---|---|---|
| limit | No | Page size in segments (default 20000, max 100000) — about 1 MB of JSON per 20000 | |
| sheet | Yes | Sheet key ("plan.pdf", "plan.pdf#2") or title-block number ("A-101") | |
| cursor | No | A previous reply's next_cursor — resume paging there. Omit for the first page | |
| region | No | Rect in image px (origin top-left, y down); omit for the full sheet. A segment is kept when it intersects the rect |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lum | Yes | Aligned with points: stroke luminance 0 (black) – 255 (white), Rec. 709 over the stroke colour in force when the path was built. Empty only when the geometry carries no luminance channel | |
| meta | Yes | One byte per segment, aligned with points: low nibble flags — 1 curve chord (bezier tessellation or detected polyline arc), 2 clip-only path (invisible ink), 4 filled-not-stroked, 8 polyline-arc provenance; high nibble (meta >> 4) = device pen width in px | |
| note | No | Present when the sheet is a scan wrapper — the few segments here are a frame, not the drawing | |
| page | Yes | ||
| limit | Yes | The page size that applied | |
| sheet | Yes | ||
| total | Yes | Segments on the sheet intersecting the region — the whole set, before paging | |
| offset | Yes | Matching segments BEFORE this page (skipped by cursor) | |
| points | Yes | Flat [x1, y1, x2, y2, …] — four numbers per segment, image px to 0.01, endpoints exactly as extracted (never clipped to the region, never merged); segments arrive in extraction order, the order the engine sees | |
| region | Yes | The region actually resolved, post-clamp [x0, y0, x1, y1] image px — the same rect sheet_context and view_sheet take, so all three verbs answer in one frame | |
| dropped | Yes | Matching segments AFTER this page that limit cut — exactly what next_cursor recovers. offset + returned + dropped === total on every reply; 0 means this page ends the set | |
| subpath | Yes | Aligned with points: ordinal of the drawn FIGURE each segment belongs to (each moveTo starts one, each rectangle is one) — segments sharing a value are one path; −1 = outside every figure | |
| layer_of | Yes | Aligned with points: index into layer_ids, or −1 for a segment outside every layer. Empty only when the geometry carries no layer channel | |
| returned | Yes | Segments in this reply | |
| sheet_px | Yes | ||
| layer_ids | Yes | The sheet's PDF Optional Content Group ids in first-seen order — the same ids sheet_info.layers reports (with names and roles); [] on an unlayered sheet | |
| image_area | Yes | Total placed-image area on the sheet, image px² — a value near the sheet area means a scan or photo underlay sits under whatever linework there is | |
| next_cursor | No | Pass as cursor to fetch the next page; absent when dropped is 0 |