| Title: | Tiles and Random Mosaics Truchet Style Using the 'sf' Framework |
| Version: | 0.0.1.1 |
| Description: | Functions to create Truchet tiles, so called after Sébastien Truchet who was the first to describe the patterns obtained by rotating tiles with respect to each other. This form of tiling is described by Smith and Boucher (1987) https://muse.jhu.edu/article/600574. |
| License: | MIT + file LICENSE |
| Encoding: | UTF-8 |
| URL: | https://paezha.github.io/truchet/, https://github.com/paezha/truchet |
| BugReports: | https://github.com/paezha/truchet/issues |
| Imports: | bezier, checkmate, dplyr, lwgeom, magrittr, methods, purrr, rlang, sf, tidyr |
| Suggests: | rmarkdown, gganimate, ggplot2, knitr, imager |
| Config/roxygen2/version: | 8.0.0 |
| NeedsCompilation: | no |
| Packaged: | 2026-07-03 16:26:07 UTC; antonio-paez |
| Author: | Antonio Páez |
| Maintainer: | Antonio Páez <paezha@mcmaster.ca> |
| Repository: | CRAN |
| Date/Publication: | 2026-07-10 20:30:02 UTC |
truchet: Tiles and Random Mosaics Truchet Style Using the 'sf' Framework
Description
Functions to create Truchet tiles, so called after Sébastien Truchet who was the first to describe the patterns obtained by rotating tiles with respect to each other. This form of tiling is described by Smith and Boucher (1987) https://muse.jhu.edu/article/600574.
Author(s)
Maintainer: Antonio Páez paezha@mcmaster.ca (ORCID)
Authors:
Antonio Páez paezha@mcmaster.ca (ORCID)
See Also
Useful links:
Report bugs at https://github.com/paezha/truchet/issues
Pipe operator
Description
See magrittr::%>% for details.
Usage
lhs %>% rhs
Arguments
lhs |
A value or the magrittr placeholder. |
rhs |
A function call using the magrittr semantics. |
Value
The result of calling rhs(lhs).
Flexible Truchet tiles
Description
Flexible Truchet tiles
Usage
st_truchet_boutique(x = 0, y = 0, type = "ribbon_1")
Arguments
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" |
Value
A data frame with one or more objects of type sf representing one or more tiles depending on type
Note
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, https://www.cell.com/patterns/fulltext/S2666-3899(20)30112-4 and Robert J.Krawczyk (2011) Truchet tilings revisited, Proceedings of ISAMA 2011, 69-77 https://silo.tips/download/truchet-tilings-revisited
Examples
st_truchet_boutique(type = "ribbon_1")
st_truchet_boutique(type = "ribbon_2")
Dissolving the boundaries of individual tiles in Truchet mosaics
Description
Dissolving the boundaries of individual tiles in Truchet mosaics
Usage
st_truchet_dissolve(mosaic)
Arguments
mosaic |
a mosaic produced by function |
Value
An object of type sf with the mosaic after dissolving the boundaries of individual tiles
Examples
mosaic <- st_truchet_ms()
mosaic <- st_truchet_dissolve(mosaic)
Flexible Truchet tiles
Description
Flexible Truchet tiles
Usage
st_truchet_flex(x = 0, y = 0, type = "Al", b = 1/2)
Arguments
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 |
Value
A list with one or more objects of type sf representing one or more tiles depending on type
Note
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, doi:10.1080/17513472.2013.838830
Examples
st_truchet_flex(type = "Al")
st_truchet_flex(type = "Cl")
Mosaics with flexible Truchet tiles
Description
Mosaics with flexible Truchet tiles
Usage
st_truchet_fm(
df = NULL,
tiles = c("Al", "Cl"),
b = 1/2,
xlim = c(1, 3),
ylim = c(1, 6)
)
Arguments
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 |
Value
An object of type sf with the tiles arranged as a mosaic
Note
For a discussion of Truchet patterns see http://arearugscarpet.blogspot.com/2014/04/the-curse-of-truchets-tiles.html
Examples
mosaic <- st_truchet_fm()
plot(mosaic)
mosaic <- st_truchet_fm(b = 1/3)
plot(mosaic)
Truchet tiles made with polygons
Description
Truchet tiles made with polygons
Usage
st_truchet_l(x = 0, y = 0, type = "dl")
Arguments
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" |
Value
A list with one or more objects of type sf representing one or more tiles depending on type
Note
For a discussion of Truchet patterns see http://arearugscarpet.blogspot.com/2014/04/the-curse-of-truchets-tiles.html
Examples
st_truchet_l(type = "dl")
st_truchet_l(type = "dr")
Truchet mosaics
Description
Truchet mosaics
Usage
st_truchet_ms(
df = NULL,
p1 = 1,
p2 = 0,
p3 = 0,
tiles = c("dr", "dl"),
xlim = c(1, 3),
ylim = c(1, 6)
)
Arguments
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 |
Value
An object of type sf with the tiles arranged as a mosaic
Note
For a discussion of multi-scale Truchet patterns see https://christophercarlson.com/portfolio/multi-scale-truchet-patterns/
Examples
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
Description
Truchet tiles made with polygons
Usage
st_truchet_p(x = 0, y = 0, type = "dl", scale_p = 1)
Arguments
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 |
Value
A list with one or more objects of type sf representing one or more tiles depending on type
Note
For a discussion of multi-scale Truchet patterns see https://christophercarlson.com/portfolio/multi-scale-truchet-patterns/
Examples
st_truchet_p(type = "-")
st_truchet_p(type = "fnw", scale_p = 1/2)
Truchet mosaics
Description
Truchet mosaics
Usage
st_truchet_ss(df = NULL, tiles = c("dr", "dl"), xlim = c(1, 3), ylim = c(1, 6))
Arguments
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 |
Value
An object of type sf with the tiles arranged as a mosaic
Note
For a discussion of multi-scale Truchet patterns see https://christophercarlson.com/portfolio/multi-scale-truchet-patterns/
Examples
mosaic <- st_truchet_ss()
plot(mosaic)
mosaic <- st_truchet_ss(tiles = c("dl", "dr"))
plot(mosaic)