POV-Ray : Newsgroups : povray.binaries.images : A method creat uniform thick shell : Re: A method creat uniform thick shell Server Time
26 Apr 2024 10:37:54 EDT (-0400)
  Re: A method creat uniform thick shell  
From: And
Date: 26 Oct 2013 11:55:00
Message: <web.526be5c5dce0719a84f168e50@news.povray.org>
The method had been represented the other day. The modified function for sin
function is
(y-sin(2.5*x))/sqrt(2.5^2*cos(2.5*x)^2+1)= 0.08 ,
(y-sin(2.5*x))/sqrt(2.5^2*cos(2.5*x)^2+1)=-0.08
                                          ^^^^^^
                                           0.08 represent the thickness/2

Then use pov-ray's csg difference:

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

#declare f_sin_normalized=function(var1,var2,k){
f_sin(var1,var2,k)
/sqrt(k*k*pow(cos(k*var1),2)+1)
}

#declare CSG_OVERLAP=0.000001;
difference{
isosurface{
function{f_sin_normalized(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_normalized(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--------------------------
Drew the picture!!


Post a reply to this message


Attachments:
Download 'sin_normalized.jpg' (117 KB)

Preview of image 'sin_normalized.jpg'
sin_normalized.jpg


 

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