|
![](/i/fill.gif) |
Christian Froeschlin <chr### [at] chrfr de> 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
Post a reply to this message
|
![](/i/fill.gif) |