POV-Ray : Newsgroups : povray.newusers : cylinder walls Server Time
24 Nov 2024 07:10:05 EST (-0500)
  cylinder walls (Message 1 to 5 of 5)  
From: tiocfaidh
Subject: cylinder walls
Date: 26 Aug 2009 04:55:01
Message: <web.4a94f7e9b9b7383db357110e0@news.povray.org>
How could I create a hollow cylinder but with thicker walls?


Post a reply to this message

From: clipka
Subject: Re: cylinder walls
Date: 26 Aug 2009 05:47:39
Message: <4a9504bb@news.povray.org>
tiocfaidh schrieb:
> How could I create a hollow cylinder but with thicker walls?

You need to cut a hole into a solid cylinder using CSG:

difference {
   #local Dir = vnormalize(B-A);
   cylinder { A,B,Radius }
   cylinder { A+Dir*Thickness,B-Dir*Thickness,Radius-Thickness }
}

where A and B are center coordinates of the top and bottom, 
respectively, and Radius and Thickness are the outer cylinder radius and 
the thickness of the cylinder, respectively.

This will create an airtight hollow cylinder. To have open ends, instead 
use:

difference {
   #local Dir = vnormalize(B-A);
   cylinder { A,B,Radius }
   cylinder { A-Dir*0.01,B+Dir*0.01,Radius-Thickness }
}


Post a reply to this message

From: tiocfaidh
Subject: Re: cylinder walls
Date: 26 Aug 2009 06:15:01
Message: <web.4a9509f794c8b39fb357110e0@news.povray.org>
could you show me a small example, im trying to play around with the variables
but its not working, get a huge shape

difference {
   #local Dir = vnormalize(1-2);
   cylinder { 2,1,3 }
   cylinder { 2-Dir*0.01,1+Dir*0.01,3-1 }
}


Post a reply to this message

From: clipka
Subject: Re: cylinder walls
Date: 26 Aug 2009 07:31:16
Message: <4a951d04$1@news.povray.org>
tiocfaidh schrieb:
> could you show me a small example, im trying to play around with the variables
> but its not working, get a huge shape

Make sure to use vectors for A and B.

For instance:

   #local A = <0,0,0>;
   #local B = <0,2,0>;
   #local Radius = 0.8;
   #local Thickness = 0.2;
   difference {
     #local Dir = vnormalize(B-A);
     cylinder { A,B,Radius }
     cylinder { A-Dir*0.01,B+Dir*0.01,Radius-Thickness }
   }

or, with all the math already worked out and hard-coded:

   difference {
     cylinder { <0,0,0>, <0,2,0>, 0.8 }
     cylinder { <0,-0.02,0>, <0,2.02,0>, 0.6 }
   }


Post a reply to this message

From: Tim Attwood
Subject: Re: cylinder walls
Date: 27 Aug 2009 19:34:36
Message: <4a97180c$1@news.povray.org>
> How could I create a hollow cylinder but with thicker walls?

#macro Pipe(P1, P2, r1, r2)   
  #local _P3 = P1 - 0.1*(P2-P1); // V1 - 0.1*V2
  #local _P4 = P1 + 1.1*(P2-P1); // V1 + 1.1*V2
  difference {
    cylinder {P1,P2,r1}
    cylinder {_P3,_P4,r2}
  }
#end

// example 
Pipe(<0,0,0>,<0,1,0>,0.5,0.45)


Post a reply to this message

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