suggest_view_layout
Calculate safe view positions for multi-view engineering drawings, preventing overlaps with title block and margins. Returns coordinates, free space, and layout warnings.
Instructions
Auto-calculate safe VIEW_X / VIEW_Y positions for a multi-view engineering drawing.
Measures the named shape's bounding box and returns per-view page positions
(VIEW_X, VIEW_Y), look_at values, and camera/up vectors for a standard
third-angle layout:
[plan ] [ ]
[front] [ side ] [ iso ]
[ title block (bottom-right) ]
Returns JSON with:
views: {name: {VIEW_X, VIEW_Y, half_w, half_h, look_at, camera, up}}
free_space: {name: {above/below: {x, y, h}, left/right: {x, y, w}}} — the
empty rectangle outside each view edge, bounded by neighbouring views,
the title block, and the margins; budget dimension tiers (n × tier
pitch must fit in h/w) before placing annotations
warnings: list of layout problems (out-of-bounds, title-block overlap)
suggestion: recommended page_w/page_h/scale if the layout does not fit
object_name: name from show() — use "" to measure the current shape
page_w/page_h: sheet size in mm (default A4 landscape 297×210)
scale: drawing scale factor (default 1.0; use 2.0 for 2:1)
views: subset of ["front","plan","side","iso"] to place
title_block_w/h: reserved bottom-right area (default 150×30 mm)
margin: page margin in mm (default 10)
extents: [x, y, z] part sizes in mm — lays out from these numbers instead
of a session object (use when the part isn't loaded, e.g. import failed)
centroid: [x, y, z] look_at origin when using extents (default [0, 0, 0])
Accuracy: front/plan/side positions are exact for orthographic projection.
Iso position is approximate (75% of 3-D diagonal as half-extent) — verify
with render_view() and adjust manually if the iso overlaps a neighbour.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scale | No | ||
| views | No | ||
| margin | No | ||
| page_h | No | ||
| page_w | No | ||
| extents | No | ||
| centroid | No | ||
| object_name | No | ||
| title_block_h | No | ||
| title_block_w | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |