#[non_exhaustive]pub enum LatticeKind {
Square,
Hex,
}Expand description
Supported lattice families.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Implementations§
Source§impl LatticeKind
impl LatticeKind
Sourcepub fn model_point(self, coord: Coord) -> Point2<f32>
pub fn model_point(self, coord: Coord) -> Point2<f32>
Map an integer lattice coordinate into the model plane.
Square coordinates map to (u, v). Hex axial coordinates map to
(q + 0.5*r, sqrt(3)/2*r), using unit nearest-neighbour spacing in the
model plane.
This dispatches to the Lattice::model_point of the family impl, so
callers holding only a LatticeKind need not name the concrete family
type.
Sourcepub fn neighbour_offsets(self) -> &'static [Coord]
pub fn neighbour_offsets(self) -> &'static [Coord]
Cardinal neighbour offsets for this family (4 for square, 6 for hex).
Sourcepub fn symmetry_transforms(self) -> &'static [GridTransform]
pub fn symmetry_transforms(self) -> &'static [GridTransform]
The coordinate symmetry group for this family (D4 for square, D6 for hex).
Sourcepub fn axis_family_count(self) -> usize
pub fn axis_family_count(self) -> usize
Number of distinct axis families: 2 for square (±u, ±v), 3 for hex
(the three axial directions). This is the k the topological
classifier matches each edge against.
Sourcepub fn model_axis_directions(self) -> &'static [Vector2<f32>] ⓘ
pub fn model_axis_directions(self) -> &'static [Vector2<f32>] ⓘ
Unit model-plane directions of the k primitive axis families.
Returns one direction per family (axis_family_count() of them), each a
unit vector in the model plane. For square these are (1,0) and (0,1);
for hex they are the three axial step directions folded into the upper
half-plane. The topological pipeline uses these as the canonical
orientation targets when synthesizing per-corner axes.
Sourcepub fn cell_topology(self) -> CellTopology
pub fn cell_topology(self) -> CellTopology
How Delaunay triangles map to lattice cells for this family.
Trait Implementations§
Source§impl Clone for LatticeKind
impl Clone for LatticeKind
Source§fn clone(&self) -> LatticeKind
fn clone(&self) -> LatticeKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for LatticeKind
Source§impl Debug for LatticeKind
impl Debug for LatticeKind
Source§impl<'de> Deserialize<'de> for LatticeKind
impl<'de> Deserialize<'de> for LatticeKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for LatticeKind
Source§impl Hash for LatticeKind
impl Hash for LatticeKind
Source§impl PartialEq for LatticeKind
impl PartialEq for LatticeKind
Source§impl Serialize for LatticeKind
impl Serialize for LatticeKind
impl StructuralPartialEq for LatticeKind
Auto Trait Implementations§
impl Freeze for LatticeKind
impl RefUnwindSafe for LatticeKind
impl Send for LatticeKind
impl Sync for LatticeKind
impl Unpin for LatticeKind
impl UnsafeUnpin for LatticeKind
impl UnwindSafe for LatticeKind
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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
impl<T> Scalar for T
Source§impl<T> StrictAs for T
impl<T> StrictAs for T
Source§fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
Source§impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
Source§fn strict_cast_from(src: Src) -> Dst
fn strict_cast_from(src: Src) -> Dst
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.