scallop dome pyformex logo

Previous topic

44. isopar — Isoparametric transformations

Next topic

46. mesh_ext — Extended functionality of the Mesh class.

[FSF Associate Member]

Valid XHTML 1.0 Transitional

45. lima — Lindenmayer Systems

Classes defined in module lima

class lima.Lima(axiom='', rules={})

A class for operations on Lindenmayer Systems.

status()

Print the status of the Lima

addRule(atom, product)

Add a new rule (or overwrite an existing)

translate(rule, keep=False)

Translate the product by the specified rule set.

If keep=True is specified, atoms that do not have a translation in the rule set, will be kept unchanged. The default (keep=False) is to remove those atoms.

Functions defined in module lima

lima.lima(axiom, rules, level, turtlecmds, glob=None)

Create a list of connected points using a Lindenmayer system.

axiom is the initial string, rules are translation rules for the characters in the string, level is the number of generations to produce, turtlecmds are the translation rules of the final string to turtle cmds, glob is an optional list of globals to pass to the turtle script player.

This is a convenience function for quickly creating a drawing of a single generation member. If you intend to draw multiple generations of the same Lima, it is better to use the grow() and translate() methods directly.