Setup

A1: (1, 1, 1)
A2: (-1, -1, -1)
A3: (1, -1, -1)
A4: (-1, 1, 1)
A5: (1, -1, 1)
A6: (-1, 1, -1)
A7: (1, 1, -1)
A8: (-1, -1, 1)
C: (0, 0, 0)
poly1, a3, a7, a1, a5 = Polygon(A3, A7, A1, A5)
poly2, f, a6, a4, g = Polygon(A7, A6, A4, A1)
poly3, h, a2, a8, i = Polygon(A6, A2, A8, A4)
poly4, j, k, l, m = Polygon(A2, A3, A5, A8)
poly5, n, p, q, r = Polygon(A8, A5, A1, A4)
P1, faceA3A7C_1, faceA1A7C_1, faceA1A5C_1, faceA3A5C_1, edgeA3C_1, edgeA7C_1, edgeA1C_1, edgeA5C_1 = Pyramid(poly1, C)
P2, faceA6A7C_1, faceA4A6C_1, faceA1A4C_1, faceA1A7C, edgeA7C_2, edgeA6C_1, edgeA4C_1, edgeA1C_2 = Pyramid(poly2, C)
P3, faceA2A6C_1, faceA2A8C_1, faceA4A8C_1, faceA4A6C, edgeA6C_2, edgeA2C_1, edgeA8C_1, edgeA4C_2 = Pyramid(poly3, C)
P4, faceA2A3C_1, faceA3A5C, faceA5A8C_1, faceA2A8C, edgeA2C_2, edgeA3C_2, edgeA5C_2, edgeA8C_2 = Pyramid(poly4, C)
P5, faceA5A8C, faceA1A5C, faceA1A4C, faceA4A8C, edgeA8C, edgeA5C, edgeA1C, edgeA4C = Pyramid(poly5, C)
t = 0.08 (slider from 0 to 3, step 0.01)
P1A = If(0 ≤ t ≤ 1, Translate[P1, Vector[(0, 0, 0), (t, 0, 0)]], If[1 < t ≤ 2, Rotate[Translate[P1, Vector[(0, 0, 0), (1, 0, 0)]], (π * (t - 1)), Line[(2, 0, 0), (2, 0, 1)]], Translate[Rotate[Translate[P1, Vector[(0, 0, 0), (1, 0, 0)]], π, Line[(2, 0, 0), (2, 0, 1)]], Vector[(0, 0, 0), ((-t) + 2, 0, 0)]]])
poly6, s, a, b, c = Polygon(A2, A3, A7, A6)
P6, faceA2A3C, faceA3A7C, faceA6A7C, faceA2A6C, edgeA2C, edgeA3C, edgeA7C, edgeA6C = Pyramid(poly6, C)
P2A = If(0 ≤ t ≤ 1, Translate[P2, Vector[(0, 0, 0), (0, t, 0)]], If[1 < t ≤ 2, Rotate[Translate[P2, Vector[(0, 0, 0), (0, 1, 0)]], (π * (t - 1)), Line[(0, 2, 0), (0, 2, 1)]], Translate[Rotate[Translate[P2, Vector[(0, 0, 0), (0, 1, 0)]], π, Line[(0, 2, 0), (0, 2, 1)]], Vector[(0, 0, 0), (0, (-t) + 2, 0)]]])
P3A = If(0 ≤ t ≤ 1, Translate[P3, Vector[(0, 0, 0), ((-t), 0, 0)]], If[1 < t ≤ 2, Rotate[Translate[P3, Vector[(0, 0, 0), (-1, 0, 0)]], (π * (t - 1)), Line[(-2, 0, 0), (-2, 0, 1)]], Translate[Rotate[Translate[P3, Vector[(0, 0, 0), (-1, 0, 0)]], π, Line[(-2, 0, 0), (-2, 0, 1)]], Vector[(0, 0, 0), (t - 2, 0, 0)]]])
P4A = If(0 ≤ t ≤ 1, Translate[P4, Vector[(0, 0, 0), (0, (-t), 0)]], If[1 < t ≤ 2, Rotate[Translate[P4, Vector[(0, 0, 0), (0, -1, 0)]], (π * (t - 1)), Line[(0, -2, 0), (0, -2, 1)]], Translate[Rotate[Translate[P4, Vector[(0, 0, 0), (0, -1, 0)]], π, Line[(0, -2, 0), (0, -2, 1)]], Vector[(0, 0, 0), (0, t - 2, 0)]]])
P5A = If(0 ≤ t ≤ 1, Translate[P5, Vector[(0, 0, 0), (0, 0, t)]], If[1 < t ≤ 2, Rotate[Translate[P5, Vector[(0, 0, 0), (0, 0, 1)]], (π * (t - 1)), Line[(0, 0, 2), (0, -1, 2)]], Translate[Rotate[Translate[P5, Vector[(0, 0, 0), (0, 0, 1)]], π, Line[(0, 0, 2), (0, -1, 2)]], Vector[(0, 0, 0), (0, 0, (-t) + 2)]]])
P6A = If(0 ≤ t ≤ 1, Translate[P6, Vector[(0, 0, 0), (0, 0, (-t))]], If[1 < t ≤ 2, Rotate[Translate[P6, Vector[(0, 0, 0), (0, 0, -1)]], (π * (t - 1)), Line[(0, 0, -2), (0, -1, -2)]], Translate[Rotate[Translate[P6, Vector[(0, 0, 0), (0, 0, -1)]], π, Line[(0, 0, -2), (0, -1, -2)]], Vector[(0, 0, 0), (0, 0, t - 2)]]])