Software

OpenScad describes geometric objects mathematically similarly than computer algebra systems. There are two articles in the book introducing OpenScad. The modeller can do things which computer algebra systems can not do well, like taking intersections of objects. Here is code which writes a OpenSCAD file from Mathematica:
```A=PolyhedronData["GreatRhombicosidodecahedron","Faces"];
points=10*A[[1]];  triangles = A[[2,1]]-1;
triangulate[a_]:=Table[{a[[1]],a[[k]],a[[k+1]]},{k,2,Length[a]-1}];
triangles=Map[triangulate,triangles];
newtriangles=Table[
```
And here is Mathematica code which generates all the semiregular polytopes in OpenScad:
```Archimedean[k_]:=Module[{a,s,n,c,S,M,rr},  c=5.0;
If[k<14,m=k;   a=PolyhedronData["Archimedean"];        s=PolyhedronData[a[[m]],"Faces"],
m=k-13;a=PolyhedronData["Archimedean","Dual"]; s=PolyhedronData[a[[m]],"Faces"]];
points=10*s[[1]];  triangles = s[[2,1]]-1;
triangulate[a_]:=Table[{a[[1]],a[[l]],a[[l+1]]},{l,2,Length[a]-1}];
triangles=Map[triangulate,triangles]; triangles=Partition[Flatten[triangles],3];
{points,triangles}];
{points,triangles}=Archimedean[kk];
WriteString[file,"polyhedron("];
WriteString[file,"points = "]; Write[file,N[points]];
WriteString[file,","];
WriteString[file,"triangles = "]; Write[file,triangles];
WriteString[file,");"] ];
```
We just have then to change brackets for all the files:
```for i in *.scad; do
cat  |tr "{" "["|tr "}" "]" >tmp; mv tmp ;
done
```
Png23D is an application which converts PNG images into OpenScad files is "png23d". Here is an example:
```png23d -t x -f surface -o stl -l 25 -d 20 -w 100 h.png h.stl
```
produces from a heights map a STL file, seen here in meshlab.