POV-Ray : Newsgroups : povray.binaries.images : A method creat uniform thick shell : Re: A method creat uniform thick shell Server Time
19 Apr 2024 18:43:51 EDT (-0400)
  Re: A method creat uniform thick shell  
From: And
Date: 26 Oct 2013 11:35:01
Message: <web.526bdfe2dce0719a84f168e50@news.povray.org>
I explain this method. The basic concept is just that specifying different
threshold values to a function will produce different but similar isosurfaces.
For instance, in the right picture, upper surface of the shell is
y-sin(2.5*x)= 0.08 , lower surface is
y-sin(2.5*x)=-0.08

Use csg difference in pov-ray between these two isosurface objects can produce a
shell.

//---------------------code----------------------------

#declare f_sin=function(var1,var2,k){
var2-sin(k*var1)
}


#declare CSG_OVERLAP=0.000001;
difference{
isosurface{
function{f_sin(x,z,2.5)-0.08}
max_gradient 2
contained_by{box{<-5,-1,-1.5><5,2,1.5>}}
all_intersections
}
isosurface{
function{f_sin(x,z,2.5)+0.08}
max_gradient 2
contained_by{box{<-5,-1-CSG_OVERLAP,-1.5-CSG_OVERLAP><5,2+CSG_OVERLAP,1.5>}}
all_intersections
}
}

//-----------------------end of code-----------------------

But the shell's thickness is not a canstant. I found a method modifying the
function to let it have uniform thickness at least in a small range.


Post a reply to this message


Attachments:
Download 'sin.jpg' (130 KB)

Preview of image 'sin.jpg'
sin.jpg


 

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