|
|
On Wed, 13 Feb 2002 21:17:27 -0000, Reuben Pearse wrote:
> OK, so I admit I'm not anywhere near advanced status, but out of interest
> why isn't "difference" a primitive CSG operation (simple answer please!!!)
Because it can be rewritten in terms of more primitive operations.
difference {object{A} object{B}} is the same as
intersection{object{A} object{B inverse}}
In fact, that's how it's actually implemented inside POV.
To answer your next question, merge isn't primitive either.
merge {object{A} object{B}} is the same as
intersection{object{A inverse} object{B inverse} inverse}
but it's not actually implemented that way, for historical reasons (there's
nothing to be gained by rewriting it, so nobody ever did.)
--
#macro R(L P)sphere{L F}cylinder{L P F}#end#macro P(V)merge{R(z+a z)R(-z a-z)R(a
-z-z-z a+z)torus{1F clipped_by{plane{a 0}}}translate V}#end#macro Z(a F T)merge{
P(z+a)P(z-a)R(-z-z-x a)pigment{rgbt 1}hollow interior{media{emission T}}finish{
reflection.1}}#end Z(-x-x.2y)Z(-x-x.4x)camera{location z*-10rotate x*90}
Post a reply to this message
|
|