POV-Ray : Newsgroups : povray.general : Half a cylinder (with open ends) : Re: Half a cylinder (with open ends) Server Time
29 Jul 2024 14:17:42 EDT (-0400)
  Re: Half a cylinder (with open ends)  
From: Chaanakya
Date: 26 Jul 2012 14:45:01
Message: <web.50118f3dc440f4797f523b7e0@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> Chaanakya <nomail@nomail> wrote:
> > Warp <war### [at] tagpovrayorg> wrote:
> > > Chaanakya <nomail@nomail> wrote:
> > > > I was trying to create half of a hollow cylinder (both ends open).  I tried
> > > > using CSG with an intersection, and that gave me a half a hollow cylinder, but
> > > > I'd like to not have a plane on the end.  That is, I'd like essentially a
curved
> > > > plane (the side of the cylinder without the endcaps).  Is there some
> > > > transformation I could use on, for example, a box to achieve this?
> > >
> > > Just make a difference of the cylinder and another cylinder with a slightly
> > > smaller radius and which is a bit longer ther the first cylinder.
>
> > Thanks!  That lets me control the thickness of the resulting object.  How would
> > I cut it in half?
>
> Ah, I didn't notice that you also wanted to cut it in half. I only paid
> attention to your problem of getting the end caps on the cylinder, most
> probably because your differenced cylinder was not long enough.
>
> You can cut the hollow cylinder in half by differencing (or intersecting) it
> with an appropriately placed and sized box. You just have to figure out the
> coordinates (this shouldn't be difficult if your cylinder is on a main axis;
> you can translate and rotate it later to its final position).

Just for posterity, here's how I managed to do this:

difference {
  cylinder { <-1,0,0>,<1,0,0>,1.003}
  cylinder { <-1.00003,0,0>,<1.00003,0,0>,1}
  plane { z,0 }
}

That's for a half-cylinder 0.003 cm thick (I am treating 1 POV-Ray unit as 1
cm).  As you can see Warp, planes work just as well as boxes (it's just a bit
harder to tell which side is 'inside').

Thanks again! :)

- Chaanakya


Post a reply to this message

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