Reduce Code Length
since the result of the new computation depends on the previous one we can use NestList
NestList[N@({0, 0, 0.5} +
RotationMatrix[45 Degree, {0, 0, 1}].Transpose[#])\[Transpose] &, n01, 18]
Another one using NestList:
tf = TranslationTransform[{0, 0, 0.5}].RotationTransform[45 Degree, {0, 0, 1}];
allPts = NestList[tf, n01, 18]
This is concise and I think it will perform a little better than the methods using Transpose
.
n01 =
N[{{5, 0, 0}, {6, 0, 0}, {6, 0, 1}, {6, 0, 2}, {5, 0, 2}, {4, 0, 2}, {4, 0, 1}, {4, 0, 0}, {5, 0, 0}}];
xform =
AffineTransform[{RotationMatrix[45. °, {0, 0, 1}], {0, 0, 0.5}}];
allPts = NestList[xform, n01, 18];
Short[allPts, 12]
{{{5., 0., 0.}, {6., 0., 0.}, {6., 0., 1.}, {6., 0., 2.}, {5., 0., 2.}, {4., 0., 2.}, {4., 0., 1.}, {4., 0., 0.}, {5., 0., 0.}}, <<17>>, {{0., 5., 9.}, {0., 6., 9.}, {0., 6., 10.}, {0., 6., 11.}, {0., 5., 11.}, {0., 4., 11.}, {0., 4., 10.}, {0., 4., 9.}, {0., 5., 9.}}}