POV-Ray : Newsgroups : povray.general : Need help generating a cylindrical solid : Re: Need help generating a cylindrical solid Server Time
29 Jul 2024 06:15:39 EDT (-0400)
  Re: Need help generating a cylindrical solid  
From: Chaanakya
Date: 28 Aug 2012 11:10:01
Message: <web.503cde6a51bfcea0b62e53d00@news.povray.org>
Le_Forgeron <lef### [at] freefr> wrote:
> Le 28/08/2012 16:39, Chaanakya a écrit :
>
> > #declare a =
> >   difference {
> >     cylinder { <-1,0,0>,<1,0,0>,1.00003}
> >     cylinder { <-1.00003,0,0>,<1.00003,0,0>,1}
> >     plane { z,0 }
> >     pigment { color Red }
> >     rotate <0,90,0>
> >     rotate <90,0,0>
> >   }
> >
> > object { a }
> >
> > Now, I want to build the same figure, but piece by piece - start in the middle
> > and work outwards, with each part being a different color.  I thought I could
> > modify the object "a" with some more difference statements and I've made quite a
> > bit of progress on this.  However, there is one sticking point:  when I render
> > the following code, I get one part of the center-most piece sticking out of the
> > next larger one.
> >
>
>
> Keep the shape of a, change the texture for a one based on gradient and
> a pigment map.
>
> "pigment { color Red }"
> becomes
>
> pigment { gradient x pigment_map{
> [0.5 color Red]
> [0.5 color Blue]
> }
> scale ????? your factor here ????
> }

So the final application of this is to put in different indices of refraction
for each piece.  Would this technique still work?  Also, although nothing sticks
out right now (a good sign), I can't get the innermost piece to show up even
when doing a difference between the two pieces like so:

#declare curved_1 =
  difference {
    cylinder { <-1,0,0>,<1,0,0>,1.00003 }
    cylinder { <-1.00003,0,0>,<1.00003,0,0>,1 }
    plane { z,0.9 }
    plane { y,-0.1 }
    plane { -y,-0.1 }
    plane { x,-0.1 }
    plane { -x,-0.1 }
    // rotate <0,90,0>
    // rotate <90,0,0>
  }

#declare curved_2 =
  difference {
    cylinder { <-1,0,0>,<1,0,0>,1.00003 }
    cylinder { <-1.00003,0,0>,<1.00003,0,0>,1 }
    plane { z,0.8 }
    plane { y,-0.2 }
    plane { -y,-0.2 }
    // plane { y,0 }
    plane { x,-0.2 }
    plane { -x,-0.2 }
    // rotate <0,90,0>
    // rotate <90,0,0>
  }

object { curved_1 pigment { color Blue } }

difference {
  object { curved_2 }
  object { curved_1 }
  pigment { color Red }
}

Furthermore, when I made the difference translucent, I still saw nothing of
curved_1.  What am I doing wrong?

Thanks!

- Chaanakya


Post a reply to this message

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