Class Lindenmeyer

java.lang.Object
net.paulhertz.pixelaudio.Lindenmeyer

public class Lindenmeyer extends Object
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.
  • Field Details

    • verbose

      public boolean verbose
  • Constructor Details

    • Lindenmeyer

      public Lindenmeyer()
      Creates a new Lindenmeyer instance;
  • Method Details

    • get

      public String get(String clef)
      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

      public void put(String clef, String value)
      Loads a key and its corresponding value into the transition table.
      Parameters:
      clef - a single-character String
      value - the String value associated with the key
    • expandString

      public void expandString(ArrayList<String> tokens, int levels, ArrayList<String> sb)
    • hilbert

      public ArrayList<String> hilbert(int depth)
      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

      public int[] loadAnimSteps(Lindenmeyer.AnimStepper stepper)