home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Crawly Crypt Collection 1
/
crawlyvol1.bin
/
tt
/
raysh402
/
guide.tex
/
node26_mn.html
< prev
next >
Wrap
Text File
|
1992-02-09
|
3KB
|
71 lines
<H2><A ID="SECTION00742000000000000000">
Potential CSG Problems</A>
</H2>
<P>
A consistent CSG model is one which is made
up of solid objects with no dangling surfaces. In <#524#><#1961#><EM>rayshade</EM><#1961#><#524#>,
it is quite easy to construct inconsistent models, which will usually
appear incorrect in the final images.
In <#525#><#1963#><EM>rayshade</EM><#1963#><#525#>, CSG is implemented by maintaining
the tree structure of the CSG operations. This tree is traversed,
and the operators therein applied, on a per-ray basis.
It is therefore difficult to verify the consistency of
the model ``on the fly.''
<P>
One class of CSG problems occur when
surfaces of objects being operated upon
coincide. For example, when subtracting a box from another box to make a
square cup, the result will be wrong if the tops of the two boxes
coincide. To correct this, the inner box should be made
slightly taller than the outer box.
A related problem that must be
avoided occurs when two coincident surfaces are assigned
different surface properties.
<P>
It may seem that the union operator is unnecessary, since
listing two objects together in an aggregate results
in an image that appears to be the same.
While the result of such a short-cut
may appear the same on the exterior, the interior
of the resulting object will contain
extraneous surfaces.
The following examples show this quite clearly.
<P>
<PRE><tex2html_verbatim_mark>verbatim39#</PRE>
<P>
The visual evidence of an inconsistent CSG object varies depending
upon the operator being used.
When subtracting a consistent object from and
inconsistent one, the resulting object will appear to be
the union of the two objects, but the shading will be incorrect.
It will appear to be inside-out in places, while correct
in other places. The inside-out sections indicate the areas
where the problems occur.
Such problems are often caused by
polygons with incorrectly specified
normals, or by surfaces that exactly coincide (which
appear as partial ``Swiss cheese'' objects).
<P>
The following example illustrates an attempt to subtract a sphere from
a pyramid defined using an incorrectly facing triangle. Note
that the resulting image obviously points to which triangle is
reversed.
<P>
<PRE><tex2html_verbatim_mark>verbatim40#</PRE>
<P>
By default, cylinders and cones do not have end caps, and thus
are not consistent primitives. One must usually
add endcaps by listing the
cylinder or cone with (correctly-oriented) endcap discs in an aggregate.
<P>