POV-Ray : Newsgroups : povray.binaries.scene-files : Stupid math problem, HELP!!!!! : Re: Stupid math problem, HELP!!!!! Server Time
29 Apr 2024 11:20:27 EDT (-0400)
  Re: Stupid math problem, HELP!!!!!  
From: Mark Palmquist
Date: 10 Feb 1999 00:42:48
Message: <36C11DC0.66599660@earthlink.net>
Thanks guys, Ken it's not a 'bug' just need to move the 1st difference outside
the loop.
new code below.


#declare grooves = 16
#declare base = 0
#declare top = 5
#declare a = 0;

difference {
cylinder{y*base, y*top, 1.0 pigment {red 1}}
#while  (a < grooves)
  cylinder{y*(base - .01) , y*(top + .1) , 0.1 pigment {blue 1} translate x*1
rotate y*(360/grooves)*a}
  #declare a = a + 1;
#end
}

Ken wrote:

> You math guy's make me laugh. As I see it he want's 10 grooves
> equaly spaced around a cylinder right ?
>
> camera{location<0,0,-7> look_at 0}
> light_source{<0, 35,-400>rgb 1}
>
> #declare a = 0;
> #while  (a < 10)
> difference {
>
> cylinder{y*0.00, y*3.0, 1.0 pigment {red 1}}
> cylinder{y*-0.1, y*3.1, 0.1 pigment {blue 1} translate x*1 rotate y*36*a}}
>
> #declare a = a + 1;
> #end
>
> Unfortunatly the above positioned the differencing cylinders
> correctly around the cylinder but does not perform the csg operation.
> Is this a bug ?
>
> The situation below places the differencing cylinders in the exact
> same positions and does the csg operation correctly.
>
> #declare DiffObject =
> cylinder{y*-.1,y*3.1,.1 pigment{blue 1}translate x*1}
>
> difference{
> cylinder{y*0,y*3,1 pigment {red 1}}
>
> object{DiffObject rotate y*  0}
> object{DiffObject rotate y* 36}
> object{DiffObject rotate y* 72}
> object{DiffObject rotate y*108}
> object{DiffObject rotate y*144}
> object{DiffObject rotate y*180}
> object{DiffObject rotate y*216}
> object{DiffObject rotate y*252}
> object{DiffObject rotate y*288}
> object{DiffObject rotate y*324}}
>
> Would someone care to elaborate as to why one method works
> and the other does not ?
>
> --
> Ken Tyler
>
> mailto://tylereng@pacbell.net


Post a reply to this message

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