Title: | Package for creating Truchet tiles and random mosaics |
---|---|
Description: | This package includes utility functions to create Truchet tiles and arrange them to create mosaics. |
Authors: | Antonio Páez [aut, cre] |
Maintainer: | Antonio Páez <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.0.9007 |
Built: | 2024-11-02 05:28:48 UTC |
Source: | https://github.com/paezha/truchet |
Flexible Truchet tiles
st_truchet_boutique(x = 0, y = 0, type = "ribbon_1")
st_truchet_boutique(x = 0, y = 0, type = "ribbon_1")
x |
A number with the x coordinate of the center of the tile |
y |
A number with the y coordinate of the center of the tile |
type |
A single character to designate a type of tile; currently supported options are "ribbon_1", "ribbon_2", "ribbon_3", "ribbon_4", "paradise_1", "paradise_2", "paradise_3", "paradise_4", "silk_1", "silk_2", "silk_3", "silk_4", "rainbow_1", "rainbow_2", "cloud_1", "cloud_2", "cloud_3", "cloud_4" |
A data frame with one or more objects of type sf
representing one or more tiles depending on type
For a discussion of variable tiling patterns see: Robert J.Krawczyk (2020) Infinitely Variable Tiling Patterns: From Truchet to Sol LeWitt Revisited, Patterns, 1:5, 1-4, 10.1016/j.patter.2020.100084 and Robert J.Krawczyk (2011) Truchet tilings revisited, Proceedings of ISAMA 2011, 69-77 http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.378.5320&rep=rep1&type=pdf#page=69
st_truchet_boutique(type = "ribbon_1") st_truchet_boutique(type = "ribbon_2")
st_truchet_boutique(type = "ribbon_1") st_truchet_boutique(type = "ribbon_2")
Dissolving the boundaries of individual tiles in Truchet mosaics
st_truchet_dissolve(mosaic)
st_truchet_dissolve(mosaic)
mosaic |
a mosaic produced by function |
An object of type sf
with the mosaic after dissolving the boundaries of individual tiles
mosaic <- st_truchet_ms() mosaic <- st_truchet_dissolve(mosaic)
mosaic <- st_truchet_ms() mosaic <- st_truchet_dissolve(mosaic)
Flexible Truchet tiles
st_truchet_flex(x = 0, y = 0, type = "Al", b = 1/2)
st_truchet_flex(x = 0, y = 0, type = "Al", b = 1/2)
x |
A number with the x coordinate of the center of the tile |
y |
A number with the y coordinate of the center of the tile |
type |
A single character to designate a type of tile; currently supported options are "Ac", "Bc", "Cc", "Dc", "As", "Bs", "Cs", "Ds" |
b |
A number between zero and one that controls the shape of the boundary between the two parts of the tile |
A list with one or more objects of type sf
representing one or more tiles depending on type
For a discussion of Truchet patterns see: Robert Bosch & Urchin Colley (2013) Figurative mosaics from flexible Truchet tiles, Journal of Mathematics and the Arts, 7:3-4, 122-135, 10.1080/17513472.2013.838830
st_truchet_flex(type = "Al") st_truchet_flex(type = "Cl")
st_truchet_flex(type = "Al") st_truchet_flex(type = "Cl")
Mosaics with flexible Truchet tiles
st_truchet_fm( df = NULL, tiles = c("Al", "Cl"), b = 1/2, xlim = c(1, 3), ylim = c(1, 6) )
st_truchet_fm( df = NULL, tiles = c("Al", "Cl"), b = 1/2, xlim = c(1, 3), ylim = c(1, 6) )
df |
an (optional) data frame with the following columns: x and y (the coordinates of the tiles in a 1 by 1 grid), tiles (characters with types of tiles to use for mosaic), b (control of the boundary; defaults to 1/2) |
tiles |
a character vector with types of tiles to use for mosaic (default: |
b |
A number between zero and one that controls the shape of the boundary between the two parts of the tile |
xlim |
a numeric vector of length 2 giving the range of the x coordinates of the mosaic (ignored if argument |
ylim |
a numeric vector of length 2 giving the range of the y coordinates of the mosaic (ignored if argument |
An object of type sf
with the tiles arranged as a mosaic
For a discussion of Truchet patterns see http://arearugscarpet.blogspot.com/2014/04/the-curse-of-truchets-tiles.html
mosaic <- st_truchet_fm() plot(mosaic) mosaic <- st_truchet_fm(b = 1/3) plot(mosaic)
mosaic <- st_truchet_fm() plot(mosaic) mosaic <- st_truchet_fm(b = 1/3) plot(mosaic)
Truchet tiles made with polygons
st_truchet_l(x = 0, y = 0, type = "dl")
st_truchet_l(x = 0, y = 0, type = "dl")
x |
A number with the x coordinate of the center of the tile |
y |
A number with the y coordinate of the center of the tile |
type |
A single character to designate a type of tile; currently supported options are "dl", "dr" |
A list with one or more objects of type sf
representing one or more tiles depending on type
For a discussion of Truchet patterns see http://arearugscarpet.blogspot.com/2014/04/the-curse-of-truchets-tiles.html
st_truchet_l(type = "dl") st_truchet_l(type = "dr")
st_truchet_l(type = "dl") st_truchet_l(type = "dr")
Truchet mosaics
st_truchet_ms( df = NULL, p1 = 1, p2 = 0, p3 = 0, tiles = c("dr", "dl"), xlim = c(1, 3), ylim = c(1, 6) )
st_truchet_ms( df = NULL, p1 = 1, p2 = 0, p3 = 0, tiles = c("dr", "dl"), xlim = c(1, 3), ylim = c(1, 6) )
df |
an (optional) data frame with the following columns: x and y (the coordinates of the tiles in a 1 by 1 grid), tiles (characters with types of tiles to use for mosaic), scale_p (the scale of the tile to be placed at each coordinate) |
p1 |
a number between 0 and 1 with the proportion of spots in the mosaic to cover with tiles of scale 1 (the sum of p1, p2, p3 must be equal to one, or less to avoid empty spots in the mosaic) |
p2 |
a number between 0 and 1 with the proportion of spots in the mosaic to cover with tiles of scale 1/2 |
p3 |
a number between 0 and 1 with the proportion of spots in the mosaic to cover with tiles of scale 1/4 |
tiles |
a character vector with types of tiles to use for mosaic (default: |
xlim |
a numeric vector of length 2 giving the range of the x coordinates of the mosaic (ignored if argument |
ylim |
a numeric vector of length 2 giving the range of the y coordinates of the mosaic (ignored if argument |
An object of type sf
with the tiles arranged as a mosaic
For a discussion of multi-scale Truchet patterns see https://christophercarlson.com/portfolio/multi-scale-truchet-patterns/
mosaic <- st_truchet_ms() plot(mosaic) mosaic <- st_truchet_ms(p1 = 0.8, p2 = 0.16, p3 = 0.04) plot(mosaic) mosaic <- st_truchet_ms(p1 = 0.6, p2 = 0.3, p3 = 0.1, tiles = c("|", "-")) plot(mosaic)
mosaic <- st_truchet_ms() plot(mosaic) mosaic <- st_truchet_ms(p1 = 0.8, p2 = 0.16, p3 = 0.04) plot(mosaic) mosaic <- st_truchet_ms(p1 = 0.6, p2 = 0.3, p3 = 0.1, tiles = c("|", "-")) plot(mosaic)
Truchet tiles made with polygons
st_truchet_p(x = 0, y = 0, type = "dl", scale_p = 1)
st_truchet_p(x = 0, y = 0, type = "dl", scale_p = 1)
x |
A number with the x coordinate of the center of the tile |
y |
A number with the y coordinate of the center of the tile |
type |
A single character to designate a type of tile; currently supported options are "dl", "dr", "-", "|", "+.", "+", "x.", "tn", "fnw", "fne", "fsw", "fse", "ane", "asw" |
scale_p |
A number to designate the scale of the tile; currently supported options are 1, 1/2, and 1/4 |
A list with one or more objects of type sf
representing one or more tiles depending on type
For a discussion of multi-scale Truchet patterns see https://christophercarlson.com/portfolio/multi-scale-truchet-patterns/
st_truchet_p(type = "-") st_truchet_p(type = "fnw", scale_p = 1/2)
st_truchet_p(type = "-") st_truchet_p(type = "fnw", scale_p = 1/2)
Truchet mosaics
st_truchet_ss(df = NULL, tiles = c("dr", "dl"), xlim = c(1, 3), ylim = c(1, 6))
st_truchet_ss(df = NULL, tiles = c("dr", "dl"), xlim = c(1, 3), ylim = c(1, 6))
df |
an (optional) data frame with the following columns: x and y (the coordinates of the tiles in a 1 by 1 grid), tiles (characters with types of tiles to use for mosaic), scale_p (the scale of the tile to be placed at each coordinate) |
tiles |
a character vector with types of tiles to use for mosaic (default: |
xlim |
a numeric vector of length 2 giving the range of the x coordinates of the mosaic (ignored if argument |
ylim |
a numeric vector of length 2 giving the range of the y coordinates of the mosaic (ignored if argument |
An object of type sf
with the tiles arranged as a mosaic
For a discussion of multi-scale Truchet patterns see https://christophercarlson.com/portfolio/multi-scale-truchet-patterns/
mosaic <- st_truchet_ss() plot(mosaic) mosaic <- st_truchet_ss(tiles = c("dl", "dr")) plot(mosaic)
mosaic <- st_truchet_ss() plot(mosaic) mosaic <- st_truchet_ss(tiles = c("dl", "dr")) plot(mosaic)