POV-Ray : Newsgroups : povray.general : Need help generating a cylindrical solid Server Time
29 Jul 2024 10:24:39 EDT (-0400)
  Need help generating a cylindrical solid (Message 11 to 20 of 21)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 1 Messages >>>
From: Christian Froeschlin
Subject: Re: Need help generating a cylindrical solid
Date: 29 Aug 2012 19:09:13
Message: <503ea119$1@news.povray.org>
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.


Post a reply to this message

From: Chaanakya
Subject: Re: Need help generating a cylindrical solid
Date: 30 Aug 2012 09:05:01
Message: <web.503f649e51bfcea0b62e53d00@news.povray.org>
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


Post a reply to this message

From: Chaanakya
Subject: Re: Need help generating a cylindrical solid
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

From: Christian Froeschlin
Subject: Re: Need help generating a cylindrical solid
Date: 30 Aug 2012 19:52:49
Message: <503ffcd1$1@news.povray.org>
Chaanakya wrote:

> 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?

Is this already when using ior? There is small gap between
each part to avoid coincident surface, which may cause extra
reflections that look unexpected.


Post a reply to this message

From: Chaanakya
Subject: Re: Need help generating a cylindrical solid
Date: 31 Aug 2012 11:30:00
Message: <web.5040d7cc51bfcea0b62e53d00@news.povray.org>
Christian Froeschlin <chr### [at] chrfrde> wrote:
> Chaanakya wrote:
>
> > 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?
>
> Is this already when using ior? There is small gap between
> each part to avoid coincident surface, which may cause extra
> reflections that look unexpected.

No, it's when I use almost the exact same code you gave me.  All I did was
declare a new variable N (number of shells) and set it equal to 50.  If I set it
to 10, it's perfectly fine.


Post a reply to this message

From: clipka
Subject: Re: Need help generating a cylindrical solid
Date: 31 Aug 2012 16:08:47
Message: <504119cf$1@news.povray.org>
Am 31.08.2012 17:27, schrieb Chaanakya:
> Christian Froeschlin <chr### [at] chrfrde> wrote:
>> Chaanakya wrote:
>>
>>> 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?
>>
>> Is this already when using ior? There is small gap between
>> each part to avoid coincident surface, which may cause extra
>> reflections that look unexpected.
>
> No, it's when I use almost the exact same code you gave me.  All I did was
> declare a new variable N (number of shells) and set it equal to 50.  If I set it
> to 10, it's perfectly fine.

what's your max_trace_level setting?


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Need help generating a cylindrical solid
Date: 1 Sep 2012 08:30:52
Message: <5041fffc$1@news.povray.org>
Chaanakya wrote:

> No, it's when I use almost the exact same code you gave me.  All I did was
> declare a new variable N (number of shells) and set it equal to 50.  If I set it
> to 10, it's perfectly fine.

I tried with 3.6 and 3.7 using I < 50 (and D = 0.02*I) but did not see
any problem. Please post the exact scene and render settings used.


Post a reply to this message

From: Chaanakya
Subject: Re: Need help generating a cylindrical solid
Date: 5 Sep 2012 16:35:01
Message: <web.5047b74c51bfcea0b62e53d00@news.povray.org>
Christian Froeschlin <chr### [at] chrfrde> wrote:
> Chaanakya wrote:
>
> > No, it's when I use almost the exact same code you gave me.  All I did was
> > declare a new variable N (number of shells) and set it equal to 50.  If I set it
> > to 10, it's perfectly fine.
>
> I tried with 3.6 and 3.7 using I < 50 (and D = 0.02*I) but did not see
> any problem. Please post the exact scene and render settings used.

I think the problem is there only if I do not use antialiasing.  Anyway, here's
the code:

#version 3.6;
#include "colors.inc"

global_settings {
   assumed_gamma 1.0
   ambient_light White
   max_trace_level 256
}

camera {
   location <0,0,4>
   look_at <0,0,0>
}

light_source {
   <100,100,0>
   color White
}

plane {
  y, -10
  pigment { hexagon Green, White, Blue }
}

// box {
//   -0.5, 0.5
//   pigment { checker Red, Blue }
// }

#declare base = difference
{
   cylinder { <-1,0,0>,<1,0,0>,1.00003 }
   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;
  #declare N = 10;
  #declare my_ior = -2.3;
  #declare my_ior_increment = (-1 - -2.3)/(N);
  #while (I < N)
    #declare D = (1/N)*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> }
      // pigment { transmit 1 }
      // finish {
      //  ambient 0
      //  diffuse 0
      //  reflection {
      //    1
      //    fresnel on
      //  }
      //  specular 0
      //  roughness 0.001
      // }
      // interior {
      //  ior my_ior
      // }
      rotate <0,0,90>
      translate <0,0,2>
    }
    #declare I = I + 1;
    #declare my_ior = my_ior + my_ior_increment;
  #end
}

object {curved}

Without antialiasing, this produces random little 'holes'.  However, I think
that with antialiasing, it should be fine.

Thanks again for all your help!

- Chaanakya


Post a reply to this message

From: Alain
Subject: Re: Need help generating a cylindrical solid
Date: 5 Sep 2012 16:41:33
Message: <5047b8fd$1@news.povray.org>

> Christian Froeschlin <chr### [at] chrfrde> wrote:
>> Chaanakya wrote:
>>
>>> No, it's when I use almost the exact same code you gave me.  All I did was
>>> declare a new variable N (number of shells) and set it equal to 50.  If I set it
>>> to 10, it's perfectly fine.
>>
>> I tried with 3.6 and 3.7 using I < 50 (and D = 0.02*I) but did not see
>> any problem. Please post the exact scene and render settings used.
>
> I think the problem is there only if I do not use antialiasing.  Anyway, here's
> the code:
> ...

> Without antialiasing, this produces random little 'holes'.  However, I think
> that with antialiasing, it should be fine.
>
> Thanks again for all your help!
>
> - Chaanakya
>
>
When you use antialiasing, you take additional sub-samples in some 
pixels and average them.
When you have any coincident surfaces, it cause lots of, semi-random, 
noise. That noise trigger the antialiasing. The averaging of that noise 
result in smaller dark pixels having a LOT less contrast. This 
effectively hides most of the problem.


Alain


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Need help generating a cylindrical solid
Date: 5 Sep 2012 19:00:06
Message: <5047d976$1@news.povray.org>
Chaanakya wrote:

> I think the problem is there only if I do not use antialiasing.

the gaps are a little big for this scale, replace the values
of "0.0999" with "0.9999" or "0.99999".


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 1 Messages >>>

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