home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / tt / raysh402 / guide.tex / node26_mn.html < prev    next >
Text File  |  1992-02-09  |  3KB  |  71 lines

  1.  
  2. <H2><A ID="SECTION00742000000000000000">
  3. Potential CSG Problems</A>
  4. </H2>
  5.  
  6. <P>
  7. A consistent CSG model is one which is made
  8. up of solid objects with no dangling surfaces.  In <#524#><#1961#><EM>rayshade</EM><#1961#><#524#>,
  9. it is quite easy to construct inconsistent models, which will usually
  10. appear incorrect in the final images.
  11. In <#525#><#1963#><EM>rayshade</EM><#1963#><#525#>, CSG is implemented by maintaining
  12. the tree structure of the CSG operations.  This tree is traversed,
  13. and the operators therein applied, on a per-ray basis.
  14. It is therefore difficult to verify the consistency of
  15. the model ``on the fly.''
  16.  
  17. <P>
  18. One class of CSG problems occur when
  19. surfaces of objects being operated upon
  20. coincide.  For example, when subtracting a box from another box to make a
  21. square cup, the result will be wrong if the tops of the two boxes
  22. coincide.  To correct this, the inner box should be made
  23. slightly taller than the outer box.
  24. A related problem that must be
  25. avoided occurs when two coincident surfaces are assigned
  26. different surface properties.
  27.  
  28. <P>
  29. It may seem that the union operator is unnecessary, since
  30. listing two objects together in an aggregate results
  31. in an image that appears to be the same.
  32. While the result of such a short-cut
  33. may appear the same on the exterior, the interior
  34. of the resulting object will contain
  35. extraneous surfaces.
  36. The following examples show this quite clearly.
  37.  
  38. <P>
  39. <PRE><tex2html_verbatim_mark>verbatim39#</PRE>
  40.  
  41. <P>
  42. The visual evidence of an inconsistent CSG object varies depending
  43. upon the operator being used.
  44. When subtracting a consistent object from and
  45. inconsistent one, the resulting object will appear to be
  46. the union of the two objects, but the shading will be incorrect.
  47. It will appear to be inside-out in places, while correct
  48. in other places.  The inside-out sections indicate the areas
  49. where the problems occur.
  50. Such problems are often caused by
  51. polygons with incorrectly specified
  52. normals, or by surfaces that exactly coincide (which
  53. appear as partial ``Swiss cheese'' objects).
  54.  
  55. <P>
  56. The following example illustrates an attempt to subtract a sphere from
  57. a pyramid defined using an incorrectly facing triangle.  Note
  58. that the resulting image obviously points to which triangle is
  59. reversed.
  60.  
  61. <P>
  62. <PRE><tex2html_verbatim_mark>verbatim40#</PRE>
  63.  
  64. <P>
  65. By default, cylinders and cones do not have end caps, and thus
  66. are not consistent primitives.  One must usually
  67. add endcaps by listing the
  68. cylinder or cone with (correctly-oriented) endcap discs in an aggregate.
  69.  
  70. <P>
  71.