suggest_view_layout
Calculates safe view positions for multi-view engineering drawings. Returns JSON with VIEW_X, VIEW_Y, look_at, camera, and up vectors for a standard third-angle layout.
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}}
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 |
|---|---|---|---|
| object_name | No | ||
| page_w | No | ||
| page_h | No | ||
| scale | No | ||
| views | No | ||
| title_block_w | No | ||
| title_block_h | No | ||
| margin | No | ||
| extents | No | ||
| centroid | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |