Well work and home got in the way yesterday but I finally finished and wrote it up late. I pre-calculated all the transforms as well and that saved a ton of time. Part 2 ran in 3.4s for me, so not terrible. I probably do a lot more slicing and dicing than I needed to. Splitting the grid was the hardest part for me but I eventually settled on two infix functions to split into rows and then groups of rows into columns and that was easier for me to comprehend. I won't post the code since it was yesterday but it's in my repo
https://github.com/tginsberg/advent-2017-kotlin