It looks like you're new here. If you want to get involved, click one of these buttons!
I've made an L-system extension, called SimpLSystem. I was thinking about what I wanted to do with it, and I've decided I'd like to use it as the starting point to try to start a community project. So I changed the name to SimpLSystem (it was originally JFLSystem), cleaned up a bit, and starting writing this post.
This project doesn't have any well defined goals at this point. As such, I'd like to invite anyone to discuss directions they'd like to go with it here. If you'd rather just do whatever you'd like with it on your own, please feel free to do that as well.
This is a personal project not affiliated with Psyop, but I'd like to thank them anyway for being so supportive of this kind of thing.
Background on L-systems: https://en.wikipedia.org/wiki/L-system#Examples_of_L-systems
The repo contains the extension, and two sample canvas files. The canvas files contain the examples on Wikipedia. Theres one that implements them more or less straight ("wikipedia_examples_standard.canvas"), and one that has more creative interpretations of the same L-systems ("wikipedia_examples_interpreted.canvas"). All the pictures here are from the latter one.
An interpretation of a Koch curve L-system
About the project
As far as I'm concerned the project doesn't really have any defined goals yet, just that I would like it to collaborative and in the community.
A few possibilities for directions this could be taken: The most obvious one would probably be to develop applications of L-systems, such as dynamically creating plant geometry. Another direction would be just to generate arbitrary geometry - it currently just makes a Vec3 for points, and Xfo for leaves. Another direction might be trying to take advantage of the new feature of evaluating DFG graphs in KL, to make the behavior of the evolving system programmable in interesting ways.
An interpretation of a Pythagoras tree L-system
The system consists of two parts right now, the L-system, and the interpreter. The L-system defines and generates the strings, and the interpreter interprets the symbols in the resulting string and performs the walk ("walk the turtle").
The only thing the interpreter can currently do is "walkTheTurtle()", which refers to turtle graphics (see the Wikipedia article). The system continually updates a
Mat44 internally while interpreting string to keep the transform updated, and drops points along the way.
That's it for the moment. Drawing Lines while it goes is (at least one) obvious next step.
SimpLSystem - The Iterative grammar part of the L-system.
struct SimpLRuleDefines an L-system rule, such as "A"->"AB".
object SimpLSystemThe L-system object, initialized from an array of SimpLRules and a start string (axiom).
SimpLSystem.evolve(Size iterations)evolves the system iteratively, expanding the string formed.
SimpLInterpreter - For interpreting the L-system into 3D space:
SimpLInterpreter.addSymbol!(String symbol, Xfo transform, Integer leaf)Adds a symbol to the interpreter, and a transform to apply when encountering that symbol. Using this all the non-branching symbols such as translate forward, turn, roll, pitch and yaw in the usual ways, plus more.
SimpLInterpreter.addBranchSymbol(...)Adds two symbols, one to branch the tree (push a transform onto the stack), and one to unbranch the tree (pop a transform from the stack). Arbitrary transforms can be added on branching and unbranching as well.
SimpLInterpreter.walkTheTurtle(...)Walks down the string, applying the interpretations as it goes, generating an array of positions it visited along the way.
There's also a compound for "add standard symbols", which adds F as move forward, +- for turn left and right, &^ for pitch up an down, \^ for roll left and right, | for turn around, and  for push/branch and pop/unbranch.
Non-standard things this particular L-system does:
SimpLSystem.partialEvolve!(Scalar iterations)evolves the system with partial iterations. 8.4 iterations would mean that the 9th iteration is only done on the first 40% of the string, and the remaining 60% of the original string left alone. This can make interesting half-formed L-systems, is helpful in debugging, and can be used to animate the system's construction.
Xfoapplied to it, not just an angle or walk distance. For example, you could apply a scaling every time the tree branches, or rotate slightly in one direction every time you walk forward.
©Copyright 2017 Fabric Software Inc. All rights reserved. | Privacy