View angles: an optional readout under the orientation gizmo and a command to set them (#6032) (#6249)

* claim: #6032

* View angles: an optional readout under the orientation gizmo and a command to set them (#6032)

View > View angles (also Preferences > Graphics, or view.angle_readout) shows the
view's pitch, yaw and roll in degrees and Ortho/Persp under the axis view or cube,
updated live; off by default. Clicking the readout opens a small card to type
exact angles, which runs view.apply.

The angles are the camera's own (Camera::view_angles / with_view_angles), about
the up axis: yaw is the heading of the line of sight (Front 0, Left 90, Right -90,
Back 180), pitch the eye's elevation (Top 90, Bottom -90), and a positive roll
turns the model clockwise. view.apply documents this convention and now refuses a
pitch past +/-pi/2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
HiroKenEz
2026-10-28 14:49:47 +00:00
committed by GitHub
parent 31d6873f7d
commit 4fa051c9fc
19 changed files with 666 additions and 4 deletions
+7
View File
@@ -80,6 +80,13 @@
top right while a dialog or a sketch is open, and moves the axis view or cube down below them.
With a dialog open they do what its OK and Cancel do (the check is grey whenever OK is); in a
sketch without a dialog they are Finish Sketch and Cancel Sketch.
**View angles** in the navigation bar's View menu (or Preferences › Graphics, or the
`view.angle_readout` command) shows the view's pitch, yaw and roll in degrees under the axis
view, with **Ortho** or **Persp** for the projection; it is off by default and updates as the
view turns. The angles turn about the up axis: yaw 0° is the Front view, 90° Left, −90° Right
and 180° Back; pitch 90° is the Top view and −90° the Bottom; a positive roll turns the model
clockwise on screen. Click the readout to type exact angles; **Apply** turns the view there
(it keeps the view's centre and zoom). Scripts set the same angles in radians with `view.apply`.
Right-click for the marking menu: eight commands around the cursor, plus a
menu for whatever is under it. Near the window's bottom or right edge a menu opens above or
to the left of the cursor, so it stays in view.
+16
View File
@@ -366,6 +366,22 @@ The ordered list of a design's features, which SolidCraft computes from first to
- **Elsewhere:** timeline, history, feature tree.
- **For translators:** not the undo history.
### view angles
The yaw, pitch and roll, in degrees, that give the direction a view looks along and how its
picture is turned.
Yaw is the heading of the line of sight about the up axis (Front view 0°, Left 90°, Right −90°,
Back 180°); pitch is how far the eye is above the ground plane (Top view 90°, Bottom −90°); a
positive roll turns the picture clockwise. They are the camera's own angles, which `view.apply`
and the MCP camera take in radians.
- **In SolidCraft:** `view.angle_readout` and the View angles readout under the orientation
gizmo; the `yaw`, `pitch` and `roll` of `view.apply`'s `camera`.
- **Don't use:** camera angles, view rotation.
- **Elsewhere:** view orientation, azimuth and elevation.
- **For translators:** the view's pitch is a tilt, not a thread's or a pattern's pitch.
### web browser
A program that shows web pages, such as the one that runs SolidCraft's web build.
+1 -1
View File
@@ -364,7 +364,7 @@ the batch added to the undo history.)
## Camera and close-up recipe
The `camera` of `screenshot` (the object `view.apply`, `view.save` and `solidcraft-cli snapshot --camera` take too) is an orbit camera, `{target, yaw, pitch, distance, fov?}`, in millimetres and **radians**. Unlike the `angle` of `solid.move`, a bare number is not degrees here. The eye is at `target + distance * (-sin(yaw) * cos(pitch), -cos(yaw) * cos(pitch), sin(pitch))`, looking at `target` with Z up on the screen. So `yaw: 0, pitch: 0` is the front view: the eye at -Y, looking along +Y, with +X to the right. A yaw of π/2 looks from -X, π from +Y and -π/2 from +X. The pitch is the elevation angle up from the XY plane, and π/2 looks straight down with +X to the right and +Y up. `fov` is the vertical field of view in radians. `0`, or no `fov`, is an orthographic view whose visible half-height is 0.4 × `distance`; with a perspective `fov` the half-height at the target is `distance * tan(fov / 2)`. `inspect.section` removes what lies on the side its normal points to: it keeps the points `p` with `n · p < d`, where `d = n · origin` (`flip: true` keeps the other side). To look into the cut, put the eye on the removed side.
The `camera` of `screenshot` (the object `view.apply`, `view.save` and `solidcraft-cli snapshot --camera` take too) is an orbit camera, `{target, yaw, pitch, distance, fov?}`, in millimetres and **radians**. Unlike the `angle` of `solid.move`, a bare number is not degrees here. The eye is at `target + distance * (-sin(yaw) * cos(pitch), -cos(yaw) * cos(pitch), sin(pitch))`, looking at `target` with Z up on the screen. So `yaw: 0, pitch: 0` is the front view: the eye at -Y, looking along +Y, with +X to the right. A yaw of π/2 looks from -X, π from +Y and -π/2 from +X. The pitch is the elevation angle up from the XY plane, and π/2 looks straight down with +X to the right and +Y up; `view.apply` refuses a pitch past ±π/2. A positive `roll` turns the picture clockwise. The app's View angles readout (`view.angle_readout`) shows the same yaw, pitch and roll in degrees. `fov` is the vertical field of view in radians. `0`, or no `fov`, is an orthographic view whose visible half-height is 0.4 × `distance`; with a perspective `fov` the half-height at the target is `distance * tan(fov / 2)`. `inspect.section` removes what lies on the side its normal points to: it keeps the points `p` with `n · p < d`, where `d = n · origin` (`flip: true` keeps the other side). To look into the cut, put the eye on the removed side.
To look closely at one part of a large model, such as a STEP assembly, work in a headless session. These steps change only the open design in memory: