While querying works the same way as for GraphObjects, it is also possible to apply rewriting rules on a SecGraph. This is done by adding the graph in front of the square brackets of the rules sg.[…]. It is always required to derive the graph after submitting rules, to actually apply the changes (sg.derive()).
SecGraph sg = new SecGraph(workbench());
protected void init()[
sg.clear();
sg ==> Sphere(0.1);
]
public void grow(){
sg.[
Sphere(0.1) ==> F Sphere(0.1);
]
sg.derive();
}