POV-Ray : Newsgroups : povray.programming : Which code evaluate Math functions (ie: isosurfaces) ? : Re: Which code evaluate Math functions (ie: isosurfaces) ? Server Time
6 May 2024 04:54:04 EDT (-0400)
  Re: Which code evaluate Math functions (ie: isosurfaces) ?  
From: virtualmeet
Date: 30 Jan 2007 19:00:00
Message: <web.45bfda65f1edfe3e1ef05ef80@news.povray.org>
Thorsten Froehlich <tho### [at] trfde> wrote:

> You do realize that such a grid would also require eight gigabyte (!!!) of
> memory? Using the fastest personal computer memory available, using a 128
> bit wide bus, you still need more than a second to even fill that grid with
> any single identical value.
Hello,
I'm aware of that since my "workstation" is only a P3 550MH/256M :). This
parser is useful also for smaller grid and "big" isosurfaces fcts: I'm
usually using grids of 120x120x120 and some isosurfaces can take from 1 to
60 minutes to compute. Isosurfaces aren't usually as simples as Schwartz
example and can take hours to compute even for smaller grids.
Perhaps I didn't  explain the kind of simplification we can do :
An isosurface formulas with handreds of "cos(x)", "cos(y)" and "cos(z)"
terms inside it will also require as much cosinus fct calculations as
Schwartz!
A normal parser can make (very difficult to generalise but possible) some
simplifications like : cos(x) + cos(x)*y*log(abs(cos(x)) +1)) =
cos(x)*(1+y*log(abs(cos(x)) +1)). However, it still need to compute two
cosinus for every point of the grid (for a grid of 100x100x100, the number
of cosinus is 2x10^6).
Now for the geometrical parser:
1) we dont have to apply any factorisation.
2) The number of required cosinus calculation is 100 for the grid
100x100x100.
3) you can add as much as you want termes of "cos(x)" inside the isosurface
formula, the required number of cosinus calculations is always 100...
In fact, "cos(x)" termes are treated like constantes and this is possible
only because we use a geometrical parser (the parser is able to retreave
the value of "cos(x)" as easy as retreaving the value of the terme "x"
itself).
This example : cos(x)*(1+y*log(abs(cos(x)) +1))+ log(x*cos(x))+
pow(tan(abs(cos(x)+1))) + log(y*cos(x)*cos(x)) require also 100 cosinus
calculations without any hard work of factorisation.
3) This works for all unary fcts defined inside the parser (log, exp, ...)

I'm working on expanding this to binary defined fcts like "+" and "*" : this
is a little bit triky but there is a way to make termes like "cos(x*y)"
requiring as little as 10^4 cosinus calculations for the grid 100x100x100,
and this for any number of termes "cos(x*y)" inside the Isosurface formula.
Also, this way of factorisation has nothing to do with the inclusion of
mutiple instructions inside the evaluator fct of the parser, it's just
another way of sampling the calculations by using the cube symetrys.

> Your enthusiasm is certainly commendable, but unfortunately also
> misdirected.
We will try to find more convincing results :)
Cheers,
Taha


Post a reply to this message

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