This is my first post here, I have the following basic code for drawing an iterated function system fractal. It works to the third step, but then for the fourth iteration it freezes my old MacBook. I have not included the fourth iteration but it should be clear how to proceed. I reckon it has something to do with the way RegionPlot works. I am looking for an alternative or a way to make it quicker. I have also tried to use DiscretizeRegion to no effect.
ClearAll["Global`*"]
θ = ArcTan[1/2];
sqCreate[{x0_, y0_}, h_] := Rectangle[{x0, y0}, {x0 + h, y0 + h}];
simil[i_, sq_] := Which[
i == 1,
TransformedRegion[sq, AffineTransform[{1/√5 RotationMatrix[-θ],
{0, 1/√5}}]],
i == 2,
TransformedRegion[sq, AffineTransform[{1/√5 RotationMatrix[-θ],
{1/5 + 2/5, 1/√5 - 1/5 + 2/5}}]],
i == 3,
TransformedRegion[sq, AffineTransform[{1/√5 RotationMatrix[-θ],
{2/5 + 2/5, 1/√5 - 1/5 - 1/5}}]],
i == 4,
TransformedRegion[sq, AffineTransform[{1/√5 RotationMatrix[-θ],
{2/5 - 1/5, 1/√5 - 2/5 - 1/5}}]],
i == 5,
TransformedRegion[sq, AffineTransform[{1/√5 RotationMatrix[-θ],
{2/5, 1/√5 - 1/5}}]]
];
fullSimil[sq_] :=
RegionUnion[simil[1, sq], simil[2, sq], simil[3, sq], simil[4, sq],
simil[5, sq]];
set0 = sqCreate[{0, 0}, 1];
paint0 = Graphics[{Gray, set0}]
set1 = fullSimil[set0]
paint1 = RegionPlot[set1, PlotRange -> All]
set2 = fullSimil[set1];
paint2 = RegionPlot[set2, PlotRange -> {{0, 1.5}, {-0.5, 1}},
AspectRatio -> Automatic]
set3 = fullSimil[set2];
paint3 = RegionPlot[set3, PlotRange -> {{0, 1.5}, {-1, 1}},
AspectRatio -> Automatic]


Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign!
– Chris K Jan 04 '19 at 18:52