POV-Ray : Newsgroups : povray.general : Need help generating a cylindrical solid : Re: Need help generating a cylindrical solid Server Time
29 Jul 2024 12:27:30 EDT (-0400)
  Re: Need help generating a cylindrical solid  
From: Chaanakya
Date: 30 Aug 2012 10:40:01
Message: <web.503f7aed51bfcea0b62e53d00@news.povray.org>
"Chaanakya" <nomail@nomail> wrote:
> Christian Froeschlin <chr### [at] chrfrde> wrote:
> > Chaanakya wrote:
> >
> > > As opposed to the different colors being shown throughout the object, I am only
> > > seeing the different 'shells' on one side of the object, which is quite weird.
> >
> > your problem is that your slab is not centered on the origin.
> > Therefore, your "scale 1.00001" resolves the coincident surface problem
> > for the inner surface in the opposite direction you're expecting.
> >
> > You might try something like this:
> >
> > #version 3.6;
> > #include "colors.inc"
> >
> > global_settings {
> >    assumed_gamma 1.0
> >    ambient_light White
> >    max_trace_level 256
> > }
> >
> > camera {
> >    location <0,1,3>
> >    look_at <0,0,0>
> > }
> >
> > light_source {
> >    <100,100,0>
> >    color White
> > }
> >
> > #declare base = difference
> > {
> >    cylinder { <-1,0,0>,<1,0,0>,1.5 }
> >    cylinder { <-1.00003,0,0>,<1.00003,0,0>,1 }
> >    // center desired target part on origin
> >    translate -1.25*z
> > }
> >
> > #declare curved = union
> > {
> >    #declare I = 1;
> >    #while (I < 5)
> >      #declare D = 0.1*I;
> >      intersection
> >      {
> >        object {base}
> >        difference
> >        {
> >          box {<-D,-D,-0.5>,              <D,D,0.5>}
> >          box {<-D+0.0999,-D+0.0999,-0.6>, <D-0.0999,D-0.0999,0.6>}
> >        }
> >        pigment {color <2*D,0,0>}
> >      }
> >      #declare I = I + 1;
> >    #end
> > }
> >
> > object {curved}
> >
> >
> >
> > Note that you can use cylinders instead of boxes if you
> > don't actually want the corners.
> >
> > Also note that for ior the best approach might be to stack solids
> > without differencing away the insides. As long as each solid is
> > fully contained within the outer solid all light rays should
> > traverse the correct ior boundaries.
>
> You, my friend, are awesome :D  Thank you so much :)  That's exactly what I
> wanted!  This thread is now closed :)
>
> Thanks again!
>
> - Chaanakya

Sorry, but there is one thing...for some reason, I seem to see slits or holes of
some sort when I render what you gave me.  Is this some inaccuracy on POVRay's
part?  If so, how can I fix it?

Thanks in advance!

- Chaanakya


Post a reply to this message

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