POV-Ray : Newsgroups : povray.binaries.images : Vase - Isosurface - MathMod Server Time
21 Dec 2024 11:55:44 EST (-0500)
  Vase - Isosurface - MathMod (Message 1 to 6 of 6)  
From: kurtz le pirate
Subject: Vase - Isosurface - MathMod
Date: 9 Dec 2024 10:55:03
Message: <675712d7@news.povray.org>
Here, the result of the transcoding from MathMod to POVRay.
(see discussion in p.a-u).




-- 
kurtz le pirate
compagnie de la banquise


Post a reply to this message


Attachments:
Download 'vase_iso.jpg' (219 KB)

Preview of image 'vase_iso.jpg'
vase_iso.jpg


 

From: Bald Eagle
Subject: Re: Vase - Isosurface - MathMod
Date: 9 Dec 2024 11:50:00
Message: <web.67571eb41965dde4a2cb7a7025979125@news.povray.org>
kurtz le pirate <kur### [at] freefr> wrote:
> Here, the result of the transcoding from MathMod to POVRay.
> (see discussion in p.a-u).

That came out great - and the stone texture is beautiful  :)

(At some point, if you aren't using your computer for anything for a while, an
HDR environment and SSLT in the stone texture would probably be fantastic.)

I think that I'd like to see the functions you used.

Normally when I translate between other forms and SDL, I write my SDL on the
top, and leave the original code as a long comment on the bottom.  Sometimes
I'll even just interleave the SDL with the original commented-out code so that I
can see what I'm doing line-pair by line-pair.

Great work, and I'm glad it all got straightened out.  :)
Thanks Tor, as always!

- BW


Post a reply to this message

From: kurtz le pirate
Subject: Re: Vase - Isosurface - MathMod
Date: 10 Dec 2024 05:32:45
Message: <675818cd$1@news.povray.org>
On 09/12/2024 17:45, Bald Eagle wrote:

> 
> That came out great - and the stone texture is beautiful  :)

It's just the 'T_Stone20'


> (At some point, if you aren't using your computer for anything for a while, an
> HDR environment and SSLT in the stone texture would probably be fantastic.)

hum... SSLT is beyond my knowledge. I've never played with this option.



> I think that I'd like to see the functions you used.

Text file attached here. Only the interesting part with functions.
No prettyprint, sorry.



> Great work, and I'm glad it all got straightened out.  :)
> Thanks Tor, as always!

Yes, Tor always adds his little grain of salt which helps a lot.





-- 
kurtz le pirate
compagnie de la banquise


Post a reply to this message


Attachments:
Download 'mathmod_vase.txt' (5 KB)

From: William F Pokorny
Subject: Re: Vase - Isosurface - MathMod
Date: 11 Dec 2024 00:14:19
Message: <67591fab$1@news.povray.org>
On 12/9/24 10:55, kurtz le pirate wrote:
> 
> Here, the result of the transcoding from MathMod to POVRay.
> (see discussion in p.a-u).
> 

Cool! :-)

Bill P.


Post a reply to this message

From: Kenneth
Subject: Re: Vase - Isosurface - MathMod
Date: 20 Dec 2024 13:20:00
Message: <web.6765b5241965dde4e83955656e066e29@news.povray.org>
Wow, that is a beauty. And a really interesting use of isosurface functions.

I tried to follow your recent post about the function re-writing from MathMod,
but got hopelessly lost :-(  Very sophisticated! I need to re-read it...over and
over again, until it sinks into my poor brain...


Post a reply to this message

From: kurtz le pirate
Subject: Re: Vase - Isosurface - MathMod
Date: 21 Dec 2024 05:43:07
Message: <67669bbb$1@news.povray.org>
On 20/12/2024 19:19, Kenneth wrote:
> Wow, that is a beauty. And a really interesting use of isosurface functions.
> 
> I tried to follow your recent post about the function re-writing from MathMod,
> but got hopelessly lost :-(  Very sophisticated! I need to re-read it...over and
> over again, until it sinks into my poor brain...
> 


But no, it's not that difficult.
You just need to know a few tricks and have lot of patience...


* Replace the rise to power '^' by pow(a,b) or write explicitly a*a*a...
* A function is defined by its name and parameters.
   The current parameters (x,y,z) may not be written.
   #declare foo = function {...} is the same thing that
   #declare foo = function(x,y,z) {...}	
* Check the number of parameters required by the function.
   N required -> N passed and N passed ->  N required.
* Mathmod often uses the 't' parameter. In the vast majority of cases,
   this parameter can be omitted. 't' is used for animation and/or
   morphing.
* Matmod lets you use 'if' in functions. POVRay doesn't.
   You have to replace it with a 'select()'. See TOK's more detailed
   explanations.
* Remember also that POV compares to zero in the 'select()'.
   In Matmod this is not always the case.
* In Matmod, declaration is sequential and a function can be redefined.
   In fact, the same 'function name' can be used several times.
   In POV, this is forbidden (and so much the better!).
* Don't forget the constants and the domains





Sample :

"Animated Bone Cage model by Abderrahman Taha 12/11/2020"

"P_Skeletal0=-y-z+(51/100)*(-x*y+y*z+z*x)+12/10"

-> Add '#declare' at the beginning, remove the quotation marks, add
    'function {' after the equal sign and at the end of the line.
    #declare P_Skeletal0 = function{ -y-z+(51/100)*(-x*y+y*z+z*x)+12/10 }


Then
"isoTransform=if((x-pi)*(x-pi)<(13),P_Skeletal(x,y-4*t,z-20*t,t),(1))+exp((x-pi)*(x-pi)-9)"


Which can be rewritten as :
"isoTransform = if (
   (x-pi)*(x-pi)<(13),
   P_Skeletal(x,y-4*t,z-20*t,t),
   (1)
   )
   +exp((x-pi)*(x-pi)-9)"

We replace the 'if()' with a 'select()', paying attention to the
condition, which in this case is not relative to (zero) but to (13).

Resulting in :
#declare isoTransform = function {
   select (
     (x-pi)*(x-pi)-13, // A : condition with respect to 0
     P_Skeletal(x,y,z) // If A < 0
     1                 // Else (A >=0) 	
     )
   +exp((x-pi)*(x-pi)-9)
   }

Note the deletion of the 't' parameter.




The hardest part is still adjusting the isosurface parameters: 
contained_by, threshold, accuracy, max_gradient, ...




All this also works for the parametric part and the
parametric { } POV's object.



Have fun !!


-- 
kurtz le pirate
compagnie de la banquise


Post a reply to this message

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