home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / sci / fractals / 475 < prev    next >
Encoding:
Internet Message Format  |  1992-12-12  |  2.6 KB

  1. Path: sparky!uunet!spool.mu.edu!wupost!cs.utexas.edu!tamsun.tamu.edu!tamsun.tamu.edu!news
  2. From: bpb9204@tamsun.tamu.edu (Brent Burton)
  3. Newsgroups: sci.fractals
  4. Subject: L-Systems (3d example sought)
  5. Date: 12 Dec 1992 20:25:33 -0600
  6. Organization: Texas A&M Univ., Inc.
  7. Lines: 61
  8. Distribution: usa
  9. Message-ID: <1ge6utINNck6@tamsun.tamu.edu>
  10. NNTP-Posting-Host: tamsun.tamu.edu
  11.  
  12.  
  13. Hello, all.
  14.  
  15. Finals have begun, but in my graphics class we are finishing up a small
  16. project.  We (meaning the three in my group) have written a rule-based
  17. L-Sytems/fractal program for the SGIs.  We have it generating all the
  18. standard curves (Sierpinsky, dragon, Hilbert) and also some plants of
  19. different types.  Each curve or plant is described by a set of grammar
  20. rules, which combine to generate a sequence of turtle commands.
  21.  
  22. This approach is very interesting, especially when you start getting into
  23. the context-sensitive languages vs. the context-free.
  24.  
  25. The final example I was trying to develop was, ideally, a 3-D Hilbert
  26. curve.  However, this has proved to be challenging.  What I want to ask
  27. of you folks is, do you have a set of grammar rules that describe *any*
  28. 3-D curves?  I could generate a 3D plant quite easily, but I was thinking
  29. a Hilbert curve would be great.
  30.  
  31. Thanks, any info is appreciated (whether posted or emailed).
  32. --------------------------------------------------
  33. For those who don't know, the curves specified by a grammar follow the
  34. basic setup:
  35.  
  36. Axiom:  <This is the initial string you start with>
  37. Rules:  A -> BC...  <Each rule has this form, where 'A' is a symbol 
  38.                      either in the axiom, or in generated strings which
  39.                      is replaced by 'BC', a set of turtle commands or
  40.                      other rule names>
  41.  
  42. Example:  Hilbert curve
  43.  
  44. Axiom: X                   [Hilbert curve is context-free]
  45. Rules: X -> -YF+XFX+FY-
  46.        Y -> +XF-YFY-FX+
  47.  
  48. The turtle commands are embedded in the above rules; they are:
  49.   '-' turn left
  50.   '+' turn right
  51.   'F' forward, drawing a line segment
  52.   '?' any other character is ignored.
  53.  <There are many others for 3D control, position save/recall, etc>
  54.  
  55. Given a turtle's starting point and a direction, then you would iterate
  56. the above rules to generate a string.
  57.  
  58. iteration   string
  59.    0          X
  60.    1          -YF+XFX+FY-
  61.    2          -+XF-YFY-FX+F+-YF+XFX+FY-F-YF+XFX+FY-+F+XF-YFY-FX+-
  62.    n          +-+-...... lots of gunk here by replacing X & Y ......-+-+
  63.  
  64. By scanning left to right through the above generated strings, you
  65. draw out the Hilbert curve.
  66.  
  67. -Brent
  68. -- 
  69. +-------------------------+
  70. | Brent Burton    N5VMG   |    
  71. | bpb9204@tamsun.tamu.edu |  
  72. +-------------------------+ 
  73.