POV-Ray : Newsgroups : povray.advanced-users : The Harcore Povrayer Test : Re: The Harcore Povrayer Test Server Time
29 Jul 2024 20:23:11 EDT (-0400)
  Re: The Harcore Povrayer Test  
From: Ron Parker
Date: 13 Feb 2002 16:25:10
Message: <slrna6lmdo.rhv.ron.parker@fwi.com>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.