SVG L-Systems
Typically, I define an L-System like this:
axiom = A
A = [-FA][+FA]
which grows like this:
0th: A
1st: [-FA][+FA]
2nd: [-F[-FA][+FA]][+F[-FA][+FA]]
3rd: [-F[-F[-FA][+FA]][+F[-FA][+FA]]][+F[-F[-FA][+FA]][+F[-FA][+FA]]]
and so on. This produces a long string, in which each character represents a command to a drawing cursor. - and + turn the cursor, F moves it forward leaving a line, [ and ] push and pop cursor states to a stack. This one produces a simple tree.
Anyway, every time I've wanted to write an L-System graphic to a new format I've had to write another interpreter for these command strings. Yesterday, I tried something new: using actual code in the L-System definition, resulting in immediately usable code.
For example, the definition for the above L-System in psuedocode SVG is:
axiom = <doctype> <svg> A </svg>
A = <g transform="..."> <line ...> A </g> <g transform="..."> <line ...> A </g>
which produces a valid SVG file. The <g> element replaces the brackets in the original, as they perform the same function: saving the cursor coordinates before and restoring those after the </g>. The - and + are replaced by the transform attribute in <g>. The F is replaced by a <line>.
I'm sure this isn't a new method; in fact, I'd bet this was how the first combination of L-Systems and LOGO was implemented. For me, though, this is a huge improvement in how I work with L-Systems. I get to avoid designing a whole grammer and parser to take advantage of SVG's features.
Christmas
The best Christmas yet — even better than the Super Nintendo Christmas. Gifts had nothing to do with it, but everything I got was wonderful. Some highlights:
- On Growth and Form by D'Arcy Wentworth Thompson
- 1116 pages of biology from a mathematical angle. The author covers everything from the logarithmic spirals of seashells to cell packing, in order to show how evolution picks economical forms.
- Windows XP Professional
- Excited about a Microsoft product? We live in strange times. It's stable, clean, easy to install, and has drivers for everything. ClearType alone was worth the migration.
- Lego Bionicle: Bohrok
- As far as I can tell, Lego's Bionicle line has something to do with masked Polynesian robots who crave product tie-ins. No matter, because these things are great fun. The Bohrok sets build insectoid action figures with ball-joints and attack actions. And it folds into a ball. Not for those who dislike the trend towards sets made up entirely of specialized pieces.
a testers
for FIRES
When I signed up to work in this computer lab over Winter break, I knew that there wouldn't be many users; but this ... this is staring into the abyss. I have not had any users since I opened the lab 7 hours ago. Almost no students are on campus, and many don't know this lab exists: in the basement, hidden behind a sequence of a tiny hallways. I used to work here weekly, but it's been a year and never for this long.
Campus-owned art is, as a rule, crap. Everything is framed sketches, mobiles, and abstract sculpture. The single exception lives in this room, for some reason. It's a ink illustration, 4' x 2', depicting random mechanical and organic parts assembling into a monstrosity. Imagine the scene in Akira where Tetsuo loses control of his body in the Olympic stadium; he becomes a mass of organs, wires, and muscle. Now imagine that instead, he assimilated industrial items from the 1940's: airplane propellers, cloth air bladders, zeppelin frames, and steel girders. It's being attacked by a cast-iron UFO, and Batman-style captions break out in old blocky typefaces.
Also, someone has written "for FIRES" in permanent marker on the fire extinguisher outside my door. I can only imagine what made this instruction necessary.
Architoys
Architoys is an extensive list of architectural building toys.
Supercity looks like the best choice for utopia-movie architecture. Astrolite from Hasbro looks genuinely evil — the official building block of the Dark Side. There are some beautiful old European sets too, like Arquitectura Moderna and Armator.
I came across these while searching for Froebel's blocks, which are frequently referenced in the papers on shape grammars I'm reading.
Winter Break Reading
Gridbug |
Comments (0)
Gridbug is one of the first artificial life programs I wrote in QBasic, rewritten in Proce55ing.
Decompression
I'm back, after three weeks of final projects and exams. So very tired. It now appears that I got too worried about the projects — the two that have been graded got 100%!
The weblog will flow again, especially since I agreed to work in the computer labs over Winter break.
Doublecell
The second volume of Singlecell has been released. I'd completely forgotten that it was coming out today, and probably wouldn't have seen it until March had Suppose not linked it.