POV-Ray : Newsgroups : povray.binaries.images : Isosurface puzzle Server Time
5 Nov 2024 00:26:09 EST (-0500)
  Isosurface puzzle (Message 1 to 7 of 7)  
From: Thomas de Groot
Subject: Isosurface puzzle
Date: 28 Feb 2008 07:10:12
Message: <47c6a4a4@news.povray.org>
I need a bit of advice.

I try to model the top end of the flutes on a column shaft. It should end 
with a hemispherical feature. However, as you can see on the image, the 
sphere used is much too large, although I thought I coded its size 
correctly. Undoubtedly, I overlooked something.

I add the code below:

//=== start code ===
#declare f_basic = function {pow(x,2) + pow(y,2) + pow(z,2) - 1}
#declare f_flute = function {f_basic((x-1)*10, 0, z*10)}
#declare f_flutebase = function {(x-1)+(y-0.2)}
#declare f_flutetop = function {y-0.8}
#declare f_flutend = function {f_sphere((x-1), (y-0.8), z, 0.1)}

#declare f_hole = function {max((y*y-1),(x*x-1),(z*z-1))}

#declare Roughness = 0.2;
#declare f_rough = function {f_wrinkles(x*Roughness, y*Roughness, 
z*Roughness)}

#macro ColSegment(Flutes,Fbase,Ftop)
#local Angle = 0;

isosurface {
function {max(
            max(f_basic(x, 0, z),
              -f_hole(y,x*8,z*8),
              -f_hole(y-10,x*8,z*8)
              #if (Flutes)
                #while (Angle<365)
                  ,
                  #if (Fbase)
                    -max(f_flute(x*cos(radians(Angle)) - 
z*sin(radians(Angle)), 0, x*sin(radians(Angle)) + 
z*cos(radians(Angle))), -f_flutebase(x*cos(radians(Angle)) - 
z*sin(radians(Angle)), y, x*sin(radians(Angle)) + z*cos(radians(Angle))))
                  #else
                    #if (Ftop)
                      -max(f_flute(x*cos(radians(Angle)) - 
z*sin(radians(Angle)), 0, x*sin(radians(Angle)) + z*cos(radians(Angle))), 
f_flutetop(x*cos(radians(Angle)) - z*sin(radians(Angle)), y, 
x*sin(radians(Angle)) + z*cos(radians(Angle)))),
                      -(f_flutend(x*cos(radians(Angle)) - 
z*sin(radians(Angle)), y, x*sin(radians(Angle)) + z*cos(radians(Angle))))
                    #else
                      -(f_flute(x*cos(radians(Angle)) - 
z*sin(radians(Angle)), 0, x*sin(radians(Angle)) + z*cos(radians(Angle))))
                    #end
                  #end
                  #local Angle = Angle+15;
                #end //of Angle
              #end //of flutes
            ) //end of max()
            + f_rough(x, y, z)
            ,
            (f_sphere(x/2.5,y-0.5,z/2.5, 0.61)
            + f_snoise3d(x,y,z)*0.1)
          ) //end of max()
         } //end of function
  max_gradient 50.0
  contained_by {box {<-1.1, 0, -1.1>, < 1.1, 1, 1.1>}}
  accuracy 1e-3
}

#end //of macro

object {ColSegment(1,0,1)}

//=== end code ===

Thomas


Post a reply to this message


Attachments:
Download 'WeatheredColumn3_test.jpg' (13 KB)

Preview of image 'WeatheredColumn3_test.jpg'
WeatheredColumn3_test.jpg


 

From: Nicolas Alvarez
Subject: Re: Isosurface puzzle
Date: 28 Feb 2008 07:21:22
Message: <47c6a742$1@news.povray.org>
Thomas de Groot escribió:
> I need a bit of advice.
> 
> I try to model the top end of the flutes on a column shaft. It should end 
> with a hemispherical feature. However, as you can see on the image, the 
> sphere used is much too large, although I thought I coded its size 
> correctly. Undoubtedly, I overlooked something.
> 
> I add the code below:
> 
> //=== start code ===
> [...]
>             + f_snoise3d(x,y,z)*0.1)

Just a minor hint: It would be much easier to debug the basic shape if 
you remove any kind of noise or turbulence.


Post a reply to this message

From: Thomas de Groot
Subject: Re: Isosurface puzzle
Date: 28 Feb 2008 07:22:01
Message: <47c6a769$1@news.povray.org>
I should have added that, imo, the problem is with the function f_flutend(), 
or its embedding in the isosurface macro.

Thomas


Post a reply to this message

From: Thomas de Groot
Subject: Re: Isosurface puzzle
Date: 28 Feb 2008 07:26:06
Message: <47c6a85e$1@news.povray.org>
"Nicolas Alvarez" <nic### [at] gmailisthebestcom> schreef in bericht 
news:47c6a742$1@news.povray.org...
>
> Just a minor hint: It would be much easier to debug the basic shape if you 
> remove any kind of noise or turbulence.

Sorry about that! You are right. To simplify, the isosurface should read:

isosurface {
function {
            max(f_basic(x, 0, z),
              -f_hole(y,x*8,z*8),
              -f_hole(y-10,x*8,z*8)
              #if (Flutes)
                #while (Angle<365)
                  ,
                  #if (Fbase)
                    -max(f_flute(x*cos(radians(Angle)) - 
z*sin(radians(Angle)), 0, x*sin(radians(Angle)) + 
z*cos(radians(Angle))), -f_flutebase(x*cos(radians(Angle)) - 
z*sin(radians(Angle)), y, x*sin(radians(Angle)) + z*cos(radians(Angle))))
                  #else
                    #if (Ftop)
                      -max(f_flute(x*cos(radians(Angle)) - 
z*sin(radians(Angle)), 0, x*sin(radians(Angle)) + z*cos(radians(Angle))), 
f_flutetop(x*cos(radians(Angle)) - z*sin(radians(Angle)), y, 
x*sin(radians(Angle)) + z*cos(radians(Angle)))),
                      -(f_flutend(x*cos(radians(Angle)) - 
z*sin(radians(Angle)), y, x*sin(radians(Angle)) + z*cos(radians(Angle))))
                    #else
                      -(f_flute(x*cos(radians(Angle)) - 
z*sin(radians(Angle)), 0, x*sin(radians(Angle)) + z*cos(radians(Angle))))
                    #end
                  #end
                  #local Angle = Angle+15;
                #end //of Angle
              #end //of flutes
            ) //end of max()
         } //end of function
  max_gradient 20.0
  contained_by {box {<-1.1, 0, -1.1>, < 1.1, 1, 1.1>}}
  accuracy 1e-3
}


Thomas


Post a reply to this message

From: Thomas de Groot
Subject: Re: Isosurface puzzle
Date: 28 Feb 2008 08:09:19
Message: <47c6b27f$1@news.povray.org>
"Thomas de Groot" <t.d### [at] internlDOTnet> schreef in bericht 
news:47c6a85e$1@news.povray.org...
>
> "Nicolas Alvarez" <nic### [at] gmailisthebestcom> schreef in 
> bericht news:47c6a742$1@news.povray.org...
>>
>> Just a minor hint: It would be much easier to debug the basic shape if 
>> you remove any kind of noise or turbulence.
>

Without the noise, the isosurface renders correctly...

However, when you add    + f_rough(x, y, z)    to the isosurface function, 
the problem appears again. For reasons I do not understand, the noise 
appears not to influence the inside of the flutes, except for the top 
hemisphere. I tried to put flute and top hemisphere inside a min() function 
(union equivalent) but that makes not any difference.

Thomas


Post a reply to this message

From: Tim Attwood
Subject: Re: Isosurface puzzle
Date: 28 Feb 2008 20:03:53
Message: <47c759f9$1@news.povray.org>
>I need a bit of advice.

Maybe you should try out Christoph's IsoCSG library...
http://www.imagico.de/pov/ic/index.html

#include "iso_csg.inc"

#declare dAngle = 15;

#declare SZ = 1+(360/dAngle);

#declare a_column = array [SZ];

// main column
#declare a_column[0] = IC_Cylinder(<0,0,0>,<0,1,0>,1);

#declare c = 0;
#while (c < 360/dAngle)

// flute
#declare a_column[c+1] =
   IC_Rotate(
      IC_Translate(
         IC_Scale(
            IC_Merge2 (
               IC_Cylinder(<0,-0.1,0>,<0,0.8,0>,0.1),
               IC_Sphere(<0,0.8,0>,0.1)
            ),
            <1,1,0.25>
         ),
         <0,0,-1>
      ),
      <0,c*dAngle,0>
   );

#declare c = c+1;
#end

// difference the flutes from the column
#declare f_column = IC_Difference_Array(a_column);

// wrinkle pattern
#declare R_Freq = 2;
#declare R_SZ = 0.025;
#declare f_rough = function {
   f_wrinkles(x*R_Freq, y*R_Freq,z*R_Freq)*R_SZ
};

#declare column = isosurface {
   function{f_column(x,y,z) + f_rough(x,y,z)}
   max_gradient 50
   contained_by {box {<-1.1, 0, -1.1>, < 1.1, 1, 1.1>}}
   accuracy 1e-3
};

object {column
   pigment {Red}
   finish {
      specular 0.3
      roughness 0.01
   }
}


Post a reply to this message

From: Thomas de Groot
Subject: Re: Isosurface puzzle
Date: 29 Feb 2008 03:12:23
Message: <47c7be67$1@news.povray.org>
Shame on me :-(   I have iso_csg sitting on my system and I just totally 
forgot about it....

Thanks, Tim, for bringing me back to Earth the harsh way :-)

This works as expected indeed. Still, as a matter of curiosity, I wonder why 
my code didn't...

Thomas


Post a reply to this message

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