|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hi,
I have a method using isosurface render spheroid shell below.
use this two function
#declare f_spheroid=function(var1,var2,var3, a,b){
var1*var1/a/a+var2*var2/a/a+var3*var3/b/b-1
}
#declare f_spheroid_normalized=function(var1,var2,var3, a,b){
f_spheroid(var1,var2,var3, a,b)
/sqrt(4*(var1*var1+var2*var2)/pow(a,4)+4*var3*var3/pow(b,4))
}
//than difference these two isosurfaces
difference{
isosurface{
function{f_spheroid(x,y,z,1,3)}
}
isosurface{
function{f_spheroid_normalized(x,y,z,1,3)+thickness}
}
}
Post a reply to this message
Attachments:
Download 'spheroid shell diffuse .jpg' (28 KB)
Preview of image 'spheroid shell diffuse .jpg'
|
|
| |
| |
|
|
|
|
| |
| |
|
|
And the transparency version below:
this method just modify mathematic function f by divide a factor
sqrt((∂f/∂x)^2+(∂f/∂y)^2+(∂f/∂z)^2)
It can be used in many well-behaved mathematic function(differentiable and
continue function and no singularity I think...)
Post a reply to this message
Attachments:
Download 'spheroid shell transparency.jpg' (28 KB)
Preview of image 'spheroid shell transparency.jpg'
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"And" <49341109@ntnu.edu.tw> wrote:
> this method just modify mathematic function f by divide a factor
> sqrt((∂f/∂x)^2+(∂f/∂y)^2+(∂f/∂z)^2)
It can't show the symbol...
....I mean
f_normalized(x,y,z)=
f(x,y,z)
/sqrt(
(partial derivative of f(x,y,z) in x)^2
+(partial derivative of f(x,y,z) in y)^2
+(partial derivative of f(x,y,z) in z)^2
)
then set a threshold to displacement it by a (not too large) thickness.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
This is another function and picture:
#declare CSG_OVERLAP=0.000001;
#declare f_quartic=function(var1,var2){
pow(var1,4)+2*var1*var1*var2*var2+var1*var1-1
}
#declare f_quartic_normalized=function(var1,var2){
f_quartic(var1,var2)
/sqrt(16*pow(var1,6)+(48*var2*var2+16)*pow(var1,4)+(16*pow(var2,4)+16*var2*var2+4)*var1*var1)
}
difference{
isosurface{
function{f_quartic(y,x)}
max_gradient 10
contained_by{box{<-3,0,-1><3,1.3,3>}}
all_intersections
}
isosurface{
function{f_quartic_normalized(y,x)+0.04}
max_gradient 10
contained_by{box{<-3,0-CSG_OVERLAP,-1-CSG_OVERLAP><3,1.3,3+CSG_OVERLAP>}}
all_intersections
}
}
Post a reply to this message
Attachments:
Download 'isosurface shell.jpg' (28 KB)
Preview of image 'isosurface shell.jpg'
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"And" <49341109@ntnu.edu.tw> wrote:
> This is another function and picture:
> #declare CSG_OVERLAP=0.000001;
> #declare f_quartic=function(var1,var2){
> pow(var1,4)+2*var1*var1*var2*var2+var1*var1-1
> }
>
> #declare f_quartic_normalized=function(var1,var2){
> f_quartic(var1,var2)
>
/sqrt(16*pow(var1,6)+(48*var2*var2+16)*pow(var1,4)+(16*pow(var2,4)+16*var2*var2+4)*var1*var1)
> }
>
> difference{
> isosurface{
> function{f_quartic(y,x)}
> max_gradient 10
> contained_by{box{<-3,0,-1><3,1.3,3>}}
> all_intersections
> }
> isosurface{
> function{f_quartic_normalized(y,x)+0.04}
> max_gradient 10
> contained_by{box{<-3,0-CSG_OVERLAP,-1-CSG_OVERLAP><3,1.3,3+CSG_OVERLAP>}}
> all_intersections
> }
> }
I've tried to use yours functions but I have an error message:
Parse Error: Floating-point exception detected in function
'f_quartic_normalized'. Your function either attempted a division by zero, used
a function outside its domain or called an internal function with invalid
parameters.
I don't know what happens...
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"And" <49341109@ntnu.edu.tw> wrote:
> This is another function and picture:
> #declare CSG_OVERLAP=0.000001;
> #declare f_quartic=function(var1,var2){
> pow(var1,4)+2*var1*var1*var2*var2+var1*var1-1
> }
>
> #declare f_quartic_normalized=function(var1,var2){
> f_quartic(var1,var2)
>
/sqrt(16*pow(var1,6)+(48*var2*var2+16)*pow(var1,4)+(16*pow(var2,4)+16*var2*var2+4)*var1*var1)
> }
>
> difference{
> isosurface{
> function{f_quartic(y,x)}
> max_gradient 10
> contained_by{box{<-3,0,-1><3,1.3,3>}}
> all_intersections
> }
> isosurface{
> function{f_quartic_normalized(y,x)+0.04}
> max_gradient 10
> contained_by{box{<-3,0-CSG_OVERLAP,-1-CSG_OVERLAP><3,1.3,3+CSG_OVERLAP>}}
> all_intersections
> }
> }
Ooops! I don't know why but with pov 3.7 it works! Not with 3.6!
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Fractracer" <lg.### [at] gmailcom> wrote:
>
> I've tried to use yours functions but I have an error message:
> Parse Error: Floating-point exception detected in function
> 'f_quartic_normalized'. Your function either attempted a division by zero, used
> a function outside its domain or called an internal function with invalid
> parameters.
> I don't know what happens...
Hum...
I just tried and this have parse error in pov-ray 3.6 truly.
Or you can use below function instead:
#declare f_quartic_normalized=function(var1,var2){
select(
abs(var1)-0.01,
-1,
f_quartic(var1,var2)
/sqrt(16*pow(var1,6)+(48*var2*var2+16)*pow(var1,4)+(16*pow(var2,4)+16*var2*var2+4)*var1*var1)
)
}
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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'
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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'
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Nice!
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|