POV-Ray : Newsgroups : povray.general : Intersection of cylinder and spherical shell Server Time
23 Dec 2024 22:32:07 EST (-0500)
  Intersection of cylinder and spherical shell (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: thisroad
Subject: Intersection of cylinder and spherical shell
Date: 14 Feb 2008 17:20:01
Message: <web.47b4bddb474e1e871f31c40@news.povray.org>
Hi all,

I've drawn up a hollow spherical shell, and have a thin cylinder poking through
it like a straw.  I want to highlight just the intersection spots where this
cylinder meets the shell.  My code looks like this:

intersection
{
 sphere{<0,0,0>,4 hollow
 }

 cylinder{PStart,PEnd,0.5 open
 }


 texture{
  pigment{color Green transmit 0}
  finish{ambient 0.5 phong 0.5}
 }
}

When I run this, it appears that the sphere is always treated like a solid
object -- I can get the cylinder inside the sphere, or outside if I use
"inverse", but not the true intersection points.  Deleting "hollow" doesn't
change the behavior.  What should I do differently?

Thanks!


Post a reply to this message

From: triple r
Subject: Re: Intersection of cylinder and spherical shell
Date: 14 Feb 2008 18:00:00
Message: <web.47b4c5f372c7bea1ae42298f0@news.povray.org>
"thisroad" <nomail@nomail> wrote:

> When I run this, it appears that the sphere is always treated like a solid
> object -- I can get the cylinder inside the sphere, or outside if I use
> "inverse", but not the true intersection points.  Deleting "hollow" doesn't
> change the behavior.  What should I do differently?


What about this?

sphere{<0,0,0>,4
  clipped_by{
     cylinder{PStart,PEnd,0.5}
  }
  pigment{rgb y}
}
......

 - Ricky


Post a reply to this message

From: Zeger Knaepen
Subject: Re: Intersection of cylinder and spherical shell
Date: 14 Feb 2008 18:27:09
Message: <47b4ce4d@news.povray.org>
read the manual, hollow only has meaning if you're using media or fog

why is that keyword so hard to understand? seems like every beginner gets it 
wrong.

Maybe for POV-Ray 4 it should be replaced by something more self-explaining, 
something like "atmosphere on" or so, dunno

cu!
-- 
#macro G(b,e)b+(e-b)*C/50#end#macro _(b,e,k,l)#local C=0;#while(C<50)
sphere{G(b,e)+3*z.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1;
#end#end _(y-x,y,x,x+y)_(y,-x-y,x+y,y)_(-x-y,-y,y,y+z)_(-y,y,y+z,x+y)
_(0x+y.5+y/2x)_(0x-y.5+y/2x)            // ZK http://www.povplace.com


Post a reply to this message

From: thisroad
Subject: Re: Intersection of cylinder and spherical shell
Date: 14 Feb 2008 21:50:00
Message: <web.47b4fdb672c7bea14915bbf10@news.povray.org>
Triple_R, thanks for the input!  I'll play around with that and see what
happens.  It seems like there would be a simple way to create this -- maybe
differencing this sphere with one that's marginally smaller would work.


Zeger, I've read the manual and, in fact, am using 'hollow' precisely because
there's fog in the scene.




"triple_r" <rre### [at] hotmailcom> wrote:
> "thisroad" <nomail@nomail> wrote:
>
> > When I run this, it appears that the sphere is always treated like a solid
> > object -- I can get the cylinder inside the sphere, or outside if I use
> > "inverse", but not the true intersection points.  Deleting "hollow" doesn't
> > change the behavior.  What should I do differently?
>
>
> What about this?
>
> sphere{<0,0,0>,4
>   clipped_by{
>      cylinder{PStart,PEnd,0.5}
>   }
>   pigment{rgb y}
> }
> ......
>
>  - Ricky







"Zeger Knaepen" <zeg### [at] povplacecom> wrote:
> read the manual, hollow only has meaning if you're using media or fog
>
> why is that keyword so hard to understand? seems like every beginner gets it
> wrong.
>
> Maybe for POV-Ray 4 it should be replaced by something more self-explaining,
> something like "atmosphere on" or so, dunno
>
> cu!
> --
> #macro G(b,e)b+(e-b)*C/50#end#macro _(b,e,k,l)#local C=0;#while(C<50)
> sphere{G(b,e)+3*z.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1;
> #end#end _(y-x,y,x,x+y)_(y,-x-y,x+y,y)_(-x-y,-y,y,y+z)_(-y,y,y+z,x+y)
> _(0x+y.5+y/2x)_(0x-y.5+y/2x)            // ZK http://www.povplace.com


Post a reply to this message

From: Warp
Subject: Re: Intersection of cylinder and spherical shell
Date: 15 Feb 2008 03:07:51
Message: <47b54857@news.povray.org>
thisroad <nomail@nomail> wrote:
>  sphere{<0,0,0>,4 hollow

  'hollow' does not affect geometry. It's a keyword related exclusively
to media and fog, nothing else. If there is no media/fog, 'hollow' is a
no-op.

-- 
                                                          - Warp


Post a reply to this message

From: Warp
Subject: Re: Intersection of cylinder and spherical shell
Date: 15 Feb 2008 03:09:58
Message: <47b548d6@news.povray.org>
Zeger Knaepen <zeg### [at] povplacecom> wrote:
> why is that keyword so hard to understand? seems like every beginner gets it 
> wrong.

  Not only that, 'hollow' is often used as a cure-all remedy for every
possible imaginable problem people encounter. For example, I have seen
it suggested when someone had problems with rendering artifacts with an
isosurface.

-- 
                                                          - Warp


Post a reply to this message

From: Chris B
Subject: Re: Intersection of cylinder and spherical shell
Date: 15 Feb 2008 03:46:31
Message: <47b55167@news.povray.org>
"thisroad" <nomail@nomail> wrote in message 
news:web.47b4fdb672c7bea14915bbf10@news.povray.org...
> Triple_R, thanks for the input!  I'll play around with that and see what
> happens.  It seems like there would be a simple way to create this --  
> maybe
> differencing this sphere with one that's marginally smaller would work.
>

If you want to see the two rings where the surfaces of the sphere and the 
cylinder touch you'll need to give them some thickness. Yes, you can do this 
for the sphere by differencing a smaller sphere. You can do the same for the 
cylinder by differencing it with another cylinder of a smaller radius.

intersection {
  difference {
    sphere {...}  // Big Sphere
    sphere {...}  // Smaller Sphere
  }
  difference {
    cylinder {...} // Big Cylinder
    cylinder {...} // Smaller Cylinder
  }
}

You shouldn't need the 'open' keyword on the cylinder.

Regards,
Chris B.


Post a reply to this message

From: Arne Kleinophorst
Subject: Re: Intersection of cylinder and spherical shell
Date: 15 Feb 2008 04:40:30
Message: <47b55e0e@news.povray.org>
Maybe this would be clearer if the keyword wouldn't be hollow but 
something else. 'Hollow' does have a meaning which simply doesn't fit 
its purpose.

just my 2 cents

Warp schrieb:
> thisroad <nomail@nomail> wrote:
>>  sphere{<0,0,0>,4 hollow
> 
>   'hollow' does not affect geometry. It's a keyword related exclusively
> to media and fog, nothing else. If there is no media/fog, 'hollow' is a
> no-op.
>


Post a reply to this message

From: Alain
Subject: Re: Intersection of cylinder and spherical shell
Date: 15 Feb 2008 17:12:27
Message: <47b60e4b$1@news.povray.org>
Chris B nous apporta ses lumieres en ce 2008/02/15 03:44:
> "thisroad" <nomail@nomail> wrote in message 
> news:web.47b4fdb672c7bea14915bbf10@news.povray.org...
>> Triple_R, thanks for the input!  I'll play around with that and see what
>> happens.  It seems like there would be a simple way to create this --  
>> maybe
>> differencing this sphere with one that's marginally smaller would work.
>>
> 
> If you want to see the two rings where the surfaces of the sphere and the 
> cylinder touch you'll need to give them some thickness. Yes, you can do this 
> for the sphere by differencing a smaller sphere. You can do the same for the 
> cylinder by differencing it with another cylinder of a smaller radius.
> 
> intersection {
>   difference {
>     sphere {...}  // Big Sphere
>     sphere {...}  // Smaller Sphere
>   }
>   difference {
>     cylinder {...} // Big Cylinder
>     cylinder {...} // Smaller Cylinder
>   }
> }
> 
> You shouldn't need the 'open' keyword on the cylinder.
> 
> Regards,
> Chris B. 
> 
> 
Make the inside cylinder a bit longer than the outer one. If they are the same 
length, you'll have coincident surfaces at each ends.

-- 
Alain
-------------------------------------------------
You know you've been raytracing too long when your source files are starting to 
get bigger than the image files.
     -- Matt


Post a reply to this message

From: Chris B
Subject: Re: Intersection of cylinder and spherical shell
Date: 15 Feb 2008 17:48:07
Message: <47b616a7$1@news.povray.org>
"Alain" <ele### [at] netscapenet> wrote in message 
news:47b60e4b$1@news.povray.org...
>
> Make the inside cylinder a bit longer than the outer one. If they are the 
> same length, you'll have coincident surfaces at each ends.
>
> -- 
> Alain
>

That's good general advice. In this case it's not going to make a difference 
as the ends of the cylinders won't be part of the results of the 
intersection anyway.

Regards,
Chris B.


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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