Set or trace a scanned plan
edit_backgroundPlace a scanned floor plan under the drawing at real scale, or trace it into walls. Set calibration, angle, offset, opacity, or detect walls in one undo step.
Instructions
Put a scanned plan under the drawing at real scale, or turn it into walls. set {path, then cm_per_px (+cm_per_px_y), calibrate {a,b px, cm} or calibrations [{a,b,cm}…] to fit X/Y scales; angle (clockwise °); offset, opacity, visible; clear=true removes it}. trace {threshold?, min_len?, t_min?, t_max?, max_gap?, region?, h?} creates, in one undo step, the walls background detects with the same options, on the image set puts there. Check with render_plan bg=0.5.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| h | No | For `trace`: wall height cm (default 250) | |
| path | No | For `set`: image file (png/jpg/webp/bmp); required when there is no background yet | |
| angle | No | For `set`: clockwise turn of the image, degrees | |
| clear | No | For `set`: remove the background | |
| t_max | No | For `trace`: thickest wall kept, cm (default 45) | |
| t_min | No | For `trace`: thinnest wall kept, cm (default 5) | |
| action | Yes | What to do with the scanned plan | |
| offset | No | For `set`: plan position cm of the image's top-left corner | |
| region | No | For `trace`: only this part of the plan `[x0, y0, x1, y1]` cm | |
| max_gap | No | For `trace`: doors and windows up to this wide don't split a wall, cm (default 130) | |
| min_len | No | For `trace`: shortest wall kept, cm (default 60) | |
| opacity | No | For `set`: how opaque the image is drawn, 0..1 | |
| visible | No | For `set`: show or hide the image without removing it | |
| calibrate | No | For `set`: two pixels with a known real distance, `{a, b, cm}` | |
| cm_per_px | No | For `set`: the scale, cm per image pixel | |
| threshold | No | For `trace`: luminance 0..255 below which a gray pixel is ink (default 128) | |
| cm_per_px_y | No | For `set`: the vertical scale, when it differs | |
| calibrations | No | For `set`: several known distances, fitting X and Y scales apart |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| v | No | ||
| ok | Yes | ||
| ids | No | ||
| rev | No | ||
| text | Yes |