pub struct IsohedralTiling { /* private fields */ }Expand description
Represents a particular isohedral tiling type.
Implementations§
Source§impl IsohedralTiling
impl IsohedralTiling
Sourcepub fn new(ihtype: TilingType) -> Self
pub fn new(ihtype: TilingType) -> Self
Create a new IsohedralTiling instance for the given tiling type. You can get a valid
tiling type by using the get_tiling_type function.
Sourcepub fn reset(&mut self, ihtype: TilingType)
pub fn reset(&mut self, ihtype: TilingType)
Resets the current instance to describe the new given tiling type, and recomputes the internal state as necessary.
Sourcepub fn tiling_type(&self) -> TilingType
pub fn tiling_type(&self) -> TilingType
§Accessors
The tiling type described by this instance.
Sourcepub fn num_params(&self) -> usize
pub fn num_params(&self) -> usize
The number of parameters that can affect the shape of the prototile. Some tiling types have no parameters (i.e. the prototile is a fixed shape), others have up to 6 parameters.
Sourcepub fn num_edge_shapes(&self) -> usize
pub fn num_edge_shapes(&self) -> usize
The number of different edge shapes for the current tiling type’s prototile.
Sourcepub fn num_vertices(&self) -> usize
pub fn num_vertices(&self) -> usize
The number of vertices that the current prototile has.
Sourcepub fn edge_shape(&self, idx: usize) -> EdgeShape
pub fn edge_shape(&self, idx: usize) -> EdgeShape
Returns the shape of the given edge.
See num_edge_shapes for the valid range of values for idx.
Sourcepub fn vertex(&self, idx: usize) -> &DVec2
pub fn vertex(&self, idx: usize) -> &DVec2
Returns the vertex specified by idx.
See num_vertices for the valid range of values for idx.
Sourcepub fn num_aspects(&self) -> usize
pub fn num_aspects(&self) -> usize
The number of aspects that the current tiling type has.
Sourcepub fn aspect_transform(&self, idx: usize) -> &DMat3
pub fn aspect_transform(&self, idx: usize) -> &DMat3
Returns the aspect transformation matrix for the given aspect index.
See num_aspects for the valid range of values for idx.
Sourcepub fn colour(&self, t1: isize, t2: isize, aspect: usize) -> u8
pub fn colour(&self, t1: isize, t2: isize, aspect: usize) -> u8
Computes a colour index used for tiling a region.
The return value can be 0, 1, 2, representing one of 3 possible colours. The parameters t1,
t2, and aspect can be obtained while iterating over the tiles of a region. See
[iterators::FillRegionIterator].
Sourcepub fn shapes(&self) -> TilingShapeIterator<'_>
pub fn shapes(&self) -> TilingShapeIterator<'_>
§Iterators
Iterate over all the edge shapes of the prototile.
Sourcepub fn parts(&self) -> TilingShapePartIterator<'_>
pub fn parts(&self) -> TilingShapePartIterator<'_>
Iterate over all the shape parts of the prototile.
Sourcepub fn fill_region(
&self,
xmin: f64,
ymin: f64,
xmax: f64,
ymax: f64,
) -> FillAlgorithm<'_>
pub fn fill_region( &self, xmin: f64, ymin: f64, xmax: f64, ymax: f64, ) -> FillAlgorithm<'_>
Helper to fill a region of the plan with tiles.
The returned object can be turned into an iteretor where each element gives you the necessary transform to apply to the prototile.
Sourcepub fn parameters(&self, params: &mut [f64; 6])
pub fn parameters(&self, params: &mut [f64; 6])
Return all the vertex parameters.
Note: not all tiling types have the same number of parameters. Only the first n values of the
returned array are valid, where n is the value returned by [`#num_params].
Sourcepub fn set_parameters(&mut self, params: &[f64; 6])
pub fn set_parameters(&mut self, params: &[f64; 6])
Set the vertex parameters.
See also: [#parameters]