POV-Ray : Newsgroups : povray.advanced-users : Fat torii leave artifacts with CSG : Fat torii leave artifacts with CSG Server Time
29 Jul 2024 00:28:26 EDT (-0400)
  Fat torii leave artifacts with CSG  
From: David Wallace
Date: 17 Jul 2003 03:12:50
Message: <3f164c72$1@news.povray.org>
When I try to subtract a torus whose inner radius exceeds its outer radius
from a cylinder, it leaves an ovoid behind.  Check out the following
example:

// Object
#declare otbgRad = 0.05;
#declare otbgRadT = 0.005;
#declare otbgHgt = 0.15;
#declare otbgOfs = 0.04;
#declare otbThk = 0.003;
#declare otbRadL = 0.050;
#declare otbRadH = otbRadL*1.6;
#declare otbRadT = otbRadL*1.9;
#declare otbHgtL = otbgRad*.7;
#declare otbHgtH = otbgHgt*0.9;

#declare otbRadTc = (otbRadT+otbRadH-otbThk)*0.5;
#declare otbRadBc = (otbRadT+otbRadH)*0.5;
#declare otbRadTw = (otbRadT-otbRadH+otbThk)*0.5;
#declare otbRadBw = (otbRadT-otbRadH)*0.5;
#declare otbSquB = otbRadBw/(otbRadBw+otbThk);
#declare otbPos = -otbgHgt-otbgRad+otbgRadT;

#declare otBucket = union {
 #local bcut = otbRadL-otbHgtL-otbThk;
 #local brad = otbHgtL-otbThk;
 difference {                                             // Watch this area
  cylinder { -y*otbHgtL, y*0, otbRadL }
  torus { bcut, brad translate -y*otbHgtL sturm }
  //sphere { -y*otbHgtL, brad }
  //cylinder { -y*otbHgtL*1.1, -y*otbThk, bcut }
 }
 difference {
  cone { y*0, otbRadL, y*otbHgtH, otbRadH }
  cone { -y*otbThk, otbRadL-otbThk, y*otbHgtH*1.01, otbRadH-otbThk }
 }
 difference {
  torus { otbRadTc, otbRadTw sturm }
  torus { otbRadBc, otbRadBw scale <1, otbSquB, 1> sturm }
  plane { y, 0 }
  translate y*otbHgtH
 }
 texture { colWheel } // use your own texture here
 translate y*otbHgtL
}

// Instantiation
light_source { <.3, -1.1,  0>, rgb <1, 1, 1> }
camera { location < .1, -0.3,   .01> look_at <0,-0.05, 0> }
object { otBucket translate y*otbPos }

The cylinder cutout, if uncommented, cuts a hole in the ovoid but does not
eliminate it.  The sphere, however, all but wipes it out.  What's going on?


Post a reply to this message

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