sfc_2x2("I", "111") |> plot()
sfc_2x2("I", "111", rot = 90) |> plot()
sfc_2x2("IR", "111", rot = 90) |> plot()
sfc_3x3_peano("I", "111") |> plot()
sfc_3x3_peano("I", "111",
flip = c(FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE)) |> plot()
sfc_3x3_peano("IJ", "111") |> plot()
sfc_3x3_peano("I", level = 4, flip = function(p) {
p@rot %in% c(90, 270)
}) |> plot(lwd = 1)
level = 4
sfc_3x3_peano("I", level = level, flip = function(p) {
if(length(p) == 9^(level-1)) {
l = rep(FALSE, length(p))
ind = 1:9^2 + 9^2*rep(c(0, 2, 4, 6, 8), each = 9^2)
l[ind] = p@rot[ind] %in% c(90, 270)
ind = 1:9^2 + 9^2*rep(c(1, 3, 5, 7), each = 9^2)
l[ind] = p@rot[ind] %in% c(0, 180)
l
} else {
rep(FALSE, length(p))
}
}) |> plot(lwd = 1)
sfc_3x3_meander("I", "111") |> plot()
sfc_3x3_meander("I", "111",
flip = c(TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE)) |> plot()
sfc_3x3_meander("IR", "111") |> plot()
Run the code above in your browser using DataLab