Blue Vorontex #47.2

Non-polar Circular Vorontex

Generative aRt
R
Author

Christian Knudsen

Published

July 9, 2024

Same concept as my Blue Vorentex #47 - just with ggvoronoi instead of polar cooridnates.

library(tidyverse)
library(ggvoronoi)
library(deldir)

Generate random points, making sure that we can reproduce them.

set.seed(47)
tiler <- 100
x <- rnorm(tiler)
y <- rnorm(tiler)

Then, calculate the tiles, and collect them in a dataframe:

points <- data.frame(x=x, y=y) %>% 
  rowid_to_column("id") %>% 
  mutate(id = as.integer(id))

Next, plot it, and add a circle for a cutout - thats the outline in geom_voronoi:

s <- seq(0, 2 * pi, length.out = 3000)
radius <- 2
c_x <- 0
c_y <- 0
circle <- data.frame(x = radius * (c_x + cos(s)),
                     y = radius * (c_y + sin(s)),
                     group = rep(1, 3000))

points %>% 
  ggplot(aes(x = x, y = y, fill = factor(id))) +
  geom_voronoi(outline = circle,  color = 1, size= 0.1) +
  theme_minimal() +
  theme(legend.position = "none" ,
        axis.text = element_blank(),
        axis.title = element_blank(),
        axis.line = element_blank(),
        axis.ticks = element_blank(),
        panel.grid = element_blank()) +
        scale_fill_manual(values = hcl.colors(100, "Blues 2")) +
        theme(legend.position = "none") +
  coord_fixed()

ggsave("Blue_Vorontex-47.2.png")