POV-Ray : Newsgroups : povray.general : Constructing isosurface functions : Re: Constructing isosurface functions Server Time
29 Jul 2024 12:28:51 EDT (-0400)
  Re: Constructing isosurface functions  
From: Alain
Date: 15 Jul 2011 10:55:08
Message: <4e2054cc@news.povray.org>
Le 2011/07/14 19:28, David Given a écrit :
> I wish to do some stupidly complicated things with isosurfaces. Does
> anyone have a set of rules (or even a library) for manipulating isosurfaces?
>
> The kind of thing I'm looking for is to be able to take a shape f(x, y,
> z) and then produce another function that, when rendered, produces many
> shapes distributed according to another function.
>
> I have found this very useful page:
>
> http://www.econym.demon.co.uk/isotut/combine.htm
>
> It looks like the standard way to union two shapes in an isosurface is
> to use min(), so min(f(x, y, z), f(x', y', z')). However, I need to
> union an arbitrary number of functions so can't do it by brute force,
> and min() is not very conducive to mathematical analysis...
>
> The exact use case is: I am trying to place a very large number of
> objects on a terrain. I can describe one object as an isosurface, but
> the number of objects is so high that I can't model them as CSG. So, I
> need to be able to create a single isosurface that will model all my
> objects in one go.
>
> Is this kind of thing feasible?
>

Strictly speaking, it's feasible. You only need to use tons of min(...). 
Keep in mind that there is a limit on how many function you can nest 
this way.

Practical, is another thing. It will be extremely slow as you need to 
evaluate each and every function for every test points, several per 
pixel within the container shape.
It also mean that your final "function" will be helplessly complicated.

If you have a very large number of similar objects, it's probably beter 
to make it as a mesh object and instanciate it as needed. Prety fast and 
light on memory requirement.

A single function can produce an extremely large number of individual 
shapes, but those shapes are rather simple. Also fast and light on 
memory. You can use another function to modify the distribution and shapes.

As you already have your basic isosurface, you can use it multiple times 
and rotate / scale / translate it as any other object.
Use a #while()...#end loop to iterate the process and the trace() 
function to place them on the surface of your terrain. A loop can be 
used to place 10000's of objects. If you have enough memory, on a 64 
bits system, it can shoot in the millions of objects.
The advantage is that each object will have it's own container and won't 
affect the evaluation of the others.



Alain


Post a reply to this message

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