Datums: drawn at the model's extent, never framed, the selected one shown

A datum plane is drawn as the model's extent within it (where it cuts the
model's box, in the plane's axes) plus a 5 % margin, a datum axis along the
model's extent plus the margin, instead of squares 1.2 diagonals wide.
Fit, Home, the standard views and headless pictures frame the model
without the datums (they stay inside the clipping radius). The datum
selected in the browser is drawn highlighted and on top, even when hidden.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UhhZMBTviDQxZvwnyP89fo
This commit is contained in:
jyvikoandClaude Opus 5.5 authored and Irakli Kourtis committed 2026-10-15 01:01:43 -04:00
1 parent b19277ae7a
commit dddb2d0584
6 files changed
+239 -56

No files matched your search

+4 -3
View File
@@ -82,10 +82,11 @@ pub fn symbols(
glyphs.draw(pos, &view, s)
}
/// Draw the datums the session's view shows around `bounds` into `s`; returns the box around them.
pub fn datums(s: &mut Scene, session: &fieldcraft_engine::Session, bounds: &Aabb3, t: &Tokens) -> Aabb3 {
/// Draw the datums the session's view shows at the model (`bounds`) into `s`, and `selected` (the
/// datum selected in the browser), shown or hidden, highlighted; returns the box around them.
pub fn datums(s: &mut Scene, session: &fieldcraft_engine::Session, bounds: &Aabb3, selected: Option<&str>, t: &Tokens) -> Aabb3 {
let shown = |name: &str| session.shows(fieldcraft_engine::ItemKind::Datum, name);
fieldcraft_render::glyphs::datums(&session.model, bounds, &shown, &t.glyph_colors(), s)
fieldcraft_render::glyphs::datums(&session.model, bounds, &shown, selected, &t.glyph_colors(), s)
}
/// The scene for `display` drawn in `style`.