tutorials:common_rewriting_rules
Table of Contents
Structural rules
L-System style
Of the two structural rules this one is much more commonly used in GroIMP. It replaces each instance of the pattern defined on the left side with the new created graph structure on the right side.
<pattern> ==> <structure>;
So if all A's in the model should be replaced by F's the patterns a the A's and the new structure is an F:
A ==> F;
pattern side
The definition of the pattern that should be replaced can be defined by using xl syntax and xl-operators.
A[F] ==> F;
first((*A*)) ==> F;
Additionally the pattern can be defined using conditions:
A(1)==>F;
a:A,(a.len!=1)==>F;
structure side
A more complex structure can be created by using the turtle geometry and graph-syntax.
A ==> F [RL(90) F A] F +> A;
With the addition of modules and 3d objects more object oriented nodes can be added:
A ==> F [RL(90) Cylinder(1,4) A] F +> MyNewNode(2.4);
SPO style
SPO: Single pushout graph rewriting
Execution rule
tutorials/common_rewriting_rules.txt · Last modified: 2024/05/02 19:09 by TimOb