POV-Ray : Newsgroups : povray.general : Half a cylinder (with open ends) : Re: Half a cylinder (with open ends) Server Time
29 Jul 2024 08:23:56 EDT (-0400)
  Re: Half a cylinder (with open ends)  
From: clipka
Date: 26 Jul 2012 10:49:35
Message: <501158ff$1@news.povray.org>
Am 26.07.2012 16:31, schrieb Chaanakya:
> clipka <ano### [at] anonymousorg> wrote:
>> Am 26.07.2012 16:02, schrieb Chaanakya:
>>> "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?
>>>>
>>>> - Chaanakya
>>>
>>> This is a bit weird....the shell seems way too thick when I render this:
>>>
>>> #version 3.6;
>>> #include "colors.inc"
>>>
>>> global_settings {
>>>     max_trace_level 256
>>>     ambient_light White
>>>     assumed_gamma 1.0
>>> }
>>>
>>> camera {
>>>     location <10,0,0>
>>>     look_at <0,0,0>
>>>     //rotate <0,0,-clock*90>
>>> }
>>>
>>> light_source {
>>>     <0,100,0>
>>>     color White
>>> }
>>>
>>> plane {
>>>     y, -10
>>>     pigment { hexagon Green, White, Blue }
>>> }
>>>
>>> difference {
>>>     cylinder { <-1,0,0>,<1,0,0>,1}
>>>     cylinder { <-1.00003,0,0>,<1.00003,0,0>,0.99999999}
>>>     pigment { color Red }
>>> }
>>>
>>> The shell should be barely visible, but it's quite thick.  Why?  Is it floating
>>> point error?
>>
>> What you're seeing is just a perspective effect; change the camera
>> location to e.g. <10,3,0> and light source position to e.g. <100,100,0>
>> to better see what's goung on.
>
> Ah I understand.  Thank you!  Is there any way to now cut that object in half
> (without ending up with a plane "capping" it)?

Yes: Introduce a plane to the difference.

Note how the plane only "caps" the object at the resulting cuts, in this 
case the walls of the tube. Before that, what you cut was a solid cylinder.

You need to think in terms of solid bodies (after all it's called CSG = 
Constructive Solid Geometry): If you have a solid cylindrical object, 
and a big planar tool to "disintegrate" part of it, your remaining 
object will be a solid semi-cylinder. OTOH, if you have a solid 
cylinder, use a cylindrical tool to "disintegrate" a cylindrical part at 
its center (giving you a tube with a measurable wall thickness), and 
then use that big planar tool, your remaining object will be a half-pipe 
(with a measurable wall thickness).


Post a reply to this message

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