pub struct KnotShape {
pub p: u32,
pub q: u32,
pub major_r: f32,
pub minor_r: f32,
pub volume: f32,
pub points: Vec<[f32; 3]>,
}Expand description
A deterministic 3-D (p, q) torus knot acting as a visual fingerprint of a
32-byte digest. Identical digests → identical knots; a single bit flip
reshapes the whole curve. Render points as a tube/polyline to see a key.
Fields§
§p: u32Longitudinal winding (coprime to q) — the knot is non-trivial for p,q ≥ 2.
q: u32Meridional winding.
major_r: f32Major torus radius.
minor_r: f32Minor torus radius.
volume: f32A flavor-only “hyperbolic volume” label derived from the digest (decorative).
points: Vec<[f32; 3]>Sampled 3-D points along the knot (closed curve).
Implementations§
Source§impl KnotShape
impl KnotShape
Sourcepub fn from_bytes(data: &[u8]) -> Self
pub fn from_bytes(data: &[u8]) -> Self
Derive a knot directly from arbitrary bytes (hashes them first).
Sourcepub fn from_digest(d: &[u8; 32]) -> Self
pub fn from_digest(d: &[u8; 32]) -> Self
Derive a knot from a 32-byte digest.
Trait Implementations§
impl StructuralPartialEq for KnotShape
Auto Trait Implementations§
impl Freeze for KnotShape
impl RefUnwindSafe for KnotShape
impl Send for KnotShape
impl Sync for KnotShape
impl Unpin for KnotShape
impl UnsafeUnpin for KnotShape
impl UnwindSafe for KnotShape
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
Mutably borrows from an owned value. Read more