POV-Ray : Newsgroups : povray.binaries.images : Half_Rounded_cylinder Server Time
30 Jul 2024 08:27:11 EDT (-0400)
  Half_Rounded_cylinder (Message 1 to 1 of 1)  
From: B  Gimeno
Subject: Half_Rounded_cylinder
Date: 26 Jul 2012 14:05:01
Message: <web.501186307693d81951f818f50@news.povray.org>
subject in pov-ray.general

#macro Half_Rounded_Cylinder(Lenght,Radius,Hollow_Radius)
 union {
       // the hollow cilinder
       difference {
                  union {
                      cylinder {<-Lenght/2,0,0>,<Lenght/2,0,0>,Radius}
                      sphere {<-Lenght/2,0,0>,Radius}
                      sphere {< Lenght/2,0,0>,Radius}
                      }
                  cylinder {<-Lenght/2,0,0>,<Lenght/2,0,0>,Hollow_Radius}
                  sphere {<-Lenght/2,0,0>,Hollow_Radius}
                  sphere {< Lenght/2,0,0>,Hollow_Radius}
                  plane {-y,0}
                  }
       // rounded borders
       cylinder {<-Lenght/2,0,Hollow_Radius+((Radius-Hollow_Radius)*.5)>,
                 <Lenght/2,0,Hollow_Radius+((Radius-Hollow_Radius)*.5)>,
                 (Radius-Hollow_Radius)/2}
       cylinder {<-Lenght/2,0,-Hollow_Radius-((Radius-Hollow_Radius)*.5)>,
                 <Lenght/2,0,-Hollow_Radius-((Radius-Hollow_Radius)*.5)>,
                 (Radius-Hollow_Radius)/2}
       difference {
         union {
               torus
{Hollow_Radius+((Radius-Hollow_Radius)*.5),(Radius-Hollow_Radius)*.5 translate
-x*Lenght/2}
               torus
{Hollow_Radius+((Radius-Hollow_Radius)*.5),(Radius-Hollow_Radius)*.5 translate
x*Lenght/2}
               }
         cylinder {<-Lenght/2,0,0>,<Lenght/2,0,0>,Radius}
         } // end of torii csg

       pigment {Tan}
       finish {phong .6 reflection .1}
       }
#end

object { Half_Rounded_Cylinder(4,1.5,1.2) translate y*1.33 rotate y*-25}


Post a reply to this message


Attachments:
Download 'rounded_cylinder.jpg' (58 KB)

Preview of image 'rounded_cylinder.jpg'
rounded_cylinder.jpg


 

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