pub struct RenderSettings {Show 39 fields
pub theme: ThemeMode,
pub ui_scale: f32,
pub label_scale: f32,
pub debug_grab_handles: bool,
pub background: [f32; 3],
pub face_color_mode: FaceColorMode,
pub override_model_colors: bool,
pub show_workbench_toolbar: bool,
pub face_color: Rgba,
pub face_selected_color: Rgba,
pub hover_color: Rgba,
pub edge_color: Rgba,
pub edge_selected_color: Rgba,
pub edge_width_px: f32,
pub hidden_edge_alpha: f32,
pub vertex_color: Rgba,
pub vertex_selected_color: Rgba,
pub vertex_size_px: f32,
pub flat_shading: bool,
pub wireframe: bool,
pub axis_length_px: f32,
pub viewcube_size_px: f32,
pub pick_double_sided: bool,
pub multi_select: MultiSelectMode,
pub lod_factor: f64,
pub sketch_movable_color: Rgba,
pub sketch_locked_color: Rgba,
pub sketch_geometry_color: Rgba,
pub sketch_point_color: Rgba,
pub sketch_construction_point_color: Rgba,
pub sketch_under_constrained_point_color: Rgba,
pub sketch_selected_color: Rgba,
pub sketch_hovered_color: Rgba,
pub sketch_preview_color: Rgba,
pub sketch_constraint_color: Rgba,
pub workbench: String,
pub assembly_auto_solve: bool,
pub show_constraint_graphics: bool,
pub bom_columns: String,
}Expand description
The viewer’s material palette + display toggles. Defaults are the
CADmaterials values.
Fields§
§theme: ThemeModeGUI chrome theme (egui panels/windows/toolbar/text). Defaults to Auto,
following the OS light/dark preference.
ui_scale: f32Global UI size scale applied to the whole egui chrome via
[egui::Context::set_zoom_factor]. 1.0 = native size; composes with the
device pixel ratio. Clamped to [0.5, 3.0].
label_scale: f32Size multiplier for the floating TEXT LABELS the app overlays on the 3D
model — the dimension-gizmo value chips (sketch + feature dimensions), the
assembly-constraint chips, and the transform gizmo’s axis letters. 1.0 = the
base monospace size; the label’s glyphs, its measured edit-box width, and its
chip padding all scale together (see brep-app’s viewport::labels). A
MULTIPLIER, not a point size, so labels stay consistent with each other and
the setting survives a restyle. Clamped to [0.25, 3.0]: 0.25 is the
smallest label that is still a LABEL rather than a smudge — a quarter of the
12pt base monospace is a ~3.8pt glyph row inside a ~4.5pt-tall chip, which is
the point at which the double-click/drag target stops being something a
pointer can reliably land on (and it composes with uiScale + the device
pixel ratio, so it is not an absolute 3pt on screen). The 3.0 ceiling keeps a
user from filling the viewport with one label. Independent of
RenderSettings::ui_scale, which sizes the egui CHROME (panels/toolbar)
and not the model overlay.
debug_grab_handles: boolDebug overlay: draw the 1px red outline of each gizmo grab handle’s hit region (arrows/leaders as capsules, balls as circles). Off by default; toggled from Settings to inspect exactly where a drag will grab.
background: [f32; 3]§face_color_mode: FaceColorMode§override_model_colors: boolIGNORE the model’s own colours when shading (RENDER-ONLY).
Bodies and faces carry a durable color metadata attribute — stamped by
a STEP import, editable in the Info window — and by default it IS the
shaded colour. Ticking this box makes the viewport fall back to
Self::face_color_mode (the uniform or name-hashed colour) as though
the model carried no colours at all.
It is a DISPLAY switch, not an edit: the metadata store is never touched, so unticking it brings every model colour straight back, and a document saved with the box ticked still carries all of its colours. Defaults to false — a coloured model shows its colours.
show_workbench_toolbar: boolShow the WORKBENCH ACTIONS toolbar — a second strip under the primary toolbar with one button per feature the active workbench offers (and, where the Constraints panel is shown, one per assembly-constraint type). Chrome only: it never changes what the palette or context bar offer. The app hides the strip while a sketch is being edited regardless of this flag.
face_color: Rgba§face_selected_color: Rgba§hover_color: Rgba§edge_color: Rgba§edge_selected_color: Rgba§edge_width_px: f32Occluded edges render dimmed, not dropped (R17): alpha of the depth-failing edge pass. 0 disables the pass.
vertex_color: Rgba§vertex_selected_color: Rgba§vertex_size_px: f32§flat_shading: bool§wireframe: boolWireframe display (R14): when true the shaded face-fill pass is skipped so only edges draw (the CAD wireframe look; back edges show through). Does NOT affect picking (CPU ray-based) or the overlay pass.
axis_length_px: f32World-axis helper (R20): screen length in CSS px; 0 disables.
viewcube_size_px: f32On-screen edge length of the always-on corner ViewCube, in CSS px. Drives
BOTH the rendered mini-camera viewport AND the hit-test corner rect (they
read the same value), so the cube and its clickable region scale together.
Defaults to [ViewCube::DEFAULT_SIZE_PX], so the cube is unchanged until edited.
pick_double_sided: bool§multi_select: MultiSelectModeHow a plain viewport click builds a multi-selection (see MultiSelectMode).
lod_factor: f64Tessellation LOD factor (1.0 = the app’s “Normal” preset).
sketch_movable_color: Rgba§sketch_locked_color: Rgba§sketch_geometry_color: Rgba§sketch_point_color: Rgba§sketch_construction_point_color: Rgba§sketch_under_constrained_point_color: Rgba§sketch_selected_color: Rgba§sketch_hovered_color: Rgba§sketch_preview_color: Rgba§sketch_constraint_color: Rgba§workbench: StringThe active UI WORKBENCH id ("all" / "modeling" / "sheetMetal"), a
plain string (NOT an enum) so the app-side per-file workbench registry
stays the sole owner of the valid-id set — adding a workbench never touches
this crate. This is purely a UI FILTER over feature-CREATION: it does not
affect what the history executes or renders. Default "modeling". An
unknown stored id is tolerated here and validated app-side (the registry’s
resolver falls back to the default).
assembly_auto_solve: boolAssembly AUTO-SOLVE (build-spec §6 scheduling): when true (the default) every constraint mutation re-solves + re-runs immediately; when false the mutation paths only update state and the user drives the manual Solve button. Consulted by the app’s constraint-mutation path.
show_constraint_graphics: boolShow Constraint Graphics (build-spec §8.3/§8.4): the render toggle the viewport overlay lane consumes — per-constraint leader/label graphics draw only while this is on. Owned here so the panel toggle, persistence, and the overlay renderer all read ONE flag.
bom_columns: StringThe BOM’s COLUMN CONFIGURATION — the raw text of the Settings panel’s
Assemblies textarea (one [*]prefix.Field per line). Stored VERBATIM,
exactly as the user typed it: parsing, the known-field catalogue and the
part. / occurrence. vocabulary all live app-side
(panels::bom_columns), so adding a BOM field never touches this crate
— the same division of labour that keeps workbench a plain string here.
Default EMPTY, which means “the app’s shipped default configuration”. A document that was never configured therefore persists byte-for-byte as before, and a later change to the shipped default still reaches every user who never overrode it.
Implementations§
Source§impl RenderSettings
impl RenderSettings
Sourcepub fn artifact() -> Self
pub fn artifact() -> Self
The artifact-corpus preset: byte-faithful to the slice-1 artifact look (per-solid hashed colors, 0x101418 background, 1.6px edges in 0x0d1030, no hidden-edge pass, no vertices, no axes).
Sourcepub fn apply_json(&mut self, json: &str) -> Result<(), String>
pub fn apply_json(&mut self, json: &str) -> Result<(), String>
Apply a partial JSON override (R3 settings entrypoint). Unknown keys are ignored; colors are CSS hex strings.
Sourcepub fn to_json(&self) -> String
pub fn to_json(&self) -> String
Serialize EVERY setting to the SAME camelCase / CSS-hex shape
[apply_json] reads, so s.apply_json(&s.to_json()) is the identity.
This is the counterpart the settings schema serializes/persists through
(there was previously no serializer, only the partial-override reader).
Sourcepub fn sketch_colors(&self) -> SketchColors
pub fn sketch_colors(&self) -> SketchColors
The live SketchColors view of the sketcher palette — the tessellation /
overlay builders read their colors from THIS (via
crate::sketch::SketchSession::colors) so the display settings are the one
source of truth. Each Rgba is quantized back to 0xRRGGBB the SAME way
[rgb_to_css_hex] serializes it, so a default settings value round-trips to
the default SketchColors byte-exact.
Sourcepub fn settings_schema_json(&self) -> String
pub fn settings_schema_json(&self) -> String
The settings schema WITH the current value baked into each field, as JSON
— mirrors the kernel’s feature_schemas_json export so a UI shell (egui
here, a later brep-ui crate) can generate the whole form from data. The
value of each field is pulled live from [to_json], so the export
always reflects the current settings.
Trait Implementations§
Source§impl Clone for RenderSettings
impl Clone for RenderSettings
Source§fn clone(&self) -> RenderSettings
fn clone(&self) -> RenderSettings
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RenderSettings
impl Debug for RenderSettings
Source§impl Default for RenderSettings
impl Default for RenderSettings
Source§impl PartialEq for RenderSettings
impl PartialEq for RenderSettings
impl StructuralPartialEq for RenderSettings
Auto Trait Implementations§
impl Freeze for RenderSettings
impl RefUnwindSafe for RenderSettings
impl Send for RenderSettings
impl Sync for RenderSettings
impl Unpin for RenderSettings
impl UnsafeUnpin for RenderSettings
impl UnwindSafe for RenderSettings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more