pub struct RenderSettings {Show 27 fields
pub background: [f32; 3],
pub face_color_mode: FaceColorMode,
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 pick_double_sided: bool,
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,
}Expand description
The viewer’s material palette + display toggles. Defaults are the
CADmaterials values.
Fields§
§background: [f32; 3]§face_color_mode: FaceColorMode§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.
pick_double_sided: bool§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: RgbaImplementations§
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