And why does Thingiverse need another set of polyhedral dice? No particular reason. I got captivated by the problem of creating polyhedra in OpenSCAD using intersections of solids, so this particular set of modules is done that way, with the exception of the tetrahedron, for which intersections of other solids seems rather pointless (no pun intended. . . well, okay, maybe). Is there a reason to prefer this method over those using the polyhedron() statement with lists of points? Not really. The code is shorter and easier to read. But envisioning intersecting polyhedra is not exactly intuitive. In fact, one of the reasons for posting this is that I could not find an OpenSCAD model for an icosohedron as the intersection of five octahedra, so I had to come up with one myself, and here it is.
The use of the text() statement in the source code requires OpenSCAD 2015.03.
The placement of text uses the same iterative rotations as the intersections, which is used to ensure that the numbers on opposite sides of a die add up to the number of faces on the die + 1. Again, no particular reason to do this other than as a proof-of-concept and to show the method.
I looked up solutions to the problem of creating regular polyhedra by intersecting other polyhedra; some solutions in OpenSCAD exist, and I made use of them, but I could not find a solution for the icosahedron and had to come up with one myself.