 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Hi,
Again I found an other interesting isosurface in Abderrahman Taha's MathMod
which he called Devil Plate (see his functions at the beginning of the attached
pov-file).
But this time I am stuck.
I am posting the pov-file which renders OK although it takes a 'couple
of minutes'. The result is close to the original but
what I could not find out is how to apply thickness
ThickIsoExterior=(Iso(x,y,z,1)*Iso(x,y,z,-1))
and how to apply this condition
F(x,y,z,t) = if(y<(44/10)&y>-(24/10),ThickIsoExterior((10*x/15),y,z,t),1)
Can someone help?
Regards
Droj
Post a reply to this message
Attachments:
Download 'iso_devil_plate.pov.txt' (3 KB)
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Droj" <803### [at] droj de> wrote:
> what I could not find out is how to apply thickness
>
> ThickIsoExterior=(Iso(x,y,z,1)*Iso(x,y,z,-1))
That's just a function - like any other.
You might have discontinuities, which would drive the gradient through the roof.
> and how to apply this condition
>
> F(x,y,z,t) = if(y<(44/10)&y>-(24/10),ThickIsoExterior((10*x/15),y,z,t),1)
There are likely several ways to go about this.
Enclosing the inequalities in parentheses evaluates them as a Boolean.
If you multiply them, if either one is false, then the product is zero.
If they are both true, then you get 1 * 1 = 1;
so you could try:
F(x,y,z,t) =
select ( (y<(44/10)) * (y>-(24/10)),
0, 1, ThickIsoExterior((10*x/15),y,z,t)
)
A zero gets added in to use the "4-parameter version" of select, and then since
false = 0, the 1 is the next parameter, and true = 1, so ThickIsoExterior is the
last parameter.
Hope that makes sense.
- BW
select(A, B, C [,D])
It can be used with three or four parameters Select compares the first argument
with zero, depending on the outcome it will return B, C or D. A,B,C,D can be
floats or funtions.
When used with three parameters, if A < 0 it will return B, else C (A >= 0).
When used with four parameters, if A < 0 it will return B. If A = 0 it will
return C. Else it will return D (A > 0).
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Bald Eagle" <cre### [at] netscape net> wrote:
> >
> > F(x,y,z,t) = if(y<(44/10)&y>-(24/10),ThickIsoExterior((10*x/15),y,z,t),1)
>
> There are likely several ways to go about this.
> Enclosing the inequalities in parentheses evaluates them as a Boolean.
> If you multiply them, if either one is false, then the product is zero.
> If they are both true, then you get 1 * 1 = 1;
> so you could try:
>
> F(x,y,z,t) =
> select ( (y<(44/10)) * (y>-(24/10)),
> 0, 1, ThickIsoExterior((10*x/15),y,z,t)
> )
>
> A zero gets added in to use the "4-parameter version" of select, and then since
> false = 0, the 1 is the next parameter, and true = 1, so ThickIsoExterior is the
> last parameter.
>
> Hope that makes sense.
>
> - BW
>
> select(A, B, C [,D])
> It can be used with three or four parameters Select compares the first argument
> with zero, depending on the outcome it will return B, C or D. A,B,C,D can be
> floats or funtions.
>
> When used with three parameters, if A < 0 it will return B, else C (A >= 0).
>
> When used with four parameters, if A < 0 it will return B. If A = 0 it will
> return C. Else it will return D (A > 0).
Thanks, B.E.
Now it's clearer what select() is good for.
I have to chew on that for a while.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Bald Eagle" <cre### [at] netscape net> wrote:
>
> F(x,y,z,t) =
> select ( (y<(44/10)) * (y>-(24/10)),
> 0, 1, ThickIsoExterior((10*x/15),y,z,t)
> )
>
> Hope that makes sense.
Hi BE,
I followed your advice with respect to select() and added the appropriate code
using the boolean & instead of multiply.
And it works - well, not the way it should.
I believe there is something wrong in my Povray code which is hard for me to
find out.
I added AT's equations as comment above the Povray code.
Meanwhile I read the threads initiated by klp in Povray's advanced users
<6752dcbc@news.povray.org>
in Dec 2024 about the topic but I could not find the solution there.
The interesting thing about my misinterpretation of AT's equations is:
(1) setting threshold 1 and accuracy 0.01 (max_gradient 2352446)
==> Povray renders something solid (not the object I was expecting)
==> Trace Time: 1h 38 min using 16 threads
(2) setting threshold 0 and accuracy 0.01 (max_gradient 2352446)
==> Povray renders something invisible
==> Trace Time: about the same as above
(3) setting threshold 0.01 and accuracy 0.1 (max_gradient 2352446)
==> Povray renders an object that looks like being peeled
==> Trace Time: 0h 39 min using 16 threads
And no, Povray doesn't complain about gaps in the object!
I will post an image of (1) and (3) in p.b.i
Thanks for your patience
Droj
Post a reply to this message
Attachments:
Download 'iso_devil_plate_test.pov.txt' (4 KB)
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
I don't know what your ultimate goal is, but when I just evaluated the
isosurface for
function {DevilFn2(x,y,z)
I get the following render (Cam and lights adjusted, white sky_sphere)
- BW
Post a reply to this message
Attachments:
Download 'iso_devil_plate_test.png' (39 KB)
Preview of image 'iso_devil_plate_test.png'

|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Bald Eagle" <cre### [at] netscape net> wrote:
> I don't know what your ultimate goal is, but when I just evaluated the
> isosurface for
>
> function {DevilFn2(x,y,z)
>
> I get the following render (Cam and lights adjusted, white sky_sphere)
>
> - BW
When you render the function #declare Iso = function(x,y,z) {
you get the image attached.
The next 2 functions should add thickness to the shape (you see the rim of the
'plate' is thin like an eggshell).
And this is where the flaw is.
Droj
Post a reply to this message
Attachments:
Download 'iso_devil_plate.png' (77 KB)
Preview of image 'iso_devil_plate.png'

|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Try Mike Williams' isosurface thickening trick:
Thickening
If we have a function F(x,y,z) we can turn it into two parallel surfaces by
using abs(F(x,y,z))-C where C is some
small value. The original function should be one that works with zero threshold.
The two resulting surfaces are
what you would get by rendering the original function with threshold +C and -C,
but combined into a single
image. The space between the two surfaces becomes the "inside" of the object. In
this way we can construct
things like glasses and cups that have walls of non-zero thickness.
#declare F = function {y + f_noise3d (x*2, 0, z*2)}
isosurface {
function {abs (F(x, y, z))-0.1}
....
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Am 28.04.2025 um 20:26 schrieb Bald Eagle:
> Try Mike Williams' isosurface thickening trick:
>
> Thickening
> If we have a function F(x,y,z) we can turn it into two parallel surfaces by
> using abs(F(x,y,z))-C where C is some
> small value. The original function should be one that works with zero threshold.
> The two resulting surfaces are
> what you would get by rendering the original function with threshold +C and -C,
> but combined into a single
> image. The space between the two surfaces becomes the "inside" of the object. In
> this way we can construct
> things like glasses and cups that have walls of non-zero thickness.
> #declare F = function {y + f_noise3d (x*2, 0, z*2)}
> isosurface {
> function {abs (F(x, y, z))-0.1}
> ....
>
>
Obviously this should work. But I run into a problem with this approach.
The yellow object depictes the devils plate function without any thickening:
#declare c=1/10000;
#declare Th=1/10;
#declare Devil = function(x,y,z) {
x*x*x*x+2*x*x*z*z-36/100*x*x-y*y*y*y+25/100*y*y+z*z*z*z }
#declare Devil2 = function(x,y,z) { Devil(x,sqrt(y*y+z*z)-15/10,z) }
#declare IsoExterior = function (x,y,z) { Devil2(x,y,sqrt(x*x+z*z)-15/10) }
isosurface { function { IsoExterior(x,y,z) }
contained_by { box { <-45/10,-25/10,-75/10>,<45/10,45/10,75/10> } }
threshold 0.0
open
max_gradient 2500
pigment { colour Yellow }
}
The red object shows the approach by Abderrahman Taha (MathMod). He
calculates the numerical derivatives to approximate the normals. Then
the shape is shifted a small amount along and against these normals.
Finally, both functions are multiplied to form the sets of points at
which at least one of the functions returns the value zero - the
threshold that is then used in the isosurface:
// numerical derivatives
#declare DFx = function(x,y,z) {
(IsoExterior(x+c,y,z)-IsoExterior(x,y,z))/c }
#declare DFy = function(x,y,z) {
(IsoExterior(x,y+c,z)-IsoExterior(x,y,z))/c }
#declare DFz = function(x,y,z) {
(IsoExterior(x,y,z+c)-IsoExterior(x,y,z))/c }
// normalisation
#declare R = function (x,y,z) { x/sqrt(x*x+y*y+z*z) }
#declare IsoPlus = function (x,y,z) {
IsoExterior( x+Th*R(DFx(x,y,z),DFy(x,y,z),DFz(x,y,z)),
y+Th*R(DFy(x,y,z),DFz(x,y,z),DFx(x,y,z)),
z+Th*R(DFz(x,y,z),DFx(x,y,z),DFy(x,y,z)))
}
#declare IsoMinus = function (x,y,z) {
IsoExterior( x-Th*R(DFx(x,y,z),DFy(x,y,z),DFz(x,y,z)),
y-Th*R(DFy(x,y,z),DFz(x,y,z),DFx(x,y,z)),
z-Th*R(DFz(x,y,z),DFx(x,y,z),DFy(x,y,z)))
}
#declare ThickIsoExterior = function (x,y,z) {
IsoPlus(x,y,z)*IsoMinus(x,y,z) }
#declare DevilsPlate = function (x,y,z) {
select ( -(-24/10-y)*(y-44/10),ThickIsoExterior((10*x/15),y,z), 1)
}
isosurface {
function {
DevilsPlate(x,y,z)
}
contained_by { box { <-45/10,-25/10,-75/10>,<45/10,45/10,75/10> } }
threshold 0.0
open
max_gradient 20000000
pigment { colour Red }
}
The orange object ist nearly the same as the red one but without the
select statement, moving the range condition for y into the bounding box.
This all works very fine, but Mike Williams' approach (dark purple)
looks a little strange:
#declare DevilsPlateD = function (x,y,z) {
select (
-(-24/10-y)*(y-44/10),(abs(IsoExterior((10*x/15),y,z))-0.01) ,1)
}
isosurface {
function {
DevilsPlateD(x,y,z)
}
contained_by { box { <-45/10,-25/10,-75/10>,<45/10,45/10,75/10> } }
threshold 0.0
// open
max_gradient 1000000
pigment { colour DarkPurple }
}
All values for max_gradient are adjusted according to the log.
max_trace_level was at maximum (256).
I have no idea what happens here.
Best regards
Michael
Post a reply to this message
Attachments:
Download 'devilsplate02.png' (173 KB)
Preview of image 'devilsplate02.png'

|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
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
> This all works very fine, but Mike Williams' approach (dark purple)
> looks a little strange:
>
> #declare DevilsPlateD = function (x,y,z) {
> select (
> -(-24/10-y)*(y-44/10),(abs(IsoExterior((10*x/15),y,z))-0.01) ,1)
> }
> isosurface {
> function {
> DevilsPlateD(x,y,z)
> }
> contained_by { box { <-45/10,-25/10,-75/10>,<45/10,45/10,75/10> } }
> threshold 0.0
> // open
> max_gradient 1000000
> pigment { colour DarkPurple }
> }
>
> All values for max_gradient are adjusted according to the log.
> max_trace_level was at maximum (256).
>
> I have no idea what happens here.
>
> Best regards
> Michael
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|
 |