Well, done! You got it working now. The two diagrams you posted explain the flow of the texture generation process very well. You basically wrote the documentation for it.
Time to go a bit more into the details:
First, in the povray.ini file the line:
+W1024 +H1024
controls the width and height of the rendered image, in pixels. As it stands it is set to 1024x1024.
You will notice in the Generate_Texture.py script in line 128:
outstring += 'object{surfface scale<1.33, 1, 1>}\n'
This scales the surface horizontally (the x-z plane is the horizontal, y is the vertical) so that the final texture has the same numbers of pixels horizontally and vertically. I found the 1.33 value by trial and error.
Feel free to modify the parameters in this line if you want to get a different shape, but it is a good idea to keep the value for the y-direction to 1:
scale<x_scale, 1, z_scale>
At the moment the surface is shifted and scaled vertically so that it takes values between 0 and 1 along the y-direction. This way it appears flat when seen from a narrow-angle camera located high above the surface (line 88 in Generate_Texture.py). Changing the y_scale can make perspective effects visible, so it is better to leave that value unchanged.
As for the color_map, at the moment it is defined as:
self.color_map = \
"""[0.0 color Green]
[0.125 color Blue]
[0.25 color Red]
[0.375 color Orange]
[0.5 color Sienna]
[0.625 color SteelBlue]
[0.75 color Cyan]
[0.875 color Yellow]
[1.0 color Magenta]"""
It specifies at each contour level (between 0 and 1) which color to use. POV-RAY will interpolate the RGB values between these levels. The predefined colors are specified in the colors.inc file of the POV-RAY installation. They can also be found here:
http://www.buckosoft.com/~dick/pov/colors.phpYou can specify the colors in rgb format, for example "color rgb<1, 0, 0>" or rgbf format, for example:
color_map {
[0.00, 0.33 color rgb <0, 0, 1>
color rgb <0, 0, 1>]
[0.33, 0.66 color rgbf <1, 1, 1, 1>
color rgbf <1, 1, 1, 1>]
[0.66, 1.00 color rgb <0, 0, 1>
color rgb <0, 0, 1>]
Again, very good documentation (for pigments, in general) can be found here:
http://www.povray.org/documentation/view/3.6.1/77/I still have to rewrite Generate_Texture.py to include the FFT as well.