Documentation ¶
Overview ¶
===== Copyright (c) 2016 Yves Beaudoin - All rights reserved - MIT LICENSE (MIT) - Email: [email protected] ================
- Package:
- lsystems
- Overview:
- package for processing and drawing Lindenmayer systems (L-systems) using gnuplot and HP-GL/2 graphics.
- Variables:
- TurtleCmds string
- Generated turtle-graphics commands
- Functions:
- Deterministic(order int, axiom string, rules *strings.Replacer)
- Generates the required turtle commands for the specified deterministic and context-free production parameters.
- Stochastic(order int, axiom string, rules []string, weights []int)
- Generates the required turtle commands for the specified stochastic and context-free production parameters.
- HogewegHesper(order int, axiom string, rules map[string]string)
- Generates the required turtle commands for the specified Hogeweg and Hesper production parameters as
- described in http://algorithmicbotany.org/papers/abop/abop.pdf
- EncodeBgColorName(bgColorName string) string
- Encodes a color name into an hex string, prefixed with the character "x", for use as the specification
- of a gnuplot terminal's background color.
- Plot(angle float64, terminalCmd, outputCmd, plotTitle, lineColor string, cmdsFile ...string)
- Plots the latest generated turtle commands with the given parameters using gnuplot. The result will be
- isometrically scaled and centered. The underlying gnuplot commands can be saved optionally to a text file.
- MultiPlot(turtleCmds []string, turtleAngles []float64, terminalCmd, outputCmd, plotTitle string, labels []string,
- lineColor string, cmdsFile ...string)
- Plots a set of turtle commands with the given parameters using gnuplot. The result will be anisometrically scaled
- with the subplots generated left to right. The underlying gnuplot commands can be saved optionally to a text file.
- HpglPlot(angle float64, plotTitle string, penWidth float64, hpglPath string)
- Converts the latest generated turtle commands with the given parameters to an HP-GL/2 command set.
- The resulting plot will be isometrically scaled and centered.
- HpglMultiPlot(turtleCmds []string, turtleAngles []float64, plotTitle string, labels []string,
- penWidth float64, hpglPath string)
- Converts a set of turtle commands with the given parameters to an HP-GL/2 command set.
- The resulting plot will be anisometrically scaled with the subplots generated left to right in landscape mode.
- Remarks: L-system symbols:
- Variables : any symbol that does not conflict with the constants below,
- Constants : F f + - | $ ( ) [ ] { }
- with the following turtle-graphics interpretations:
- "F" means "move forward drawing a line",
- "f" means "move forward without drawing a line",
- "+" means "turn left",
- "-" means "turn right",
- "|" means "turn away" (adds 180 degrees to the heading),
- "$" sets the heading to 90 degrees (default initial heading is 0),
- "(" marks the start of a new heading declaration in degrees,
- ")" marks the end of a heading declaration,
- "[" starts a branch; saves the current turtle's status,
- "]" ends a branch; restores the turtle's status with the last saved value (as in a LIFO stack),
- "{" starts filled polygon mode (line segments define the edges),
- "}" ends polygon mode.
- All other symbols will be ignored during drawing.
- History: v1.0.0 - September 28, 2016 - Original release. *============================================================================================================================
Index ¶
- Variables
- func Deterministic(order int, axiom string, rules *strings.Replacer)
- func EncodeBgColorName(bgColorName string) string
- func HogewegHesper(order int, axiom string, rules map[string]string)
- func HpglMultiPlot(turtleCmds []string, turtleAngles []float64, plotTitle string, labels []string, ...)
- func HpglPlot(angle float64, plotTitle string, penWidth float64, hpglPath string)
- func MultiPlot(turtleCmds []string, turtleAngles []float64, ...)
- func Plot(angle float64, terminalCmd, outputCmd, plotTitle, lineColor string, ...)
- func Stochastic(order int, axiom string, rules []string, weights []int)
Constants ¶
This section is empty.
Variables ¶
View Source
var TurtleCmds string //generated turtle commands
Exported -------------------------------------------------------------------------------------------------------------------
Functions ¶
func EncodeBgColorName ¶
func HpglMultiPlot ¶
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
Dragon curve of order 10 Stochastic context-free rules: see http://algorithmicbotany.org/papers/abop/abop.pdf, Section 1.7 Hogeweg and Hesper context rules: see http://algorithmicbotany.org/papers/abop/abop.pdf ============================================================================================================================== * Purpose: Demonstrates the use of the "lsystems" package with 30 deterministic context-free examples.
|
Dragon curve of order 10 Stochastic context-free rules: see http://algorithmicbotany.org/papers/abop/abop.pdf, Section 1.7 Hogeweg and Hesper context rules: see http://algorithmicbotany.org/papers/abop/abop.pdf ============================================================================================================================== * Purpose: Demonstrates the use of the "lsystems" package with 30 deterministic context-free examples. |
Click to show internal directories.
Click to hide internal directories.