Package net.paulhertz.pixelaudio
Class Lindenmayer
java.lang.Object
net.paulhertz.pixelaudio.Lindenmayer
Implements a simple Lindenmeyer system (L-system), a so-called DOL-system:
deterministic and context-free. Load production strings into transTable with
put(), retrieve them with get(). I used this class for Hilbert curve generation
until I found analytical methods in Wikipedia to speed up curve generation.
There will be demos, but probably not for the early beta release.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassAnimation frame-counting toolclassData storage for number of steps n each of duration d, with additional scaling factor s. -
Field Summary
FieldsModifier and TypeFieldDescriptiontransition table for string productionboolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexpandString(ArrayList<String> tokens, int levels, ArrayList<String> sb) Gets a value from the transition table corresponding to the supplied key.hilbert(int depth) Encode strings representing a Hilbert curve to supplied depth.int[]loadAnimSteps(Lindenmayer.AnimStepper stepper) voidLoads a key and its corresponding value into the transition table.
-
Field Details
-
transTable
transition table for string production -
verbose
public boolean verbose
-
-
Constructor Details
-
Lindenmayer
public Lindenmayer()Creates a new Lindenmeyer instance;
-
-
Method Details
-
get
Gets a value from the transition table corresponding to the supplied key.- Parameters:
clef- a single-character String- Returns:
- value corresponding to the key
-
put
Loads a key and its corresponding value into the transition table.- Parameters:
clef- a single-character Stringvalue- the String value associated with the key
-
expandString
-
hilbert
Encode strings representing a Hilbert curve to supplied depth. To draw the actual curve, ignore the R and L symbols + : 90 degrees CW - : 90 degrees CCW F : forward (n) units- Parameters:
depth- number of recursive iterations of the L-system
-
loadAnimSteps
-