|
 |
"Bald Eagle" <cre### [at] netscape net> wrote:
> MichaelJF <fri### [at] t-online de> wrote:
>
> Well, the red and orange are looking good!
>
> I'm not sure what's happening with MW's method, but I was just making a quick
> suggestion.
>
> The surface obviously extends infinitely in the +/-y directions, and so the
> select is just there to trim the function.
> I believe we can exclude that and just rely on the contained_by box.
>
> IsoExterior (10*x/15),y,z) just scales the function in the x direction.
> I'd take that out and use scale to take care of that part.
>
> I'm just guessing here, but what if you then try something like:
> IsoExterior (abs (x) - 0.01, abs (y) - 0.01, abs (z) - 0.01)
>
> maybe also experiment with subtracting from f_r (x, y, z)
> (include functions.inc)
>
> try changing the threshold from 0 to 0.01
>
> There's a lot of tricky things that have to be done to get certain functions to
> work well with isosurfaces in POV-Ray vs other software packages
>
> Maybe take a look further upstream at the preceding functions in the daisy chain
> to see if a better gradient can be fashioned.
>
> Define a set of y axes across the xz plane in the AABB, and graph the function
> along those y-axes and see what pops out.
>
> - BW
>
>
Hi,
I tried some of the solutions proposed here and yes, the orange object is the
best approximation.
When you mentioned to use the function f_r (x, y, z) - although I do not have a
clue what it does (there is no comment in functions.inc) I remembered that TOK
used it in his source code for prettyball_1_at_klp_tok.pov.txt.
I tested it with Abderrahman Taha's Clebsch_2 and it worked amazingly well.
So, I adapted the code for Devil Plate, too which now looks as follows.
=================================================================
// Iso_Devil_Plate_test8.pov
#version 3.7;
global_settings { assumed_gamma 2.2 }
#include "colors.inc"
#include "textures.inc"
#include "metals.inc"
#include "functions.inc"
#declare H = 1e-4;
#declare Th = 1/10;
#declare Xmin = -45/10;
#declare Xmax = 45/10;
#declare Ymin = -24/10;
#declare Ymax = 44/10;
#declare Zmin = -75/10;
#declare Zmax = 75/10;
// Devil=x^4+2*x^2*z^2-(36/100)*x^2-y^4+(25/100)*y^2+z^4
#declare DevilFn = function {
pow(x,4)+2*pow(x,2)*pow(z,2)-(36/100)*pow(x,2)-pow(y,4)+(25/100)*pow(y,2)+pow(z,4)
}
// Devil2=Devil(x,sqrt(y*y+z*z)-(15/10),z,t)
#declare DevilFn2 = function(x,y,z) {
DevilFn (
x,
sqrt(y*y+z*z)-(15/10),
z
)
}
// IsoExterior=Devil2(x,y,sqrt(x*x+z*z)-(15/10),t)
#declare IsoExt = function(x,y,z) {
DevilFn2 (
x,
y,
sqrt(x*x+z*z)-(15/10)
)
}
// DFx=((IsoExterior(x+c,y,z,t)-IsoExterior(x,y,z,t))/c)
#declare DFX = function { (IsoExt(x+H,y,z)-IsoExt(x,y,z))/H }
// DFy=((IsoExterior(x,y+c,z,t)-IsoExterior(x,y,z,t))/c)
#declare DFY = function { (IsoExt(x,y+H,z)-IsoExt(x,y,z))/H }
// DFz=((IsoExterior(x,y,z+c,t)-IsoExterior(x,y,z,t))/c)
#declare DFZ = function { (IsoExt(x,y,z+H)-IsoExt(x,y,z))/H }
// Adaptation according to TOK's code follows
#declare Fn =
function(x, y, z, dx, dy, dz, s) {
IsoExt(
x + dx*s,
y + dy*s,
z + dz*s
)
}
// F(x,y,z,t) = if(y<(44/10)&y>-(24/10),ThickIsoExterior((10*x/15),y,z,t),1);
select() removed
#declare DP_Fn = function(x,y,z,dx,dy,dz) {
Fn(x, y, z, dx, dy, dz, +Th/f_r(dx, dy, dz))
*
Fn(x, y, z, dx, dy, dz, -Th/f_r(dx, dy, dz))
// instead of: IsoPlus(x,y,z)*IsoMinus(x,y,z),
}
//ISO Devil_Plate =
isosurface {
function {DP_Fn(
10*x/15,y,z, // scaling x
DFX(x, y, z),
DFY(x, y, z),
DFZ(x, y, z)
)
}
contained_by{box{<Xmin,Ymin,Zmin>, <Xmax, Ymax, Zmax>}}
threshold 0.0 // Trace Time 0 h 26 min
accuracy 0.01
max_gradient 2216254
open
pigment {Yellow}
rotate 90*y
}
#declare Win = image_width/image_height;
background { color <1.0,1.0,1.0> }
camera {
location <0, 15, -25>
up y
right Win*x
look_at <0.0, 0.0, 0.0>
angle 54
}
light_source {
<-17, 25, -35>
color rgb <1, 1, 1>
}
=====================================================================
It's probably as close to the original as it can get.
Thanks to all of you for the input.
Droj
Post a reply to this message
Attachments:
Download 'iso_devil_plate_test8.png' (77 KB)
Preview of image 'iso_devil_plate_test8.png'

|
 |