Skip to main content

RenderSettings

Struct RenderSettings 

Source
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: f32§hidden_edge_alpha: f32

Occluded 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: bool

Wireframe 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: f32

World-axis helper (R20): screen length in CSS px; 0 disables.

§pick_double_sided: bool§lod_factor: f64

Tessellation 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

Implementations§

Source§

impl RenderSettings

Source

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).

Source

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.

Source

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).

Source

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.

Source

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

Source§

fn clone(&self) -> RenderSettings

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RenderSettings

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RenderSettings

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for RenderSettings

Source§

fn eq(&self, other: &RenderSettings) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RenderSettings

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,