Editing Branching Patterns (Part 1)
Branching models
There are several ways of creating branching patterns like those found in nature.
- L-Systems
- L-systems are like formal grammars, have expressive power, but difficult to add in constraints
- When rules are randomized, the user defines probabilities of a rule triggering, and distributions of randomized parameters
- Hard to define distributions of variables that are implicit in the rule set (user controls the genotype distributions, not the phenotype)
- There are nice interfaces for building rule sets (XFrog, probably others)
- Rapidly-exploring-Random-Trees (RRT)
- Method for sampling region to fill space
- Branch styling created by a distance metric in some higher-order space
- Could be unified with an L-system style grammar to create hierarchy-dependent styling
- Diffusion Limited Aggregation (DLA)
- Creates fuzzy dendrite patterns
- Easy to add environmental constraints (walls, different diffusion/flow conditions)
- Has a single tuning parameter for amount of diffusion into the aggregation
- Dielectric Breakdown Model (DBM)
- Generates similar dendrite patterns as DLA
- Has a single tuning parameter for density (similar to DLA's parameter)
- Allows faster pattern generation
- Easy to modify for anisotropic patterns
- Difficult to generate smooth branches
Categories of editing
- Directly editing rule sets (L-systems in text format or though a graphical interface that shows the rules directly)
- Applying parameter gradients
(user controls parameters of rule sets by manipulating direction + start/end values of a linear gradient across a surface)
- Composing from examples
- Copy-paste
(select a subtree, paste it somewhere else in the tree, space between existing tree and pasted data are filled with plausible pattern)
- Select + propagate
(like copy-paste, but with intelligent/automatic pasting, based on optimizing some match of the original patch with paste regions, user controls the amount of pasting to be done)
- Growth constraints
- Local constraints
(don't place branches outside of a user-defined region, align branch angles with guides in certain regions)
- Global constraints
(control statistical distribution of properties: area covered, minimize difference in branch length in a certain area, obey constructal property)
- Direct manipulation
(user draws trunks directly, has "spraypaint" tool that sprouts branches of a certain type nearby, uses gestures to modify existing branches)
Use cases
Here are some use cases that explain how an artist would use different editing operations on a branching pattern to create visual imagery. These assume a Photoshop-like interface and mindset of the user. We assume that the underlying model is something like an randomized L-system that includes production rules and probabilities. Dealing with constraints, edits, gradients, space-filling, blending, etc would all be extensions to the vanilla L-systems model.
Bramble gradients
- Our artist has found some rulesets that she likes, they generate the sort of patterns that she is using to fill space in a computer-generated painting
- The rules create some brambles, and can be parameterized to be cheerful and bright or tangled and dark
- She uses an interface similar to a color-picker to explore different parameter values until she has found both a "cheerful" and "frightening" location in the parameter space
- She saves those as "pattern swatches"
- She select a region on her canvas and creates a pattern gradient horizontally from cheerful to frightening
- Unfortunately, because the interpolation occurs in the genotype, the middle region isn't "glum" or "anxious", it's "frighteningly cheerful"
- She selects the middle region and returns to the pattern picker where she explores until she finds an "anxious" parameter set
- If this doesn't improve the interpolation she does the recursively until she's defined a smooth phenotype
- This gradient that she's built is a reusable component, which she can apply in a different direction, or scaled so it changes more quickly
Root gradients
- Our artist has some gradually changing brambles
- She wants to extend roots down from the brambles and show a scene underground
- The roots pattern swatch came predefined with her rules,
- So she creates a new vertical gradient from "roots" to the transparent swatch
- The transparent swatch implies that the gradient should not modify the parameters at that location
- Thankfully, "rootiness" is orthogonal to "cheerfulness" (both in parameter space, and in this case spatially) so the roots vary smoothly horizontally from cheerful to frightening
- If the frightening roots aren't scary enough she can select that region and modify the pattern swatch at that point
- This will affect both the horizontal and vertical gradient
- Her edits affect both "equally", so she may want to modify the root swatch or horizontal mood swatches independently instead of doing this, for more control
Drawing flowers
- Our artist now has two gradients defining a bramble patch
- She wants flowers blooming near the upper side of the patch
- She selects a different pattern that generates flowers, and paints with a brush in the region where she wants blooms
- She flowers are grafted on to the brambles in these regions
- She can apply parameter gradients to this region, or modify the shape and size of the region later
- There is an automatic merger of the bramble and the flower rules that the artist can edit
Transforming
- Our artist wants to create a visual focus around a foreground element
- She takes the twist tool and twists a circular region of the brambles
- She defines the center, the radius, and an interpolating curve that defines the amount of twist starting at the edge, moving towards the center
- The twist looks different than if she had rasterized and then twisted in image space, it preserves the widths of branches, etc
- The brambles in this region can be regenerated (for example if she changes the underlying parameter gradients) and the twist will remain
Locking
- Our artist is unsatisfied with the way the twist operator is interacting with her brambles
- She wants a branch to form a complete spiral, but because of some features of the rule set it's improbable that they'll generate an unbroken spiral
- She regenerates the brambles repeatedly until she finds a configuration that she likes,
- And because she's going to make further changes to the image, she "locks" this spiral from its tip to its root
- Now when she changes the gradient or the shape of the bramble patch, the spiral will remain
Smooth unlocking
- The branches our artist locked will remain the same even if the rule set changes
- This may make the locked branches unnaturally prominent
- To resolve this our artist may "smoothly unlock" the branches
- The locked branches are interpolated to appear more similar to the surrounding branches
- Angles, colors, and topology may change, but will change as smoothly as possible
- The resulting branch will itself be locked, but will appear more similar to surrounding, unlocked branches
- A branch can also be hard unlocked, which simply regenerates the area it covers
Copy-paste
- Our artist spots a cluster of three flowers whose arrangement she likes
- She selects them and uses the "clone everywhere" operator to reproduce this arrangement wherever flowers currently exist
- The result is that all flowers are grouped into trios and are positioned similarly
- She can vary a "fidelity" and a "density" parameter to control the cloning
- Fidelity of 100% makes an exact copy of the pattern, and fidelity of 50% creates clusters halfway between the pattern and the natural arrangement
- Density of 100% turns all the instances of flowers in the original into parts of a trio, density of 50% groups half of the existing flowers into trios and allows half to be naturally distributed
Related links
Topics that I'd like to incorporate, but haven't integrated yet.
- Allometry is the relation between shape and size, how scaling affects form
- Large DLA images from SIGGRAPH 2005
- Constructal Theory talks about the structure of space-filling shapes that contain flows
by Mark Luffel, September 2009