Part 1: Simple Transformation of a Function

Transformation: Base Function

Below is a hexbin plot showing the relationship between per-capita gdp, and life expectancy. The color of the hexagons varies according to the number of observations at each intersection. The unit of analysis, is country within year. Data represent 142 countries across 12 years, 1,704 observations.

library(gapminder)
library(dplyr)
library(ggplot2)
library(ggnewscale)

gapminder%>% 
  ggplot()+
  geom_hex(aes(x=lifeExp, y=gdpPercap))+
  theme_minimal()+ theme(legend.position = "none")

Transformation: Transformations of base function

The above function is:

  • plotted without transformation
  • shrunken (by a factor of 3)
  • reflected over the x-axis (negate y values)
  • reflected over the y-axis (negate x values)
  • shrunken & reflected over the x-axis (shrink by factor of 3 & negate y values)
  • shrunken & reflected over the y-axis (shrink by factor of 3 & negate x values)
gapminder%>%
    ggplot()+
    
    #Original
    geom_hex(aes(x=lifeExp, y=gdpPercap))+scale_fill_continuous(low = "lightblue", high = "darkblue",aesthetics = "fill")+new_scale("fill") +
    #Reflect over x axis
    geom_hex(aes(x=lifeExp, y=-gdpPercap))+scale_fill_continuous(low = "salmon", high = "darkred",aesthetics = "fill")+new_scale("fill")+
    #Squeeze
    geom_hex(aes(x=lifeExp/3, y=gdpPercap))+scale_fill_continuous(low = "lightblue", high = "darkblue",aesthetics = "fill")+new_scale("fill") +
    
    #Reflect over X
    geom_hex(aes(x=-lifeExp, y=gdpPercap))+scale_fill_continuous(low = "lightgreen", high = "darkgreen",aesthetics = "fill")+new_scale("fill") +
    
    #Reflect over X & reflect over Y
    geom_hex(aes(x=-lifeExp, y=-gdpPercap))+scale_fill_continuous(low = "yellow", high = "darkorange",aesthetics = "fill")+new_scale("fill")+
    
    #Squeeze & reflect over Y
    geom_hex(aes(x=-lifeExp/3, y=gdpPercap))+scale_fill_continuous(low = "lightgreen", high = "darkgreen",aesthetics = "fill")+new_scale("fill") +
    
    #Squeeze & reflect over X
    geom_hex(aes(x=lifeExp/3, y=-gdpPercap))+scale_fill_continuous(low = "salmon", high = "darkred",aesthetics = "fill")+new_scale("fill")+
    
    #Squeeze & reflect over X & reflect over Y
    geom_hex(aes(x=-lifeExp/3, y=-gdpPercap))+scale_fill_continuous(low = "yellow", high = "darkorange",aesthetics = "fill")+new_scale("fill")+
    theme_minimal()+ theme(legend.position = "none")

Part 2: Tessellations

Drawing the Coordinates of a cuboid

cuboid<-data.frame(
  x1 = c(1, 0, -1, 0), 
  y1 = c(0, 1, 0, -1),
  x2 = c(0, 1, 1, 0), 
  y2 = c(-1, 0, -1, -2),
  x3 = c(0, -1, -1, 0), 
  y3 = c(-1, 0, -1, -2)
  )

ggplot(cuboid) + 
  geom_polygon(aes(x = x1, y = y1),fill="white")+geom_polygon(aes(x = x2, y = y2),fill="black")+geom_polygon(aes(x = x3, y = y3),fill="darkgrey")

Cuboid Tessellations

The above cuboid is replicated 48 times, each one transformed (shifted right, down, etc…) to create a continuous pattern of cuboid objects. The light appears to come from above the cuboids.

ggplot(cuboid) + 
  geom_polygon(aes(x = x1, y = y1),fill="white")+geom_polygon(aes(x = x2, y = y2),fill="black")+geom_polygon(aes(x = x3, y = y3),fill="darkgrey")+
  geom_polygon(aes(x = x1+2, y = y1),fill="white")+geom_polygon(aes(x = x2+2, y = y2),fill="black")+geom_polygon(aes(x = x3+2, y = y3),fill="darkgrey")+
  geom_polygon(aes(x = x1+4, y = y1),fill="white")+geom_polygon(aes(x = x2+4, y = y2),fill="black")+geom_polygon(aes(x = x3+4, y = y3),fill="darkgrey")+
  geom_polygon(aes(x = x1+6, y = y1),fill="white")+geom_polygon(aes(x = x2+6, y = y2),fill="black")+geom_polygon(aes(x = x3+6, y = y3),fill="darkgrey")+
  geom_polygon(aes(x = x1+8, y = y1),fill="white")+geom_polygon(aes(x = x2+8, y = y2),fill="black")+geom_polygon(aes(x = x3+8, y = y3),fill="darkgrey")+
  geom_polygon(aes(x = x1+10, y = y1),fill="white")+geom_polygon(aes(x = x2+10, y = y2),fill="black")+geom_polygon(aes(x = x3+10, y = y3),fill="darkgrey")+
  #Shift Up & Right
  geom_polygon(aes(x = x1+1, y = y1+2),fill="white")+geom_polygon(aes(x = x2+1, y = y2+2),fill="black")+geom_polygon(aes(x = x3+1, y = y3+2),fill="darkgrey")+
  geom_polygon(aes(x = x1+3, y = y1+2),fill="white")+geom_polygon(aes(x = x2+3, y = y2+2),fill="black")+geom_polygon(aes(x = x3+3, y = y3+2),fill="darkgrey")+
  geom_polygon(aes(x = x1+5, y = y1+2),fill="white")+geom_polygon(aes(x = x2+5, y = y2+2),fill="black")+geom_polygon(aes(x = x3+5, y = y3+2),fill="darkgrey")+
  geom_polygon(aes(x = x1+7, y = y1+2),fill="white")+geom_polygon(aes(x = x2+7, y = y2+2),fill="black")+geom_polygon(aes(x = x3+7, y = y3+2),fill="darkgrey")+
  geom_polygon(aes(x = x1+9, y = y1+2),fill="white")+geom_polygon(aes(x = x2+9, y = y2+2),fill="black")+geom_polygon(aes(x = x3+9, y = y3+2),fill="darkgrey")+
  geom_polygon(aes(x = x1+11, y = y1+2),fill="white")+geom_polygon(aes(x = x2+11, y = y2+2),fill="black")+geom_polygon(aes(x = x3+11, y = y3+2),fill="darkgrey")+
#Shift Down & Right - First Row Down
  geom_polygon(aes(x = x1+1, y = y1-2),fill="white")+geom_polygon(aes(x = x2+1, y = y2-2),fill="black")+geom_polygon(aes(x = x3+1, y = y3-2),fill="darkgrey")+
  geom_polygon(aes(x = x1+3, y = y1-2),fill="white")+geom_polygon(aes(x = x2+3, y = y2-2),fill="black")+geom_polygon(aes(x = x3+3, y = y3-2),fill="darkgrey")+
  geom_polygon(aes(x = x1+5, y = y1-2),fill="white")+geom_polygon(aes(x = x2+5, y = y2-2),fill="black")+geom_polygon(aes(x = x3+5, y = y3-2),fill="darkgrey")+
  geom_polygon(aes(x = x1+7, y = y1-2),fill="white")+geom_polygon(aes(x = x2+7, y = y2-2),fill="black")+geom_polygon(aes(x = x3+7, y = y3-2),fill="darkgrey")+
  geom_polygon(aes(x = x1+9, y = y1-2),fill="white")+geom_polygon(aes(x = x2+9, y = y2-2),fill="black")+geom_polygon(aes(x = x3+9, y = y3-2),fill="darkgrey")+
  geom_polygon(aes(x = x1+11, y = y1-2),fill="white")+geom_polygon(aes(x = x2+11, y = y2-2),fill="black")+geom_polygon(aes(x = x3+11, y = y3-2),fill="darkgrey")+
  #Shift Down  - Second Row Down
  geom_polygon(aes(x = x1, y = y1-4),fill="white")+geom_polygon(aes(x = x2, y = y2-4),fill="black")+geom_polygon(aes(x = x3, y = y3-4),fill="darkgrey")+
  geom_polygon(aes(x = x1+2, y = y1-4),fill="white")+geom_polygon(aes(x = x2+2, y = y2-4),fill="black")+geom_polygon(aes(x = x3+2, y = y3-4),fill="darkgrey")+
  geom_polygon(aes(x = x1+4, y = y1-4),fill="white")+geom_polygon(aes(x = x2+4, y = y2-4),fill="black")+geom_polygon(aes(x = x3+4, y = y3-4),fill="darkgrey")+
  geom_polygon(aes(x = x1+6, y = y1-4),fill="white")+geom_polygon(aes(x = x2+6, y = y2-4),fill="black")+geom_polygon(aes(x = x3+6, y = y3-4),fill="darkgrey")+
  geom_polygon(aes(x = x1+8, y = y1-4),fill="white")+geom_polygon(aes(x = x2+8, y = y2-4),fill="black")+geom_polygon(aes(x = x3+8, y = y3-4),fill="darkgrey")+
  geom_polygon(aes(x = x1+10, y = y1-4),fill="white")+geom_polygon(aes(x = x2+10, y = y2-4),fill="black")+geom_polygon(aes(x = x3+10, y = y3-4),fill="darkgrey")+
  #Shift Down  - Third Row Down
  geom_polygon(aes(x = x1+1, y = y1-6),fill="white")+geom_polygon(aes(x = x2+1, y = y2-6),fill="black")+geom_polygon(aes(x = x3+1, y = y3-6),fill="darkgrey")+
  geom_polygon(aes(x = x1+3, y = y1-6),fill="white")+geom_polygon(aes(x = x2+3, y = y2-6),fill="black")+geom_polygon(aes(x = x3+3, y = y3-6),fill="darkgrey")+
  geom_polygon(aes(x = x1+5, y = y1-6),fill="white")+geom_polygon(aes(x = x2+5, y = y2-6),fill="black")+geom_polygon(aes(x = x3+5, y = y3-6),fill="darkgrey")+
  geom_polygon(aes(x = x1+7, y = y1-6),fill="white")+geom_polygon(aes(x = x2+7, y = y2-6),fill="black")+geom_polygon(aes(x = x3+7, y = y3-6),fill="darkgrey")+
  geom_polygon(aes(x = x1+9, y = y1-6),fill="white")+geom_polygon(aes(x = x2+9, y = y2-6),fill="black")+geom_polygon(aes(x = x3+9, y = y3-6),fill="darkgrey")+
  geom_polygon(aes(x = x1+11, y = y1-6),fill="white")+geom_polygon(aes(x = x2+11, y = y2-6),fill="black")+geom_polygon(aes(x = x3+11, y = y3-6),fill="darkgrey")+
  #Shift Down  - Fourth Row Down
  geom_polygon(aes(x = x1, y = y1-8),fill="white")+geom_polygon(aes(x = x2, y = y2-8),fill="black")+geom_polygon(aes(x = x3, y = y3-8),fill="darkgrey")+
  geom_polygon(aes(x = x1+2, y = y1-8),fill="white")+geom_polygon(aes(x = x2+2, y = y2-8),fill="black")+geom_polygon(aes(x = x3+2, y = y3-8),fill="darkgrey")+
  geom_polygon(aes(x = x1+4, y = y1-8),fill="white")+geom_polygon(aes(x = x2+4, y = y2-8),fill="black")+geom_polygon(aes(x = x3+4, y = y3-8),fill="darkgrey")+
  geom_polygon(aes(x = x1+6, y = y1-8),fill="white")+geom_polygon(aes(x = x2+6, y = y2-8),fill="black")+geom_polygon(aes(x = x3+6, y = y3-8),fill="darkgrey")+
  geom_polygon(aes(x = x1+8, y = y1-8),fill="white")+geom_polygon(aes(x = x2+8, y = y2-8),fill="black")+geom_polygon(aes(x = x3+8, y = y3-8),fill="darkgrey")+
  geom_polygon(aes(x = x1+10, y = y1-8),fill="white")+geom_polygon(aes(x = x2+10, y = y2-8),fill="black")+geom_polygon(aes(x = x3+10, y = y3-8),fill="darkgrey")+
  #Shift Down  - Fifth Row Down
  geom_polygon(aes(x = x1+1, y = y1-10),fill="white")+geom_polygon(aes(x = x2+1, y = y2-10),fill="black")+geom_polygon(aes(x = x3+1, y = y3-10),fill="darkgrey")+
  geom_polygon(aes(x = x1+3, y = y1-10),fill="white")+geom_polygon(aes(x = x2+3, y = y2-10),fill="black")+geom_polygon(aes(x = x3+3, y = y3-10),fill="darkgrey")+
  geom_polygon(aes(x = x1+5, y = y1-10),fill="white")+geom_polygon(aes(x = x2+5, y = y2-10),fill="black")+geom_polygon(aes(x = x3+5, y = y3-10),fill="darkgrey")+
  geom_polygon(aes(x = x1+7, y = y1-10),fill="white")+geom_polygon(aes(x = x2+7, y = y2-10),fill="black")+geom_polygon(aes(x = x3+7, y = y3-10),fill="darkgrey")+
  geom_polygon(aes(x = x1+9, y = y1-10),fill="white")+geom_polygon(aes(x = x2+9, y = y2-10),fill="black")+geom_polygon(aes(x = x3+9, y = y3-10),fill="darkgrey")+
  geom_polygon(aes(x = x1+11, y = y1-10),fill="white")+geom_polygon(aes(x = x2+11, y = y2-10),fill="black")+geom_polygon(aes(x = x3+11, y = y3-10),fill="darkgrey")+
  #Shift Down  - Third Row Down
  geom_polygon(aes(x = x1, y = y1-12),fill="white")+geom_polygon(aes(x = x2, y = y2-12),fill="black")+geom_polygon(aes(x = x3, y = y3-12),fill="darkgrey")+
  geom_polygon(aes(x = x1+2, y = y1-12),fill="white")+geom_polygon(aes(x = x2+2, y = y2-12),fill="black")+geom_polygon(aes(x = x3+2, y = y3-12),fill="darkgrey")+
  geom_polygon(aes(x = x1+4, y = y1-12),fill="white")+geom_polygon(aes(x = x2+4, y = y2-12),fill="black")+geom_polygon(aes(x = x3+4, y = y3-12),fill="darkgrey")+
  geom_polygon(aes(x = x1+6, y = y1-12),fill="white")+geom_polygon(aes(x = x2+6, y = y2-12),fill="black")+geom_polygon(aes(x = x3+6, y = y3-12),fill="darkgrey")+
  geom_polygon(aes(x = x1+8, y = y1-12),fill="white")+geom_polygon(aes(x = x2+8, y = y2-12),fill="black")+geom_polygon(aes(x = x3+8, y = y3-12),fill="darkgrey")+
  geom_polygon(aes(x = x1+10, y = y1-12),fill="white")+geom_polygon(aes(x = x2+10, y = y2-12),fill="black")+geom_polygon(aes(x = x3+10, y = y3-12),fill="darkgrey")+
  xlim(-5,15)+
  ylim(-15,5)

Shifting the Light Source

If the colors are shifted, our perceiption of the source of light shifts as well. Now the light appears to come from the left.

ggplot(cuboid) + 
  geom_polygon(aes(x = x1, y = y1),fill="darkgrey")+geom_polygon(aes(x = x2, y = y2),fill="black")+geom_polygon(aes(x = x3, y = y3),fill="white")+
  geom_polygon(aes(x = x1+2, y = y1),fill="darkgrey")+geom_polygon(aes(x = x2+2, y = y2),fill="black")+geom_polygon(aes(x = x3+2, y = y3),fill="white")+
  geom_polygon(aes(x = x1+4, y = y1),fill="darkgrey")+geom_polygon(aes(x = x2+4, y = y2),fill="black")+geom_polygon(aes(x = x3+4, y = y3),fill="white")+
  geom_polygon(aes(x = x1+6, y = y1),fill="darkgrey")+geom_polygon(aes(x = x2+6, y = y2),fill="black")+geom_polygon(aes(x = x3+6, y = y3),fill="white")+
  geom_polygon(aes(x = x1+8, y = y1),fill="darkgrey")+geom_polygon(aes(x = x2+8, y = y2),fill="black")+geom_polygon(aes(x = x3+8, y = y3),fill="white")+
  geom_polygon(aes(x = x1+10, y = y1),fill="darkgrey")+geom_polygon(aes(x = x2+10, y = y2),fill="black")+geom_polygon(aes(x = x3+10, y = y3),fill="white")+
  #Shift Up & Right
  geom_polygon(aes(x = x1+1, y = y1+2),fill="darkgrey")+geom_polygon(aes(x = x2+1, y = y2+2),fill="black")+geom_polygon(aes(x = x3+1, y = y3+2),fill="white")+
  geom_polygon(aes(x = x1+3, y = y1+2),fill="darkgrey")+geom_polygon(aes(x = x2+3, y = y2+2),fill="black")+geom_polygon(aes(x = x3+3, y = y3+2),fill="white")+
  geom_polygon(aes(x = x1+5, y = y1+2),fill="darkgrey")+geom_polygon(aes(x = x2+5, y = y2+2),fill="black")+geom_polygon(aes(x = x3+5, y = y3+2),fill="white")+
  geom_polygon(aes(x = x1+7, y = y1+2),fill="darkgrey")+geom_polygon(aes(x = x2+7, y = y2+2),fill="black")+geom_polygon(aes(x = x3+7, y = y3+2),fill="white")+
  geom_polygon(aes(x = x1+9, y = y1+2),fill="darkgrey")+geom_polygon(aes(x = x2+9, y = y2+2),fill="black")+geom_polygon(aes(x = x3+9, y = y3+2),fill="white")+
  geom_polygon(aes(x = x1+11, y = y1+2),fill="darkgrey")+geom_polygon(aes(x = x2+11, y = y2+2),fill="black")+geom_polygon(aes(x = x3+11, y = y3+2),fill="white")+
#Shift Down & Right - First Row Down
  geom_polygon(aes(x = x1+1, y = y1-2),fill="darkgrey")+geom_polygon(aes(x = x2+1, y = y2-2),fill="black")+geom_polygon(aes(x = x3+1, y = y3-2),fill="white")+
  geom_polygon(aes(x = x1+3, y = y1-2),fill="darkgrey")+geom_polygon(aes(x = x2+3, y = y2-2),fill="black")+geom_polygon(aes(x = x3+3, y = y3-2),fill="white")+
  geom_polygon(aes(x = x1+5, y = y1-2),fill="darkgrey")+geom_polygon(aes(x = x2+5, y = y2-2),fill="black")+geom_polygon(aes(x = x3+5, y = y3-2),fill="white")+
  geom_polygon(aes(x = x1+7, y = y1-2),fill="darkgrey")+geom_polygon(aes(x = x2+7, y = y2-2),fill="black")+geom_polygon(aes(x = x3+7, y = y3-2),fill="white")+
  geom_polygon(aes(x = x1+9, y = y1-2),fill="darkgrey")+geom_polygon(aes(x = x2+9, y = y2-2),fill="black")+geom_polygon(aes(x = x3+9, y = y3-2),fill="white")+
  geom_polygon(aes(x = x1+11, y = y1-2),fill="darkgrey")+geom_polygon(aes(x = x2+11, y = y2-2),fill="black")+geom_polygon(aes(x = x3+11, y = y3-2),fill="white")+
  #Shift Down  - Second Row Down
  geom_polygon(aes(x = x1, y = y1-4),fill="darkgrey")+geom_polygon(aes(x = x2, y = y2-4),fill="black")+geom_polygon(aes(x = x3, y = y3-4),fill="white")+
  geom_polygon(aes(x = x1+2, y = y1-4),fill="darkgrey")+geom_polygon(aes(x = x2+2, y = y2-4),fill="black")+geom_polygon(aes(x = x3+2, y = y3-4),fill="white")+
  geom_polygon(aes(x = x1+4, y = y1-4),fill="darkgrey")+geom_polygon(aes(x = x2+4, y = y2-4),fill="black")+geom_polygon(aes(x = x3+4, y = y3-4),fill="white")+
  geom_polygon(aes(x = x1+6, y = y1-4),fill="darkgrey")+geom_polygon(aes(x = x2+6, y = y2-4),fill="black")+geom_polygon(aes(x = x3+6, y = y3-4),fill="white")+
  geom_polygon(aes(x = x1+8, y = y1-4),fill="darkgrey")+geom_polygon(aes(x = x2+8, y = y2-4),fill="black")+geom_polygon(aes(x = x3+8, y = y3-4),fill="white")+
  geom_polygon(aes(x = x1+10, y = y1-4),fill="darkgrey")+geom_polygon(aes(x = x2+10, y = y2-4),fill="black")+geom_polygon(aes(x = x3+10, y = y3-4),fill="white")+
  #Shift Down  - Third Row Down
  geom_polygon(aes(x = x1+1, y = y1-6),fill="darkgrey")+geom_polygon(aes(x = x2+1, y = y2-6),fill="black")+geom_polygon(aes(x = x3+1, y = y3-6),fill="white")+
  geom_polygon(aes(x = x1+3, y = y1-6),fill="darkgrey")+geom_polygon(aes(x = x2+3, y = y2-6),fill="black")+geom_polygon(aes(x = x3+3, y = y3-6),fill="white")+
  geom_polygon(aes(x = x1+5, y = y1-6),fill="darkgrey")+geom_polygon(aes(x = x2+5, y = y2-6),fill="black")+geom_polygon(aes(x = x3+5, y = y3-6),fill="white")+
  geom_polygon(aes(x = x1+7, y = y1-6),fill="darkgrey")+geom_polygon(aes(x = x2+7, y = y2-6),fill="black")+geom_polygon(aes(x = x3+7, y = y3-6),fill="white")+
  geom_polygon(aes(x = x1+9, y = y1-6),fill="darkgrey")+geom_polygon(aes(x = x2+9, y = y2-6),fill="black")+geom_polygon(aes(x = x3+9, y = y3-6),fill="white")+
  geom_polygon(aes(x = x1+11, y = y1-6),fill="darkgrey")+geom_polygon(aes(x = x2+11, y = y2-6),fill="black")+geom_polygon(aes(x = x3+11, y = y3-6),fill="white")+
  #Shift Down  - Fourth Row Down
  geom_polygon(aes(x = x1, y = y1-8),fill="darkgrey")+geom_polygon(aes(x = x2, y = y2-8),fill="black")+geom_polygon(aes(x = x3, y = y3-8),fill="white")+
  geom_polygon(aes(x = x1+2, y = y1-8),fill="darkgrey")+geom_polygon(aes(x = x2+2, y = y2-8),fill="black")+geom_polygon(aes(x = x3+2, y = y3-8),fill="white")+
  geom_polygon(aes(x = x1+4, y = y1-8),fill="darkgrey")+geom_polygon(aes(x = x2+4, y = y2-8),fill="black")+geom_polygon(aes(x = x3+4, y = y3-8),fill="white")+
  geom_polygon(aes(x = x1+6, y = y1-8),fill="darkgrey")+geom_polygon(aes(x = x2+6, y = y2-8),fill="black")+geom_polygon(aes(x = x3+6, y = y3-8),fill="white")+
  geom_polygon(aes(x = x1+8, y = y1-8),fill="darkgrey")+geom_polygon(aes(x = x2+8, y = y2-8),fill="black")+geom_polygon(aes(x = x3+8, y = y3-8),fill="white")+
  geom_polygon(aes(x = x1+10, y = y1-8),fill="darkgrey")+geom_polygon(aes(x = x2+10, y = y2-8),fill="black")+geom_polygon(aes(x = x3+10, y = y3-8),fill="white")+
  #Shift Down  - Fifth Row Down
  geom_polygon(aes(x = x1+1, y = y1-10),fill="darkgrey")+geom_polygon(aes(x = x2+1, y = y2-10),fill="black")+geom_polygon(aes(x = x3+1, y = y3-10),fill="white")+
  geom_polygon(aes(x = x1+3, y = y1-10),fill="darkgrey")+geom_polygon(aes(x = x2+3, y = y2-10),fill="black")+geom_polygon(aes(x = x3+3, y = y3-10),fill="white")+
  geom_polygon(aes(x = x1+5, y = y1-10),fill="darkgrey")+geom_polygon(aes(x = x2+5, y = y2-10),fill="black")+geom_polygon(aes(x = x3+5, y = y3-10),fill="white")+
  geom_polygon(aes(x = x1+7, y = y1-10),fill="darkgrey")+geom_polygon(aes(x = x2+7, y = y2-10),fill="black")+geom_polygon(aes(x = x3+7, y = y3-10),fill="white")+
  geom_polygon(aes(x = x1+9, y = y1-10),fill="darkgrey")+geom_polygon(aes(x = x2+9, y = y2-10),fill="black")+geom_polygon(aes(x = x3+9, y = y3-10),fill="white")+
  geom_polygon(aes(x = x1+11, y = y1-10),fill="darkgrey")+geom_polygon(aes(x = x2+11, y = y2-10),fill="black")+geom_polygon(aes(x = x3+11, y = y3-10),fill="white")+
  #Shift Down  - Third Row Down
  geom_polygon(aes(x = x1, y = y1-12),fill="darkgrey")+geom_polygon(aes(x = x2, y = y2-12),fill="black")+geom_polygon(aes(x = x3, y = y3-12),fill="white")+
  geom_polygon(aes(x = x1+2, y = y1-12),fill="darkgrey")+geom_polygon(aes(x = x2+2, y = y2-12),fill="black")+geom_polygon(aes(x = x3+2, y = y3-12),fill="white")+
  geom_polygon(aes(x = x1+4, y = y1-12),fill="darkgrey")+geom_polygon(aes(x = x2+4, y = y2-12),fill="black")+geom_polygon(aes(x = x3+4, y = y3-12),fill="white")+
  geom_polygon(aes(x = x1+6, y = y1-12),fill="darkgrey")+geom_polygon(aes(x = x2+6, y = y2-12),fill="black")+geom_polygon(aes(x = x3+6, y = y3-12),fill="white")+
  geom_polygon(aes(x = x1+8, y = y1-12),fill="darkgrey")+geom_polygon(aes(x = x2+8, y = y2-12),fill="black")+geom_polygon(aes(x = x3+8, y = y3-12),fill="white")+
  geom_polygon(aes(x = x1+10, y = y1-12),fill="darkgrey")+geom_polygon(aes(x = x2+10, y = y2-12),fill="black")+geom_polygon(aes(x = x3+10, y = y3-12),fill="white")+
  xlim(-5,15)+
  ylim(-15,5)

Shifting the light source again

Now the light appears to come from the right…

ggplot(cuboid) + 
  geom_polygon(aes(x = x1, y = y1),fill="darkgrey")+geom_polygon(aes(x = x2, y = y2),fill="white")+geom_polygon(aes(x = x3, y = y3),fill="black")+
  geom_polygon(aes(x = x1+2, y = y1),fill="darkgrey")+geom_polygon(aes(x = x2+2, y = y2),fill="white")+geom_polygon(aes(x = x3+2, y = y3),fill="black")+
  geom_polygon(aes(x = x1+4, y = y1),fill="darkgrey")+geom_polygon(aes(x = x2+4, y = y2),fill="white")+geom_polygon(aes(x = x3+4, y = y3),fill="black")+
  geom_polygon(aes(x = x1+6, y = y1),fill="darkgrey")+geom_polygon(aes(x = x2+6, y = y2),fill="white")+geom_polygon(aes(x = x3+6, y = y3),fill="black")+
  geom_polygon(aes(x = x1+8, y = y1),fill="darkgrey")+geom_polygon(aes(x = x2+8, y = y2),fill="white")+geom_polygon(aes(x = x3+8, y = y3),fill="black")+
  geom_polygon(aes(x = x1+10, y = y1),fill="darkgrey")+geom_polygon(aes(x = x2+10, y = y2),fill="white")+geom_polygon(aes(x = x3+10, y = y3),fill="black")+
  #Shift Up & Right
  geom_polygon(aes(x = x1+1, y = y1+2),fill="darkgrey")+geom_polygon(aes(x = x2+1, y = y2+2),fill="white")+geom_polygon(aes(x = x3+1, y = y3+2),fill="black")+
  geom_polygon(aes(x = x1+3, y = y1+2),fill="darkgrey")+geom_polygon(aes(x = x2+3, y = y2+2),fill="white")+geom_polygon(aes(x = x3+3, y = y3+2),fill="black")+
  geom_polygon(aes(x = x1+5, y = y1+2),fill="darkgrey")+geom_polygon(aes(x = x2+5, y = y2+2),fill="white")+geom_polygon(aes(x = x3+5, y = y3+2),fill="black")+
  geom_polygon(aes(x = x1+7, y = y1+2),fill="darkgrey")+geom_polygon(aes(x = x2+7, y = y2+2),fill="white")+geom_polygon(aes(x = x3+7, y = y3+2),fill="black")+
  geom_polygon(aes(x = x1+9, y = y1+2),fill="darkgrey")+geom_polygon(aes(x = x2+9, y = y2+2),fill="white")+geom_polygon(aes(x = x3+9, y = y3+2),fill="black")+
  geom_polygon(aes(x = x1+11, y = y1+2),fill="darkgrey")+geom_polygon(aes(x = x2+11, y = y2+2),fill="white")+geom_polygon(aes(x = x3+11, y = y3+2),fill="black")+
#Shift Down & Right - First Row Down
  geom_polygon(aes(x = x1+1, y = y1-2),fill="darkgrey")+geom_polygon(aes(x = x2+1, y = y2-2),fill="white")+geom_polygon(aes(x = x3+1, y = y3-2),fill="black")+
  geom_polygon(aes(x = x1+3, y = y1-2),fill="darkgrey")+geom_polygon(aes(x = x2+3, y = y2-2),fill="white")+geom_polygon(aes(x = x3+3, y = y3-2),fill="black")+
  geom_polygon(aes(x = x1+5, y = y1-2),fill="darkgrey")+geom_polygon(aes(x = x2+5, y = y2-2),fill="white")+geom_polygon(aes(x = x3+5, y = y3-2),fill="black")+
  geom_polygon(aes(x = x1+7, y = y1-2),fill="darkgrey")+geom_polygon(aes(x = x2+7, y = y2-2),fill="white")+geom_polygon(aes(x = x3+7, y = y3-2),fill="black")+
  geom_polygon(aes(x = x1+9, y = y1-2),fill="darkgrey")+geom_polygon(aes(x = x2+9, y = y2-2),fill="white")+geom_polygon(aes(x = x3+9, y = y3-2),fill="black")+
  geom_polygon(aes(x = x1+11, y = y1-2),fill="darkgrey")+geom_polygon(aes(x = x2+11, y = y2-2),fill="white")+geom_polygon(aes(x = x3+11, y = y3-2),fill="black")+
  #Shift Down  - Second Row Down
  geom_polygon(aes(x = x1, y = y1-4),fill="darkgrey")+geom_polygon(aes(x = x2, y = y2-4),fill="white")+geom_polygon(aes(x = x3, y = y3-4),fill="black")+
  geom_polygon(aes(x = x1+2, y = y1-4),fill="darkgrey")+geom_polygon(aes(x = x2+2, y = y2-4),fill="white")+geom_polygon(aes(x = x3+2, y = y3-4),fill="black")+
  geom_polygon(aes(x = x1+4, y = y1-4),fill="darkgrey")+geom_polygon(aes(x = x2+4, y = y2-4),fill="white")+geom_polygon(aes(x = x3+4, y = y3-4),fill="black")+
  geom_polygon(aes(x = x1+6, y = y1-4),fill="darkgrey")+geom_polygon(aes(x = x2+6, y = y2-4),fill="white")+geom_polygon(aes(x = x3+6, y = y3-4),fill="black")+
  geom_polygon(aes(x = x1+8, y = y1-4),fill="darkgrey")+geom_polygon(aes(x = x2+8, y = y2-4),fill="white")+geom_polygon(aes(x = x3+8, y = y3-4),fill="black")+
  geom_polygon(aes(x = x1+10, y = y1-4),fill="darkgrey")+geom_polygon(aes(x = x2+10, y = y2-4),fill="white")+geom_polygon(aes(x = x3+10, y = y3-4),fill="black")+
  #Shift Down  - Third Row Down
  geom_polygon(aes(x = x1+1, y = y1-6),fill="darkgrey")+geom_polygon(aes(x = x2+1, y = y2-6),fill="white")+geom_polygon(aes(x = x3+1, y = y3-6),fill="black")+
  geom_polygon(aes(x = x1+3, y = y1-6),fill="darkgrey")+geom_polygon(aes(x = x2+3, y = y2-6),fill="white")+geom_polygon(aes(x = x3+3, y = y3-6),fill="black")+
  geom_polygon(aes(x = x1+5, y = y1-6),fill="darkgrey")+geom_polygon(aes(x = x2+5, y = y2-6),fill="white")+geom_polygon(aes(x = x3+5, y = y3-6),fill="black")+
  geom_polygon(aes(x = x1+7, y = y1-6),fill="darkgrey")+geom_polygon(aes(x = x2+7, y = y2-6),fill="white")+geom_polygon(aes(x = x3+7, y = y3-6),fill="black")+
  geom_polygon(aes(x = x1+9, y = y1-6),fill="darkgrey")+geom_polygon(aes(x = x2+9, y = y2-6),fill="white")+geom_polygon(aes(x = x3+9, y = y3-6),fill="black")+
  geom_polygon(aes(x = x1+11, y = y1-6),fill="darkgrey")+geom_polygon(aes(x = x2+11, y = y2-6),fill="white")+geom_polygon(aes(x = x3+11, y = y3-6),fill="black")+
  #Shift Down  - Fourth Row Down
  geom_polygon(aes(x = x1, y = y1-8),fill="darkgrey")+geom_polygon(aes(x = x2, y = y2-8),fill="white")+geom_polygon(aes(x = x3, y = y3-8),fill="black")+
  geom_polygon(aes(x = x1+2, y = y1-8),fill="darkgrey")+geom_polygon(aes(x = x2+2, y = y2-8),fill="white")+geom_polygon(aes(x = x3+2, y = y3-8),fill="black")+
  geom_polygon(aes(x = x1+4, y = y1-8),fill="darkgrey")+geom_polygon(aes(x = x2+4, y = y2-8),fill="white")+geom_polygon(aes(x = x3+4, y = y3-8),fill="black")+
  geom_polygon(aes(x = x1+6, y = y1-8),fill="darkgrey")+geom_polygon(aes(x = x2+6, y = y2-8),fill="white")+geom_polygon(aes(x = x3+6, y = y3-8),fill="black")+
  geom_polygon(aes(x = x1+8, y = y1-8),fill="darkgrey")+geom_polygon(aes(x = x2+8, y = y2-8),fill="white")+geom_polygon(aes(x = x3+8, y = y3-8),fill="black")+
  geom_polygon(aes(x = x1+10, y = y1-8),fill="darkgrey")+geom_polygon(aes(x = x2+10, y = y2-8),fill="white")+geom_polygon(aes(x = x3+10, y = y3-8),fill="black")+
  #Shift Down  - Fifth Row Down
  geom_polygon(aes(x = x1+1, y = y1-10),fill="darkgrey")+geom_polygon(aes(x = x2+1, y = y2-10),fill="white")+geom_polygon(aes(x = x3+1, y = y3-10),fill="black")+
  geom_polygon(aes(x = x1+3, y = y1-10),fill="darkgrey")+geom_polygon(aes(x = x2+3, y = y2-10),fill="white")+geom_polygon(aes(x = x3+3, y = y3-10),fill="black")+
  geom_polygon(aes(x = x1+5, y = y1-10),fill="darkgrey")+geom_polygon(aes(x = x2+5, y = y2-10),fill="white")+geom_polygon(aes(x = x3+5, y = y3-10),fill="black")+
  geom_polygon(aes(x = x1+7, y = y1-10),fill="darkgrey")+geom_polygon(aes(x = x2+7, y = y2-10),fill="white")+geom_polygon(aes(x = x3+7, y = y3-10),fill="black")+
  geom_polygon(aes(x = x1+9, y = y1-10),fill="darkgrey")+geom_polygon(aes(x = x2+9, y = y2-10),fill="white")+geom_polygon(aes(x = x3+9, y = y3-10),fill="black")+
  geom_polygon(aes(x = x1+11, y = y1-10),fill="darkgrey")+geom_polygon(aes(x = x2+11, y = y2-10),fill="white")+geom_polygon(aes(x = x3+11, y = y3-10),fill="black")+
  #Shift Down  - Third Row Down
  geom_polygon(aes(x = x1, y = y1-12),fill="darkgrey")+geom_polygon(aes(x = x2, y = y2-12),fill="white")+geom_polygon(aes(x = x3, y = y3-12),fill="black")+
  geom_polygon(aes(x = x1+2, y = y1-12),fill="darkgrey")+geom_polygon(aes(x = x2+2, y = y2-12),fill="white")+geom_polygon(aes(x = x3+2, y = y3-12),fill="black")+
  geom_polygon(aes(x = x1+4, y = y1-12),fill="darkgrey")+geom_polygon(aes(x = x2+4, y = y2-12),fill="white")+geom_polygon(aes(x = x3+4, y = y3-12),fill="black")+
  geom_polygon(aes(x = x1+6, y = y1-12),fill="darkgrey")+geom_polygon(aes(x = x2+6, y = y2-12),fill="white")+geom_polygon(aes(x = x3+6, y = y3-12),fill="black")+
  geom_polygon(aes(x = x1+8, y = y1-12),fill="darkgrey")+geom_polygon(aes(x = x2+8, y = y2-12),fill="white")+geom_polygon(aes(x = x3+8, y = y3-12),fill="black")+
  geom_polygon(aes(x = x1+10, y = y1-12),fill="darkgrey")+geom_polygon(aes(x = x2+10, y = y2-12),fill="white")+geom_polygon(aes(x = x3+10, y = y3-12),fill="black")+
  xlim(-5,15)+
  ylim(-15,5)

Cuboid Tessellations: Shrunken by a factor of 3

The above cuboid Tessellations is shrunken by a factor of 3 by dividing the X cordinates, Y coordinates, and transformation values by 3.

ggplot(cuboid) + 
  geom_polygon(aes(x = (x1/3), y = (y1/3)),fill="white")+geom_polygon(aes(x = (x2/3), y = (y2/3)),fill="black")+geom_polygon(aes(x = (x3/3), y = (y3/3)),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+2/3, y = (y1/3)),fill="white")+geom_polygon(aes(x = (x2/3)+2/3, y = (y2/3)),fill="black")+geom_polygon(aes(x = (x3/3)+2/3, y = (y3/3)),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+4/3, y = (y1/3)),fill="white")+geom_polygon(aes(x = (x2/3)+4/3, y = (y2/3)),fill="black")+geom_polygon(aes(x = (x3/3)+4/3, y = (y3/3)),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+6/3, y = (y1/3)),fill="white")+geom_polygon(aes(x = (x2/3)+6/3, y = (y2/3)),fill="black")+geom_polygon(aes(x = (x3/3)+6/3, y = (y3/3)),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+8/3, y = (y1/3)),fill="white")+geom_polygon(aes(x = (x2/3)+8/3, y = (y2/3)),fill="black")+geom_polygon(aes(x = (x3/3)+8/3, y = (y3/3)),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+10/3,y = (y1/3)),fill="white")+geom_polygon(aes(x = (x2/3)+10/3, y = (y2/3)),fill="black")+geom_polygon(aes(x = (x3/3)+10/3, y = (y3/3)),fill="darkgrey")+
  #Shift Up & Right
  geom_polygon(aes(x = (x1/3)+1/3, y = (y1/3)+2/3),fill="white")+geom_polygon(aes(x = (x2/3)+1/3, y = (y2/3)+2/3),fill="black")+geom_polygon(aes(x = (x3/3)+1/3, y = (y3/3)+2/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+3/3, y = (y1/3)+2/3),fill="white")+geom_polygon(aes(x = (x2/3)+3/3, y = (y2/3)+2/3),fill="black")+geom_polygon(aes(x = (x3/3)+3/3, y = (y3/3)+2/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+5/3, y = (y1/3)+2/3),fill="white")+geom_polygon(aes(x = (x2/3)+5/3, y = (y2/3)+2/3),fill="black")+geom_polygon(aes(x = (x3/3)+5/3, y = (y3/3)+2/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+7/3, y = (y1/3)+2/3),fill="white")+geom_polygon(aes(x = (x2/3)+7/3, y = (y2/3)+2/3),fill="black")+geom_polygon(aes(x = (x3/3)+7/3, y = (y3/3)+2/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+9/3, y = (y1/3)+2/3),fill="white")+geom_polygon(aes(x = (x2/3)+9/3, y = (y2/3)+2/3),fill="black")+geom_polygon(aes(x = (x3/3)+9/3, y = (y3/3)+2/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+11/3, y = (y1/3)+2/3),fill="white")+geom_polygon(aes(x = (x2/3)+11/3, y = (y2/3)+2/3),fill="black")+geom_polygon(aes(x = (x3/3)+11/3, y = (y3/3)+2/3),fill="darkgrey")+
#Shift Down & Right - First Row Down
  geom_polygon(aes(x = (x1/3)+1/3, y = (y1/3)-2/3),fill="white")+geom_polygon(aes(x = (x2/3)+1/3, y = (y2/3)-2/3),fill="black")+geom_polygon(aes(x = (x3/3)+1/3, y = (y3/3)-2/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+3/3, y = (y1/3)-2/3),fill="white")+geom_polygon(aes(x = (x2/3)+3/3, y = (y2/3)-2/3),fill="black")+geom_polygon(aes(x = (x3/3)+3/3, y = (y3/3)-2/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+5/3, y = (y1/3)-2/3),fill="white")+geom_polygon(aes(x = (x2/3)+5/3, y = (y2/3)-2/3),fill="black")+geom_polygon(aes(x = (x3/3)+5/3, y = (y3/3)-2/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+7/3, y = (y1/3)-2/3),fill="white")+geom_polygon(aes(x = (x2/3)+7/3, y = (y2/3)-2/3),fill="black")+geom_polygon(aes(x = (x3/3)+7/3, y = (y3/3)-2/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+9/3, y = (y1/3)-2/3),fill="white")+geom_polygon(aes(x = (x2/3)+9/3, y = (y2/3)-2/3),fill="black")+geom_polygon(aes(x = (x3/3)+9/3, y = (y3/3)-2/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+11/3, y = (y1/3)-2/3),fill="white")+geom_polygon(aes(x = (x2/3)+11/3, y = (y2/3)-2/3),fill="black")+geom_polygon(aes(x = (x3/3)+11/3, y = (y3/3)-2/3),fill="darkgrey")+
  #Shift Down  - Second Row Down
  geom_polygon(aes(x = (x1/3), y = (y1/3)-4/3),fill="white")+geom_polygon(aes(x = (x2/3), y = (y2/3)-4/3),fill="black")+geom_polygon(aes(x = (x3/3), y = (y3/3)-4/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+2/3, y = (y1/3)-4/3),fill="white")+geom_polygon(aes(x = (x2/3)+2/3, y = (y2/3)-4/3),fill="black")+geom_polygon(aes(x = (x3/3)+2/3, y = (y3/3)-4/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+4/3, y = (y1/3)-4/3),fill="white")+geom_polygon(aes(x = (x2/3)+4/3, y = (y2/3)-4/3),fill="black")+geom_polygon(aes(x = (x3/3)+4/3, y = (y3/3)-4/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+6/3, y = (y1/3)-4/3),fill="white")+geom_polygon(aes(x = (x2/3)+6/3, y = (y2/3)-4/3),fill="black")+geom_polygon(aes(x = (x3/3)+6/3, y = (y3/3)-4/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+8/3, y = (y1/3)-4/3),fill="white")+geom_polygon(aes(x = (x2/3)+8/3, y = (y2/3)-4/3),fill="black")+geom_polygon(aes(x = (x3/3)+8/3, y = (y3/3)-4/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+10/3, y = (y1/3)-4/3),fill="white")+geom_polygon(aes(x = (x2/3)+10/3, y = (y2/3)-4/3),fill="black")+geom_polygon(aes(x = (x3/3)+10/3, y = (y3/3)-4/3),fill="darkgrey")+
  #Shift Down  - Third Row Down
  geom_polygon(aes(x = (x1/3)+1/3, y = (y1/3)-6/3),fill="white")+geom_polygon(aes(x = (x2/3)+1/3, y = (y2/3)-6/3),fill="black")+geom_polygon(aes(x = (x3/3)+1/3, y = (y3/3)-6/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+3/3, y = (y1/3)-6/3),fill="white")+geom_polygon(aes(x = (x2/3)+3/3, y = (y2/3)-6/3),fill="black")+geom_polygon(aes(x = (x3/3)+3/3, y = (y3/3)-6/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+5/3, y = (y1/3)-6/3),fill="white")+geom_polygon(aes(x = (x2/3)+5/3, y = (y2/3)-6/3),fill="black")+geom_polygon(aes(x = (x3/3)+5/3, y = (y3/3)-6/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+7/3, y = (y1/3)-6/3),fill="white")+geom_polygon(aes(x = (x2/3)+7/3, y = (y2/3)-6/3),fill="black")+geom_polygon(aes(x = (x3/3)+7/3, y = (y3/3)-6/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+9/3, y = (y1/3)-6/3),fill="white")+geom_polygon(aes(x = (x2/3)+9/3, y = (y2/3)-6/3),fill="black")+geom_polygon(aes(x = (x3/3)+9/3, y = (y3/3)-6/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+11/3, y = (y1/3)-6/3),fill="white")+geom_polygon(aes(x = (x2/3)+11/3, y = (y2/3)-6/3),fill="black")+geom_polygon(aes(x = (x3/3)+11/3, y = (y3/3)-6/3),fill="darkgrey")+
  #Shift Down  - Fourth Row Down
  geom_polygon(aes(x = (x1/3),     y = (y1/3)-8/3),fill="white")+geom_polygon(aes(x = (x2/3), y = (y2/3)-8/3),fill="black")+geom_polygon(aes(x = (x3/3), y = (y3/3)-8/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+2/3, y = (y1/3)-8/3),fill="white")+geom_polygon(aes(x = (x2/3)+2/3, y = (y2/3)-8/3),fill="black")+geom_polygon(aes(x = (x3/3)+2/3, y = (y3/3)-8/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+4/3, y = (y1/3)-8/3),fill="white")+geom_polygon(aes(x = (x2/3)+4/3, y = (y2/3)-8/3),fill="black")+geom_polygon(aes(x = (x3/3)+4/3, y = (y3/3)-8/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+6/3, y = (y1/3)-8/3),fill="white")+geom_polygon(aes(x = (x2/3)+6/3, y = (y2/3)-8/3),fill="black")+geom_polygon(aes(x = (x3/3)+6/3, y = (y3/3)-8/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+8/3, y = (y1/3)-8/3),fill="white")+geom_polygon(aes(x = (x2/3)+8/3, y = (y2/3)-8/3),fill="black")+geom_polygon(aes(x = (x3/3)+8/3, y = (y3/3)-8/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+10/3, y = (y1/3)-8/3),fill="white")+geom_polygon(aes(x = (x2/3)+10/3, y = (y2/3)-8/3),fill="black")+geom_polygon(aes(x = (x3/3)+10/3, y = (y3/3)-8/3),fill="darkgrey")+
  #Shift Down  - Fifth Row Down
  geom_polygon(aes(x = (x1/3)+1/3, y = (y1/3)-10/3),fill="white")+geom_polygon(aes(x = (x2/3)+1/3, y = (y2/3)-10/3),fill="black")+geom_polygon(aes(x = (x3/3)+1/3, y = (y3/3)-10/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+3/3, y = (y1/3)-10/3),fill="white")+geom_polygon(aes(x = (x2/3)+3/3, y = (y2/3)-10/3),fill="black")+geom_polygon(aes(x = (x3/3)+3/3, y = (y3/3)-10/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+5/3, y = (y1/3)-10/3),fill="white")+geom_polygon(aes(x = (x2/3)+5/3, y = (y2/3)-10/3),fill="black")+geom_polygon(aes(x = (x3/3)+5/3, y = (y3/3)-10/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+7/3, y = (y1/3)-10/3),fill="white")+geom_polygon(aes(x = (x2/3)+7/3, y = (y2/3)-10/3),fill="black")+geom_polygon(aes(x = (x3/3)+7/3, y = (y3/3)-10/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+9/3, y = (y1/3)-10/3),fill="white")+geom_polygon(aes(x = (x2/3)+9/3, y = (y2/3)-10/3),fill="black")+geom_polygon(aes(x = (x3/3)+9/3, y = (y3/3)-10/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+11/3, y = (y1/3)-10/3),fill="white")+geom_polygon(aes(x = (x2/3)+11/3, y = (y2/3)-10/3),fill="black")+geom_polygon(aes(x = (x3/3)+11/3, y = (y3/3)-10/3),fill="darkgrey")+
  #Shift Down  - Third Row Down
  geom_polygon(aes(x = (x1/3), y = (y1/3)-12/3),fill="white")+geom_polygon(aes(x = (x2/3), y = (y2/3)-12/3),fill="black")+geom_polygon(aes(x = (x3/3), y = (y3/3)-12/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+2/3, y = (y1/3)-12/3),fill="white")+geom_polygon(aes(x = (x2/3)+2/3, y = (y2/3)-12/3),fill="black")+geom_polygon(aes(x = (x3/3)+2/3, y = (y3/3)-12/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+4/3, y = (y1/3)-12/3),fill="white")+geom_polygon(aes(x = (x2/3)+4/3, y = (y2/3)-12/3),fill="black")+geom_polygon(aes(x = (x3/3)+4/3, y = (y3/3)-12/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+6/3, y = (y1/3)-12/3),fill="white")+geom_polygon(aes(x = (x2/3)+6/3, y = (y2/3)-12/3),fill="black")+geom_polygon(aes(x = (x3/3)+6/3, y = (y3/3)-12/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+8/3, y = (y1/3)-12/3),fill="white")+geom_polygon(aes(x = (x2/3)+8/3, y = (y2/3)-12/3),fill="black")+geom_polygon(aes(x = (x3/3)+8/3, y = (y3/3)-12/3),fill="darkgrey")+
  geom_polygon(aes(x = (x1/3)+10/3, y = (y1/3)-12/3),fill="white")+geom_polygon(aes(x = (x2/3)+10/3, y = (y2/3)-12/3),fill="black")+geom_polygon(aes(x = (x3/3)+10/3, y = (y3/3)-12/3),fill="darkgrey")+
  xlim(-5,15)+
  ylim(-15,5)

Heart Tessellations

This is an earlier attempt at a Tessellations - The heart shape does not readily lend itself to a continuous pattern without gaps when shifted vertically, so this idea was tossed out and I switched to the cuboid Tessellations above.

dat<- data.frame(t=seq(0, 2*pi, by=0.1) )
 xhrt <- function(t) 16*sin(t)^3
 yhrt <- function(t) 13*cos(t)-5*cos(2*t)-2*cos(3*t)-cos(4*t)
 dat$y=yhrt(dat$t)
 dat$x=xhrt(dat$t)
 with(dat, plot(x,y, type="l"))

 heartwidth<-max(dat$x)-min(dat$x)
 heartlength<-max(dat$y)-min(dat$y)
 

dat%>%
ggplot()+
  #First Row
  geom_polygon(aes(x=x, y=y), fill="darkred")+
  geom_polygon(aes(x=x+heartwidth, y=y), fill="darkred")+ #Shift Right 1 heart width
  geom_polygon(aes(x=x+(2*heartwidth), y=y),fill="darkred")+ #Shift Right 2 heart width
  geom_polygon(aes(x=x+(3*heartwidth), y=y),fill="darkred")+ #Shift Right 3 heart width
  geom_polygon(aes(x=x+(4*heartwidth), y=y),fill="darkred")+ #Shift Right 4 heart width
  
        #Flip Upside Down & Shift Right 50%
        geom_polygon(aes(x=x+(heartwidth/2), y=-y-13), fill="darkblue")+
        geom_polygon(aes(x=x+(1.5*heartwidth), y=-y-13), fill="darkblue")+ #Shift Right 1 heart width
        geom_polygon(aes(x=x+(2.5*heartwidth), y=-y-13),fill="darkblue")+ #Shift Right 2 heart width
        geom_polygon(aes(x=x+(3.5*heartwidth), y=-y-13),fill="darkblue")+ #Shift Right 3 heart width
        geom_polygon(aes(x=x+(4.5*heartwidth), y=-y-13),fill="darkblue")+ #Shift Right 4 heart width
 
  theme_minimal()

Written Notes

The cuboid tessilation is an attempt at reproducing MC Escher’s “little cube” tessellation.

The coodinates needed to be drawn for the base cuboid, and this shape had to be many times replicated, shifted & transformed in order to create the continuous pattern. The cuboid shape is among the simpler shapes that could be chosen for tessellation, because it leaves no unexplained gaps in the coordinate plane thanks to its simple geometric properties. The transformations, once the base cuboid is drawn, are very simple.

Shift to the right 1 full cube length, and shift down 1/2 of the cuboid length, in order to attach to the edges of the adjacent cuboid. These transformations are applied to each cuboid in order to create the continuous pattern.

In a separate coordinate plane, a shrunken version of this tesselation is presented. It is shrunken simply by dividing every coordinate from the above tesselation by 3. In addition to shrinking the coordiantes, the gaps/transformation values needed to be shrunken as well. If the original cuboid needed to be shifted right 1 unit and down .5 units in order to produce a continuous pattern, this tesselation would require that the cuboid be shifted right 1/3 units, and down .5/3 units in order to maintain continuity.

The Color of the sides of the cuboid are an essential element of this tessellation. It is what produces for the human eye the illusion of 3 dimensionality, as we perceive light to approach the cuboids from one direction, casting shadows on the other two visible sides. This aspect of the tesselation is what distinguishes it from being a simple geometric pattern, to being a piece of art - it interacts with the viewer in ways that are unexplained by geometry.