Polyedres
Author: Daniel Mentrard

e = 0.3 (slider from -5 to 5, step 0.01)
n = 8 (slider from 1 to 10, step 2)
mm: floor((3.0 * n - 2.0) / 6.0)
R = 2.3 (slider from -5 to 5, step 0.1)
k = 360 (slider from 0 to 360, step 1)
O = (1.0359149181011285, 0.5868703197090939)
Zoom = 1 (slider from 0.1 to 5, step 0.1)
Vues = (-1.8275478059019012, 0.4409307465451196)
ya: y(Vues)
costheta: cos(ya)
sintheta: sin(ya)
xa: x(Vues)
cosphi: cos(xa)
xy: -(Zoom) * cosphi * sintheta
sinphi: sin(xa)
B_1 = (-1.3985496100627461, -1.4947732623440741)
Z: (x(B_1) + Zoom * cosphi, y(B_1) + Zoom * sinphi * sintheta)
w = Vector(B_1, Z)
Y: (x(B_1), y(B_1) + Zoom * costheta)
v = Vector(B_1, Y)
X: (x(B_1) + Zoom * sinphi, y(B_1) + xy)
u = Vector(B_1, X)
g = 1 (slider from -5 to 5, step 0.1)
a = OrthogonalLine(Vues, yAxis)
b = OrthogonalLine(Vues, xAxis)
c: cos(ya)
h = 3.2 (slider from -5 to 5, step 0.1)
liste2 = Sequence((x(O), y(O)) + (R + e) * (sin(0.0°) * sin(360.0° / n * i) * w + cos(0.0°) * sin(360.0° / n * i) * u + cos(360.0° / n * i) * v), i, 0.0, n + mm)
liste1 = Sequence((x(O), y(O)) + R * (sin(0.0°) * sin(360.0° / n * i) * w + cos(0.0°) * sin(360.0° / n * i) * u + cos(360.0° / n * i) * v), i, 0.0, n + mm)
O'_1 = Translate(O, Vector[R * v])
f = 1 (slider from -5 to 15, step 1)
liste4 = Sequence(Segment[Element[liste2, i], Element[liste2, i + f]], i, 1.0, Length[liste1] + 2.0)
liste3 = Sequence(Segment[Element[liste1, i], Element[liste1, i + f]], i, 1.0, Length[liste1] + mm)
liste5 = Sequence(Polygon[Element[liste1, i], Element[liste1, i + f], Element[liste2, i + f], Element[liste2, i]], i, 0.0, n)
d = CurveCartesian(x(O - (R + e) * (0.0 * sin(i°) * w + sin(i°) * u - cos(i°) * v)), y(O - (R + e) * (0.0 * sin(i°) * w + sin(i°) * u - cos(i°) * v)), i, 0.0, k)
liste6 = Sequence(Sequence[O + R * cos(j°) * sin(i°) * u - R * cos(i°) * w + R * sin(j°) * sin(i°) * v, i, 0.0, 360.0, 360.0 / n], j, 0.0, 360.0, 360.0 / n)
liste7 = Sequence(Sequence[O + (R + e) * cos(j°) * sin(i°) * u - (R + e) * cos(i°) * w + (R + e) * sin(j°) * sin(i°) * v, i, 0.0, 360.0, 360.0 / n], j, 0.0, 360.0, 360.0 / n)
liste8 = Join(liste6)
liste9 = Sequence(Segment[Element[liste8, i], Element[liste8, i + f]], i, 1.0, Length[liste8] + mm)
liste10 = Join(liste7)
liste11 = Sequence(Polygon[Element[liste8, i], Element[liste8, i + f], Element[liste10, i + f], Element[liste10, i]], i, 0.0, Length[liste10])
liste12 = Sequence(Sequence[O + (R + e) * cos(j°) * sin(i°) * w - (R + e) * cos(i°) * v + (R + e) * sin(j°) * sin(i°) * u, i, 0.0, 360.0, 360.0 / n], j, 0.0, 360.0, 360.0 / n)
liste13 = Sequence(Sequence[O + R * cos(j°) * sin(i°) * w - R * cos(i°) * v + R * sin(j°) * sin(i°) * u, i, 0.0, 360.0, 360.0 / n], j, 0.0, 360.0, 360.0 / n)
liste14 = Join(liste12)
liste15 = Join(liste13)
liste16 = Sequence(Polygon[Element[liste14, i], Element[liste14, i + f], Element[liste15, i + f], Element[liste15, i]], i, 0.0, Length[liste15])
liste17 = Sequence(Sequence[O + (R + e) * cos(j°) * sin(i°) * u - (R + e) * cos(i°) * v + (R + e) * sin(j°) * sin(i°) * w, i, 0.0, 360.0, 360.0 / n], j, 0.0, 360.0, 360.0 / n)
liste18 = Sequence(Sequence[O + R * cos(j°) * sin(i°) * u - R * cos(i°) * v + R * sin(j°) * sin(i°) * w, i, 0.0, 360.0, 360.0 / n], j, 0.0, 360.0, 360.0 / n)
liste19 = Join(liste17)
liste20 = Join(liste18)
liste21 = Sequence(Polygon[Element[liste20, i], Element[liste20, i + f], Element[liste19, i + f], Element[liste19, i]], i, 0.0, Length[liste10])
liste22 = Sequence(Segment[Element[liste19, i], Element[liste19, i + f]], i, 1.0, Length[liste19] + mm)
liste23 = Sequence(Segment[Element[liste20, i], Element[liste20, i + f]], i, 1.0, Length[liste19] + mm)
liste24 = Sequence(Segment[Element[liste15, i], Element[liste15, i + f]], i, 1.0, Length[liste19] + mm)
liste25 = Sequence(Segment[Element[liste14, i], Element[liste14, i + f]], i, 1.0, Length[liste19] + mm)
liste26 = Sequence(Segment[Element[liste10, i], Element[liste10, i + f]], i, 1.0, Length[liste19] + mm)
liste27 = Sequence(Segment[Element[liste8, i], Element[liste8, i + f]], i, 1.0, Length[liste19] + mm)