Mark Dow

Geek art

L-system programs and code

    Most of the images and documentation graphics in the Simple recursive systems and fractal patterns pages are produced with a single program, L_system_tiling, and a few with L_system_3D_tiling, written in MATLAB.

L_system_tiling
L_system_3D_tiling
dft_of_image


L_system_tiling

     These files as a group can be used to generate any variation of 2-D block replacement (D0L) L-systems and tilings. Symbols are represented by grayscale pixels or replaced by a set of motifs. See header of  L_system_tiling.m for details.

All files (unzip to a single directory).

L_system_tiling_2009-04-30.zip

[To Do: Also required is dft_of_image.m which isn't currently in the .zip file.]

The main function that defines the L-system:

L_system_tiling.m                           

Auxilliary functions (required, in same directory):

make_image_pyramid.m
get_number_pairs.m
add_alternating_pairs.m
get_rule_symmetries.m
dft_of_image.m

interp1_fa.m
interp2_fa.m

Auxilliary graphics (required, in same directory):

LS_rule_graphic_1.png       
LS_rule_graphic_2.png

LS_rule_graphic_3.png
 

Scale_symmetry_L_8.png
Scale_symmetry_U_8.png
Scale_symmetry_C_8.png
Scale_symmetry_F_8.png
Scale_symmetry_O_8.png

[To Do: There are more graphics that may be required. They are all in the .zip file above, but I need to sort out which are actually needed.]

    Usage example:

At the Matlab prompt (>>),

>> L_system_tiling( 'TM', 4, 2, 1, 0, 'ColorDiagMotif.png', 0, [0 1; 1 0], [1 0; 0 1] );

results in these three images:
Example of L_system_tiling.m's output
The images are a graphic depiction of the L-system rules and algorithm (top-left), the resulting tiling (top-right), and a representation of the system at several generations (bottom).

    [To Do: Describe the range of options available.]

    [To Do: Short ellaboration on the code itself] L_system_tiling.m code is current up to March 10, 2009. Occasionally I will make changes to the code, while maintaining the arguement structure. Although the program is essentially as simple as the system it models, there are many auxilliary options and functionality that make the code less readable. The code is only partially commented.

[To Do: Condensed pseudo-code of the core code.]

L_system_tiling bug list

    (not complete, by any measure)

09-05-01   With rules [1 0; 1 0], [1 0; 1 0] the symmetry is reported as mirror top-bottom, but is also left right swap/inverse.

09-05-14   With rules 0, [0 0; 0 0], [n n; n n], a degenerate constant system, doesn't render the algorithm graphics properly.

L_system_3D_tiling

L_system_3D_tiling.m

[To Do: Does this require the MATLAB function that writes to Space Software volume format (.vol)?]

[To Do: Brief explanation on the use of L_system_3D_tiling.m.]

[To Do: Condensed pseudo-code of the core code.]

[To Do: About and why Matlab?]

 

dft_of_image

dft_of_image.m

Generates logarithmically scaled DFT (discrete Fourier transform)  graphics of an image or other matrix, using MATLAB's 2-D fast Fourier transform (FFT) function, fft2.

Produces amplitude, phase, and amplitude colored by phase image, optionally centered on highest frequencies or the DC (zero frequency) component.

------------------
Terms for use: There are no restrictions on the use of this code, auxilliary code and other required resources. Claiming to be the originator, explicitly or implicitly, is bad karma. A link (if appropriate), a note to dow[at]uoregon.edu, and credit are appreciated but not required.


Comments are welcome (dow[at]uoregon.edu).