pub struct Rabbit {}Expand description
Parametric knobs for the rabbit silhouette. All in the normalised [-1, 1]
design box (y up). Rabbit::default is the tuned mascot; tests and
renderers should use it so the geometry is the same everywhere.
Fields§
§body_cy: f64Body ellipse centre + radii (the sitting haunch).
body_rx: f64§body_ry: f64§head_cx: f64Head circle centre + radius (sits above/forward of the body).
head_cy: f64§head_r: f64§ear_w: f64Ear geometry: half-width at the base, length, lean (x-offset of the tip), and the gap between the two ear centres at the head.
ear_len: f64§ear_lean: f64§ear_gap: f64§eye_dx: f64Eye dot centre (offset from the head centre) + radius.
eye_dy: f64§eye_r: f64§segments: usizeHow many segments to sample each rounded part with (even → symmetric).
Implementations§
Source§impl Rabbit
impl Rabbit
Sourcepub fn outline(&self) -> Vec<Loop> ⓘ
pub fn outline(&self) -> Vec<Loop> ⓘ
The rabbit as closed polygon loops, outer silhouette first, then the
two ears, then the eye dot. Each loop is a CCW ring in the [-1, 1] box
(y up). The 2D renderer fills the body+head as the silhouette, fills the
ears on top, and punches the eye as a small dark dot.
Sourcepub fn silhouette(&self) -> Vec<Loop> ⓘ
pub fn silhouette(&self) -> Vec<Loop> ⓘ
The fillable body silhouette: just the body + head + ears (no eye), the loops a 2D renderer fills as the solid mascot. Returned outer→inner so the renderer can paint them in order (body, head, ears) with one colour.
Trait Implementations§
impl Copy for Rabbit
impl StructuralPartialEq for Rabbit
Auto Trait Implementations§
impl Freeze for Rabbit
impl RefUnwindSafe for Rabbit
impl Send for Rabbit
impl Sync for Rabbit
impl Unpin for Rabbit
impl UnsafeUnpin for Rabbit
impl UnwindSafe for Rabbit
Blanket Implementations§
impl<T> Allocation for T
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