home *** CD-ROM | disk | FTP | other *** search
/ Ray Tracing Box / RAY_CD.mdf / raytrace / cullar / cull.doc < prev    next >
Text File  |  1993-03-28  |  5KB  |  144 lines

  1. CULL
  2. ────
  3.  
  4. Usage: CULL infile.POV outfile.INC
  5.  
  6.  
  7. WHAT IT DOES
  8. ──── ── ────
  9.  
  10.      CULL searches the file infile.POV for any #include statements.  It takes
  11. takes the #declare statements found in the include files listed by these
  12. #include's and produces a list of declared elements.  Then CULL searches
  13. infile.POV for any elements that match those in the declared elements list.
  14. Finally, CULL produces a file named outfile.INC with all the matching declare
  15. statements.
  16.  
  17.      For example, lets say you have a POV file named SAMPLE.POV and that this
  18. file contains the following statements:
  19.  
  20.      // Persistence of Vision Raytracer
  21.      #include "shapes.inc"
  22.      #include "shapesq.inc"
  23.      #include "colors.inc"
  24.      #include "textures.inc"
  25.      #include "stones.inc"
  26.      ...
  27.      ...
  28.       texture { Red_Marble }
  29.      ...
  30.       texture { Blue_Agate }
  31.      ...
  32.       intersection { Disk_X
  33.      ...
  34.  
  35. If you execute CULL with the following arguments:
  36.  
  37.      CULL SAMPLE.POV SAMPLE.INC
  38.  
  39. CULL will produce the file SAMPLE.INC with these lines:
  40.  
  41.      #declare Cylinder_X = quadric {
  42.         <0.0 1.0 1.0>
  43.         <0.0 0.0 0.0>
  44.         <0.0 0.0 0.0>
  45.         -1.0
  46.      }
  47.  
  48.      #declare Disk_X = intersection { /* Capped cylinder, Length in x axis */
  49.         quadric { Cylinder_X  }
  50.         plane { <1.0 0.0 0.0> -1 inverse  }
  51.         plane { <1.0 0.0 0.0>  1  }
  52.      }
  53.  
  54.      #declare Red_Marble = texture {
  55.         marble
  56.         turbulence 1.0
  57.         colour_map {
  58.            [0.0 0.8   colour red 0.8 green 0.8 blue 0.6
  59.            colour red 0.8 green 0.4 blue 0.4]
  60.            [0.8 1 colour red 0.8 green 0.4 blue 0.4
  61.            colour red 0.8 green 0.2 blue 0.2]
  62.         }
  63.      }
  64.  
  65.      #declare Blue_Agate = texture {
  66.         agate
  67.         colour_map {
  68.            [0.0 0.5   colour red 0.30 green 0.30 blue 0.50
  69.            colour red 0.30 green 0.30 blue 0.50]
  70.            [0.5 0.55  colour red 0.30 green 0.30 blue 0.50
  71.            colour red 0.20 green 0.20 blue 0.30]
  72.            [0.55 0.6  colour red 0.20 green 0.20 blue 0.30
  73.            colour red 0.25 green 0.25 blue 0.35]
  74.            [0.6 0.7   colour red 0.25 green 0.25 blue 0.35
  75.            colour red 0.15 green 0.15 blue 0.26]
  76.            [0.7 0.8   colour red 0.15 green 0.15 blue 0.26
  77.            colour red 0.10 green 0.10 blue 0.20]
  78.            [0.8 0.9   colour red 0.10 green 0.10 blue 0.20
  79.            colour red 0.30 green 0.30 blue 0.50]
  80.            [0.9 1 colour red 0.30 green 0.30 blue 0.50
  81.            colour red 0.10 green 0.10 blue 0.20]
  82.         }
  83.      }
  84.  
  85.      Notice that the declaration "Cylinder_X" was listed because it was found
  86. in "Disk_X."
  87.  
  88.      Now you can replace the multiple #include's with one statement:
  89.  
  90.      #include "SAMPLE.INC"
  91.  
  92.      It is a good idea to leave your old #include statements in your file
  93. by commenting them out (/*  */).  Since CULL ignores comment characters,
  94. this will allow you to make a new composite include file if you change the
  95. declared elements you are using.  You should remove the statement that
  96. names outfile.INC when rerunning CULL however.
  97.  
  98.      CULL allows you to boil down up to 16 .INC files containing up to 1000
  99. declare elements into one small file using only the necessary declare state-
  100. ments.  The will allow you more memory for your precious work of art.
  101.  
  102.  
  103. A NOTE ON SUBDIRECTORIES
  104. ─ ──── ── ──────────────
  105.  
  106.      If you keep your include files in a separate subdirectory, CULL will
  107. not be able to find them.  Make sure that CULL.EXE, infile.POV and all the
  108. necessary .INC files are in the same directory before running CULL.
  109.  
  110.  
  111. SOURCE FILE
  112. ────── ────
  113.  
  114.       The file CULL.BAS is the source file for CULL.EXE.  The program was
  115. written and developed with Microsoft Basic Professional Development
  116. System 7.0 and the Quick Basic Extended environment.  The program should be
  117. compatible with Quick Basic 4.5.  I'd like to hear from anyone with QB45 to
  118. see if this file works with the QB45 system.
  119.  
  120.  
  121. BUGS
  122. ────
  123.  
  124.      Right now there is only one known bug that I am aware of.  If you use a
  125. declared element that contains a substring of another element, CULL will
  126. write both sets of declare statements.  For example, if you were to use the
  127. element "OldGold" CULL will write the following:
  128.  
  129.     #declare Gold = colour red 0.8 green 0.498039 blue 0.196078
  130.     #declare OldGold =  colour red 0.81 green 0.71 blue 0.23
  131.  
  132.  
  133. WHERE TO FIND THE AUTHOR
  134. ───── ── ──── ─── ──────
  135.  
  136.     Whether you find this program useable or unusable, useful or a waste
  137. of precious download time, I'd like to hear your comments.  I'm on the
  138. Chicago Ray-Trace BBS and Compuserve [71574,1514].
  139.  
  140.      Happy Traces!!!
  141.  
  142.      Robert Geissler
  143.      Baton Rouge, LA
  144.      March 1993