I would like a grid generating script to use to show the coordinates of mathematical shapes. It needs to be displayed in the render so that the grid lines to appear to go through the object but to be able to see through the gaps between the grid lines (unlike add->mesh->grid). I'd like it to look like 3D graph paper with every 5th line slightly thicker and every 10th line in a different colour.
My first thought is to use edges for the grid lines, the advantage of this would be that the thickness of the grid lines would remain constant regardless of the amount that we zoom in.
So I tried using only edges with no faces at all, the results are shown on this page, unfortunately although it seems to work fine in the 3D window it does not render. I guess this is not surprising a edges don't seem to be compatible with raytracing.
Since I could not render edges on their own I have modified the experiment to form proper faces shown on this page. Then in the render options I enabled 'edge' but this did not do what I want at all, it just drew an edge around the whole mesh, not the individual faces.
In the third test (shown on this page) I tried adding a material node, associating all the faces to that, then setting the material to wireframe mode. As we can see this renders what we want:
Although this works I found it very difficult to control the thickness of the lines. The thickness seems to depend on the area of the face. Also it shows as a solid face in the 3D view.
I therefore went back to making the grid lines from rectangular faces (shown on this page) This gives most control over the colour, thickness and transparency of the lines but it does not meet the requirement of being independent of the zoom level. This mean that we have to tweak the thickness of the lines depending on the zoom level.
The next stage is to include a numeric scale on the grid and also t text designation of each axis.