pub struct RoseParams {
pub n: f32,
pub d: f32,
pub phase: f32,
pub radial_offset: f32,
pub samples: usize,
pub scale: f32,
pub rotation: f32,
pub draw_progress: f32,
pub color: [f32; 3],
pub width: f32,
}Expand description
Everything maurer_rose needs, by name.
This was eleven positional f32s behind #[allow(clippy::too_many_arguments)]
(Plan 0031 Phase 6). Four of them — phase, scale, radial_offset,
rotation — are adjacent, same-typed, and easy to transpose: the call would
still compile and would draw a different curve. Named fields make that a typo
you can see. Copy and all-scalar, so it is free at runtime.
Fields§
§n: f32Petal frequency: the n in sin(n * theta).
d: f32Angular step between successive sampled points, in degrees — the Maurer parameter that turns a smooth rose into its chord web.
phase: f32Phase (radians) inside the sine, so advancing it reshapes the petal
structure. Distinct from rotation, which spins the
finished figure in screen space. 0.0 is the plain rose.
radial_offset: f32Constant added to the radius, opening the rose off the origin into
spiral / annular / rosette forms. A nonzero value makes r exceed
[-1, 1] (intended — the renderer clips). 0.0 is the plain rose.
samples: usizeHow many points to walk; the chord count when fully drawn.
scale: f32Uniform scale applied after the rotation.
rotation: f32Screen-space rotation of the finished figure, in radians.
draw_progress: f32Reveal fraction in 0..=1 (line-draw-on); 1.0 draws the whole curve.
color: [f32; 3]One RGB colour for every segment.
width: f32Per-segment line width.
Trait Implementations§
Source§impl Clone for RoseParams
impl Clone for RoseParams
Source§fn clone(&self) -> RoseParams
fn clone(&self) -> RoseParams
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 RoseParams
impl Debug for RoseParams
Source§impl PartialEq for RoseParams
impl PartialEq for RoseParams
Source§fn eq(&self, other: &RoseParams) -> bool
fn eq(&self, other: &RoseParams) -> bool
self and other values to be equal, and is used by ==.