# My first Mathematica project code review, Dodecahedron

I thought of a project to get my feet wet with Mathematica and have completed it. If anyone finds time to look at the code and send some feedback I would appreciate it. If it's inappropriate to ask and you close this question, I will understand. It's important to me to learn how to write idiomatic code. This has been fun and I have already received lots of helpful suggestions here on SE. Here's a screen shot and a link to the notebook on dropbox.

• I'm not really qualified to critique, but I think everything looks fairly idiomatic to me, and the code is fairly readable. Otherwise, I think it's a really neat project! It's like a Rubik's dodecahedron. I think finding a project that you think is neat is a great way to learn a language, and this exploits some of the graphics and dynamic features that might be much more difficult in other languages. Commented May 7, 2020 at 3:58

I am not able to evaluate the OP's notebook, as it uses stuff that can't be parsed by version 11.2. Nevertheless, let me show a small demonstration of coloring a dodecahedron and adding lines to it, using the method from this answer, and the built-in PolyhedronData["Dodecahedron"]:

Graphics3D[{Directive[AbsoluteThickness[4], EdgeForm[AbsoluteThickness[4]]],
Transpose[{RandomSample[Lighter /@ {Yellow, Red, Green, Blue, Cyan, Gray,
Magenta, Brown, Orange, Pink,
Purple, White}],
First[Normal[N @ PolyhedronData["Dodecahedron",
"GraphicsComplex"]]] /.
Polygon[p_] :>
With[{sides = Partition[p, 2, 1, 1], ut = (15 - Sqrt[5])/22},
{Polygon[p],
{Black, Line[Transpose[{{1 - ut, ut}.# & /@ sides,
RotateLeft[{ut, 1 - ut}.# & /@
sides, 2]}]]
}}]}]}, Boxed -> False, Lighting -> "Neutral"]


You might be able to modify it for your actual demonstration.

• It works in the 12.1 Player. Do you know what I used to break 11.2? I would like my demo to work there also. I definitely want to study this. I thought there was a way to do this using the polyhedronData. Thanks again for another great answer! Commented May 7, 2020 at 14:22
• I don't doubt that it works in the current version. Nevertheless, I am providing an alternative that might still be useful, even in older versions. Commented May 7, 2020 at 14:35
• @shirha My guess would be Polygon. It received some updates in V12, so you might be calling it in a way that earlier versions don't understand. Commented May 7, 2020 at 18:29