Package net.paulhertz.pixelaudio
Class Lindenmeyer
java.lang.Object
net.paulhertz.pixelaudio.Lindenmeyer
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(). Was used by Hilbert curve generation until I
sped it up more optimized methods.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
Animation frame-counting toolclass
Data storage for number of steps n each of duration d, with additional scaling factor s. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
expandString
(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
(Lindenmeyer.AnimStepper stepper) void
Loads a key and its corresponding value into the transition table.
-
Field Details
-
verbose
public boolean verbose
-
-
Constructor Details
-
Lindenmeyer
public Lindenmeyer()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 -
loadAnimSteps
-