POV-Ray : Newsgroups : povray.general : Re: Round_Box #macro (in shapes.inc) and negative values : Re: Round_Box #macro (in shapes.inc) and negative values Server Time
6 Aug 2024 08:16:09 EDT (-0400)
  Re: Round_Box #macro (in shapes.inc) and negative values  
From: Anders K 
Date: 23 Apr 2002 10:29:23
Message: <3cc56fc3@news.povray.org>
There's a huge difference between a box with two identical points and a
cylinder with two identical points. For a box with two identical points, the
standard formula for a box is still valid; no special checks are needed for
this case. There is no reason to arbitrarily disallow such a box.

For a cylinder with two identical points, however, there is no way to
compute the direction of the cylinder, which is needed to figure out how to
align the end caps. An attempt to render this cylinder would result in a
division by zero. So the current behavior makes sense in both cases.

Anders


--
light_source{6#local D=#macro B(E)#macro A(D)#declare E=(E-#declare
C=mod(E D);C)/D;C#end#while(E)#if(A(8)=7)#declare D=D+2.8;#else#if(
C>2)}torus{1..2clipped_by{box{-2y}}rotate<1 0C>*90translate<D+1A(2)
*2+1#else}cylinder{0(C-v=1).2translate<D+C*A(2)A(4)#end-2 13>finish
{specular 1}pigment{rgb x}#end#end#end-8;1B(445000298)B(519053970)B
(483402386)B(1445571258)B(77778740)B(541684549)B(42677491)B(70)}


Post a reply to this message

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