POV-Ray : Newsgroups : povray.general : slightly-squared torus? : Re: slightly-squared torus? Server Time
3 Aug 2024 12:19:32 EDT (-0400)
  Re: slightly-squared torus?  
From: cubicon
Date: 1 May 2004 15:55:00
Message: <web.40940045ee9f5118ac0dff0b0@news.povray.org>
Sorry, I missunderstood.
The code:
#local minorR = 1;
#local majorR = 3;
#local strW = 3;
// total width = strW + majorR*2 + minorR*2
// total height = minorR*2

#local SecObj =
difference{

#local LR = majorR;
#local sr = minorR;
#local Y0 = 0;
torus{LR, sr translate y*Y0 }

plane  { <1,0,0>, 0 }
plane  { <0,0,1>, 0 }
}

#local DesiredObj = union{
#local Count = 3;
#local I = 0;
#while ( I <= Count )

   object{ SecObj translate<strW/2,0,strW/2> rotate y*90*I }
   #local cylR = minorR;
   #local cylW = strW;
   cylinder{<-cylW/2, 0, 0>  <cylW/2, 0, 0> cylR
translate<0,0,strW/2+majorR> rotate y*90*I }



#local I = I + 1;
#end
}

object{ DesiredObj }

produces this shape: http://www.geocities.com/fcmodelview/sqrtorus.jpg


Post a reply to this message

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