createCanvas("picture");
borderWidth = 25;
startRadius is min(view_picture_width / 2, view_picture_height / 2) - borderWidth;
view_picture_offset is Point(view_picture_width / 2, startRadius + borderWidth);
nSides = 3;
fraction = 1/3;
baseShape is RegularPolygon(0, 0, startRadius, nSides, "blue");
smallerVersion is Scale(fraction, baseShape);
i = 0;
height = baseShape["vertices"][2]["y"];
angle is (i + 1) * 180 / nSides;
angle2 is i * 180 / nSides + (90 - 180 / nSides);
interiorAngle is (nSides - 2) * 180 / nSides;
newShape is CombinedRotation(angle, Point(0, 0), Point(0, 0), angle2 , height * (1 + fraction), [smallerVersion]);
optionalShape is (@ if (i == 2 && j > 1) else newShape);
newShapes is optionalShape with i is 0..(2 * nSides - 1);
j = 1;
recurse is newShapes if j <= 1 else recurse with j is j - 1, baseShape is newShapes;
recursion is recurse with j is 1..iterations;
iterations = 5;
picture is [baseShape] // recursion;
when (view_picture_height || view_picture_width) {
height = baseShape["vertices"][2]["y"];
}