home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Raytrace & Morphing / SOS-RAYTRACE.ISO / programm / utility / dos / lparse / readme < prev    next >
Encoding:
Text File  |  1993-07-22  |  14.1 KB  |  345 lines

  1. ┌─────────┬────────────────────────────────┬───────────────────────────────┐
  2. │ Name:   │ L-SYSTEM PARSER/MUTATOR        │ (C) RenderStar Technology BV. │
  3. ├─────────┼────────────────────────────────┼──────────┬───────┬────────────┤ 
  4. │ Author: │ Laurens J. Lapre               │ Version: │  1.0  │ 1993-07-22 │
  5. ├─────────┴────────────────────────────────┴──────────┴───────┴────────────┤
  6. │ RenderStar Technology BV, Keizersgracht 448                        │
  7. │ 1016 GD Amsterdam, the Netherlands                                   │
  8. │ Fax (+31) 20 622 4939                                                    │
  9. ├─────────┬─────────────────────┬───────────────────┬──────────────────────┤
  10. │ Email:  │ 2:283/203.8@fidonet │ 'Lj Lapre' PCGnet │                      │ 
  11. └─────────┴─────────────────────┴───────────────────┴──────────────────────┘
  12.  
  13.  
  14. Disclaimer
  15. ──────────────────────────────────────────────────────────────────────────── 
  16. This software is free and may be freely distributed, but is copyrighted by 
  17. the company RenderStar Technology BV. This software is provided as is 
  18. without any guarantees. The author and company assume no liability for 
  19. damages, direct or consequential, which may result from the use of this 
  20. software. The 'lparser.exe' file may not be used as part of any commercial 
  21. package without the explicit written consent of the author or company.
  22.  
  23.  
  24. General
  25. ──────────────────────────────────────────────────────────────────────────── 
  26. An l-system is a rule like description of a 3d form. It contains  
  27. descriptions of parts and how they should be assembeld together. The program 
  28. reads a l-system description in and processes it into a 3d form which can 
  29. then be outputed in several formats, including DXF and POV. 
  30.  
  31. The description is applied to itself a number of times (= recursion levels) 
  32. so fractal and recursive forms are very easy to describe in an l-system. 
  33. That's why they are used a lot for plants and natural looking organic forms. 
  34. By increasing the recursion level the form slowly 'grows' and becomes more 
  35. complex. 
  36.  
  37. This implementation of a l-system parser also allows 'mutations' to take 
  38. place during the growing of the form. These mutations can change the form 
  39. slightly or quite dramaticly. This allows you to create a form once and then 
  40. create a whole series of forms all clearly 'descendant' from the original 
  41. l-system.
  42.  
  43. Too help people get started a lot of example l-systems and pov files have 
  44. been included.
  45.  
  46. The lparser.exe is a protected mode program using the royalty free 
  47. Rational dos-extender (dos4gw.exe) supplied with Watcom 9. It needs a 
  48. 386/387 or 486 with 4meg ram.
  49.  
  50.  
  51. Execute like this :
  52. ──────────────────────────────────────────────────────────────────────────── 
  53. lparser [options] [name]
  54.  
  55. examples :
  56.  
  57. lparser -x rcylin -d lsys03.ls
  58. lparser -v -t0.5 -u10 -i30000 -g lsys05
  59. lparser spider
  60.  
  61. Name is an l-system file with the ls extension. It will standard generate a 
  62. RenderStar compatible 'output.vol' file. Which can be shown and rendered 
  63. directly in RenderStar with the command : rs2 l. The l.* files are 
  64. RenderStar support files.
  65.  
  66.  
  67. Persistence of Vision (POV) output:
  68. ──────────────────────────────────────────────────────────────────────────── 
  69. Part off the pov file is setup by the user and the output.pov file is then
  70. attached to the user's file.
  71.  
  72. -v            make pov object file
  73.  
  74. Generates a pov file format description. Only the body part of the file is 
  75. generated with a series of a l_base objects and leafs as triangles. See the 
  76. 'exam.pov' file for more explanation. One can change the object definition 
  77. of the l_base element used in the l-system form to any one of the valid pov 
  78. shapes as long as the shape can be scaled differently in all 3 directions.
  79.  
  80. -b            make pov blob file
  81.  
  82. Instead of outputting objects, postionend components are written to the 
  83. output.pov file. These can be used to create 'bloby' objects. See 
  84. 'bloby.pov' for an example how to set this up. All triangles are skipped.
  85.  
  86. -B            make multiple pov blob files
  87.  
  88. Each color part of the final form is written into its own output??.pov file. 
  89. This allows you to have mutiple blob's each with its own color and material. 
  90. See 'mbloby.pov' for an example. All triangles are skipped. The b*.pov files 
  91. contain several different forms and setups done with pov's blob functions.
  92.  
  93. -c            output inc files instead of pov file
  94.  
  95. The output files will now have the 'inc' extension for easier including in 
  96. other pov files. 
  97.  
  98.  
  99. DXF output:
  100. ──────────────────────────────────────────────────────────────────────────── 
  101. -d            make dxf file (use with '-x cube' for fast dxf file writing)
  102.  
  103. This creates AutoCad R12 polyline polyface meshes in dxf file format which 
  104. can be used in Acad and 3DS. It's a much more efficient format then the 
  105. 3dface format. It uses blocks and inserts. The most efficient dxf file (in 
  106. size and write/load time) is generated with : lparser -x cube -d [name]. If 
  107. you read the file into Acad12 make sure you have a new (no prototype) drawing 
  108. since the file contains block definitions as well. The objects will have 
  109. color and layer attributes set. By changing all object color attributes to 
  110. BYLAYER one can use the layer overview for easy, by layer, color setting.
  111.  
  112. -3            make dxf file
  113.  
  114. This is a simple 3dface only dxf file format which will always work. It has 
  115. no blocks or inserts but can become very large.
  116.  
  117.  
  118. Other options:
  119. ──────────────────────────────────────────────────────────────────────────── 
  120. -t [num]      set minimum thickness
  121.  
  122. This allows you to set the minimum thickness a form will get during 
  123. recursive generation. It is to make sure the forms don't get too 'thin' to 
  124. be seen and render correctly. It's typicly around 0.5 to 1.0.
  125.  
  126. -u [num]      mutate [num] times
  127.  
  128. Mutate the l-system a number of times before starting the geometry generation 
  129. fase and write the mutated l-system to disc as the file 'mutation.ls'. By 
  130. re-using this file one can build mutation series of forms.
  131.  
  132. -r [num]      overrule recursion depth 
  133. -a [num]      overrule angle
  134.  
  135. Overrule these values on the commandline. They are also set in the l-system 
  136. file but they will not be used when an overrule option is used on the 
  137. commandline. One can 'open' a form by starting with a angle of zero and 
  138. increase it to the final angle. This makes nice animations. Doing the same 
  139. with the -r option will slowly 'grow' the form into its final shape.
  140.  
  141. -p [num]      limit polygons to [num]
  142.  
  143. Limit the total amount off polygons/objects outputed during the parsing of 
  144. the final l-system production. After mutation the form may have grown very 
  145. (VERY) large. The whole form could be inserted in each of its branches ! The 
  146. default limit is 200.000 polygons/objects.
  147.  
  148. -i [num]      limit string length to about [num]
  149.  
  150. Limit the length of the final production string. This is also a way of 
  151. limiting the size and generation time of a form. When certain mutations 
  152. occur the generating time can become very long. The -i option can limit this 
  153. time. Use like : lparser -p50000 -i30000 lsys00. The default string limit 
  154. is 500.000 chars. The program can handle final l-systems strings up to 1 
  155. million chars.
  156.  
  157. -x [name]       use name.vol as base form
  158.  
  159. Instead of a simple block a special object (*.vol) can be used as a base 
  160. element. Example forms are ball, cube, cone, cylin8 (with 8 faces), cylin16 
  161. (with 16 faces), rcylin (with rounded edges) and tube. This is for generating 
  162. vol or dxf files only. Try : lparser -x ball lsys00. The changing of the base 
  163. forms for pov output is done by the user in the pov headers. See *.pov for 
  164. examples.
  165.  
  166. -l            show final L-string
  167.  
  168. Prints the final l-system production to the screen. This is the final string 
  169. which is then interpreted into a 3d form.
  170.  
  171. -g            add ground plane
  172.  
  173. Adds a large ground plane (2 triangles) touching the lowest point of the 
  174. form. This is for easy shadow projection and horizon.
  175.  
  176.  
  177. More info ... 
  178. ──────────────────────────────────────────────────────────────────────────── 
  179. The book 'Evolutionary Art and Computers' by S. Todd and W. Latham was used 
  180. to base the genetic 3d form mutation principles on. In here you'll find a lot 
  181. of interesting ideas on how to 'grow' and 'evolve' organic looking 3d forms 
  182. of your own.
  183.  
  184. The implemented l-system is based on the one described in the book : 'The 
  185. Algorithmic Beauty of Plants' by P. Prusinkiewicz and A. Lindenmayer (this 
  186. is where the 'L' from l-systems come form). If you want more information on 
  187. making your own l-systems you'll want to check out this book. A lot can be 
  188. done by changing the l-systems suplied with the parser and seeing for 
  189. yourself what changes in the final form. 
  190.  
  191. For this you can use the the following l-system files:
  192.  
  193. From The Algorithmic Beauty of Plants:
  194.  
  195. bop00.ls          cordate leave     pag 123
  196. bop01.ls          plant        pag 27
  197. bop02.ls          bush        pag 26
  198. bop03.ls          form in 2d    pag 25
  199. bop04.ls          block form    pag 20
  200. bop05.ls          fractal        pag 9
  201.  
  202. Fractals from FractInt:
  203.  
  204. fract00.ls        4 dragon curves
  205. fract01.ls        space snake
  206. fract02.ls        round triangle tiling
  207. fract03.ls        pentagon tiling
  208. fract04.ls        triangle tiling
  209.  
  210. Free form experiments:
  211.  
  212. lsys00.ls         lobster form
  213. lsys01.ls            "    var 1
  214. lsys02.ls            "    var 2
  215. lsys03.ls            "    var 3
  216. lsys04.ls            "    var 4
  217. lsys05.ls         spiral bush
  218. lsys06.ls         tree base
  219. lsys07.ls         half circle
  220. lsys08.ls            "    var 1
  221. lsys09.ls         cello plant
  222. lsys10.ls         circle form
  223.  
  224. Mutations:
  225.  
  226. mut00 - mut08      mutations of lsys00.ls
  227. mut09 - mut14      mutations of spider.ls
  228. mut15 - mut18      distant relatives of lsys02.ls
  229.  
  230. Spiral forms:
  231.  
  232. spiral00.ls       overview of spiral types
  233. spiral01.ls       spiral form
  234. spiral02.ls       spiral tree
  235. spiral03.ls       large spiral plant var 1
  236. spiral04.ls       large spiral plant var 2
  237.  
  238.  
  239. Syntax 
  240. ──────────────────────────────────────────────────────────────────────────── 
  241. For those who are already familiar with l-systems, here are the commands and 
  242. their functions for this lparser's 'dialect'. All commands are 1 char only 
  243. and simpler then for most lparsers. This is to keep them from getting 
  244. 'broken' by the mutation process and speeds up the parsing.
  245.  
  246. ┌─────────────────────────────────────────────────────────────────────┐ 
  247. │ Orientation commands                                                │  
  248. ├─────────────────────────────────────────────────────────────────────┤
  249. │ +    turn left around up vector                      │   
  250. │ -     turn right around up vectos                      │   
  251. │ &    pitch down around left vector                      │   
  252. │ ^    pitch up around left vector                      │   
  253. │ <    roll left around forward vector                      │   
  254. │ >    roll right around forward vector                  │   
  255. │ |    turn 180 deg around up vector                      │   
  256. │ %    roll 180 deg around forward vector                  │   
  257. ├─────────────────────────────────────────────────────────────────────┤
  258. │ Movement commands                       when {} active          │   
  259. ├─────────────────────────────────────────────────────────────────────┤
  260. │ F    move forward and draw full length    record vertex          │   
  261. │ f    move forward with full length         record vertex           │   
  262. │ g    move forward with full length         don't record vertex      │   
  263. │ Z    move forward and draw half length    record vertex          │   
  264. │ z    move forward with half length         record vertex          │   
  265. │ .    don't move                 record vertex            │   
  266. ├─────────────────────────────────────────────────────────────────────┤
  267. │ Structure commands                              │   
  268. ├─────────────────────────────────────────────────────────────────────┤
  269. │ [    push current state                          │   
  270. │ ]    pop current state                          │   
  271. │ {    start polygon shape                          │   
  272. │ }    end polygon shape                          │   
  273. ├─────────────────────────────────────────────────────────────────────┤
  274. │ Inc/Dec commands                              │   
  275. ├─────────────────────────────────────────────────────────────────────┤
  276. │ "    increment length                          │  
  277. │ '    decrement length                          │   
  278. │ ;    increment angle                              │   
  279. │ :    decrement angle                              │   
  280. │ ?    increment thickness                          │   
  281. │ !    decrement thickness                          │   
  282. ├─────────────────────────────────────────────────────────────────────┤
  283. │ Additional commands                              │   
  284. ├─────────────────────────────────────────────────────────────────────┤
  285. │ c    increment color index                          │   
  286. │ *    reset color, thickness, length and angle                      │   
  287. │ @    end of object                              │
  288. └─────────────────────────────────────────────────────────────────────┘
  289.  
  290.  
  291. This is an example of a simple form definition (spiral01.ls) :
  292. ──────────────────────────────────────────────────────────────────────────── 
  293. 20
  294. 10
  295. 100
  296. a
  297. a=Fs+;'a
  298. s=[::c!!!!&&[b]^^^^[b]]
  299. b=F!+F+;'b
  300. @
  301.  
  302.  
  303. This is an example of a complex form definition (spider.ls) :
  304. ──────────────────────────────────────────────────────────────────────────── 
  305. #-------------------------------------- "Octo Spider"
  306. #-------------------------------------- Header
  307. 15                    # recursion depth level
  308. 10                    # basic angle in degrees
  309. 60                    # starting thickness in % of length
  310. C                    # axiom
  311. .-------------------------------------- Creature
  312. C=LABHT
  313. .-------------------------------------- Body
  314. B=[???????zZZZ]
  315. .-------------------------------------- Arms
  316. A=[zf&&&&&&&&&"""[pj>>>>>>>>>S]|[qj<<<<<<<<<S]]
  317. p=Ft+:'p                # left
  318. q=Ft-:'q                # right
  319. j=;"j
  320. .-------------------------------------- Claws
  321. S=['''!!r%^^r]
  322. r=[Z?Z?Zu]                # claw assembly
  323. u=Z[co]!'^::u                # claw tooth    
  324. .-------------------------------------- Legs
  325. L=[c">>>>[s]>>>>[s]>>>>[s]>>>[s]>>>>>>[s]>>>[s]>>>>[s]>>>>[s]]
  326. s=+++li+++dccc??""FF            # down legs
  327. l=Ft+:'l                # upper leg
  328. d=FFF'd                    # lower leg
  329. i=;i
  330. .-------------------------------------- Head
  331. H=["">>>>>>>>>&&&&&&??FFFF!![???h][???k]%^^[??k]]
  332. k=[Z?Z?Za]                # jaw assembly
  333. a=Z[co]!'a                # jaw    
  334. o=&&&&&&&&&!!!!!F            # teeth
  335. h=[^^gcccc"Z][^^ecccc"Z]        # eyes
  336. g=z!+z!+z!+z                # left eye
  337. e=z!-z!-z!-z                # right eye
  338. .-------------------------------------- Tail
  339. T=[f---------??""""""mccccF]
  340. m=Ft+;'m                # curl
  341. t=['::c!!!&&[f<<<n]^^^^f>>>n]        # spikes
  342. n=[c{--z++z++z--|--z++z++z}]        # leaf
  343. .-------------------------------------- End
  344. @                    # EOF marker
  345.