home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!wupost!cs.utexas.edu!tamsun.tamu.edu!tamsun.tamu.edu!news
- From: bpb9204@tamsun.tamu.edu (Brent Burton)
- Newsgroups: sci.fractals
- Subject: L-Systems (3d example sought)
- Date: 12 Dec 1992 20:25:33 -0600
- Organization: Texas A&M Univ., Inc.
- Lines: 61
- Distribution: usa
- Message-ID: <1ge6utINNck6@tamsun.tamu.edu>
- NNTP-Posting-Host: tamsun.tamu.edu
-
-
- Hello, all.
-
- Finals have begun, but in my graphics class we are finishing up a small
- project. We (meaning the three in my group) have written a rule-based
- L-Sytems/fractal program for the SGIs. We have it generating all the
- standard curves (Sierpinsky, dragon, Hilbert) and also some plants of
- different types. Each curve or plant is described by a set of grammar
- rules, which combine to generate a sequence of turtle commands.
-
- This approach is very interesting, especially when you start getting into
- the context-sensitive languages vs. the context-free.
-
- The final example I was trying to develop was, ideally, a 3-D Hilbert
- curve. However, this has proved to be challenging. What I want to ask
- of you folks is, do you have a set of grammar rules that describe *any*
- 3-D curves? I could generate a 3D plant quite easily, but I was thinking
- a Hilbert curve would be great.
-
- Thanks, any info is appreciated (whether posted or emailed).
- --------------------------------------------------
- For those who don't know, the curves specified by a grammar follow the
- basic setup:
-
- Axiom: <This is the initial string you start with>
- Rules: A -> BC... <Each rule has this form, where 'A' is a symbol
- either in the axiom, or in generated strings which
- is replaced by 'BC', a set of turtle commands or
- other rule names>
-
- Example: Hilbert curve
-
- Axiom: X [Hilbert curve is context-free]
- Rules: X -> -YF+XFX+FY-
- Y -> +XF-YFY-FX+
-
- The turtle commands are embedded in the above rules; they are:
- '-' turn left
- '+' turn right
- 'F' forward, drawing a line segment
- '?' any other character is ignored.
- <There are many others for 3D control, position save/recall, etc>
-
- Given a turtle's starting point and a direction, then you would iterate
- the above rules to generate a string.
-
- iteration string
- 0 X
- 1 -YF+XFX+FY-
- 2 -+XF-YFY-FX+F+-YF+XFX+FY-F-YF+XFX+FY-+F+XF-YFY-FX+-
- n +-+-...... lots of gunk here by replacing X & Y ......-+-+
-
- By scanning left to right through the above generated strings, you
- draw out the Hilbert curve.
-
- -Brent
- --
- +-------------------------+
- | Brent Burton N5VMG |
- | bpb9204@tamsun.tamu.edu |
- +-------------------------+
-