POV-Ray : Newsgroups : povray.bugreports : "mandel" as function in isosurface has unexpected results : Re: "mandel" as function in isosurface has unexpected results Server Time
19 Apr 2024 23:18:46 EDT (-0400)
  Re: "mandel" as function in isosurface has unexpected results  
From: Tor Olav Kristensen
Date: 20 Dec 2022 09:35:00
Message: <web.63a1c7d9c22c158f80a206e289db30a9@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> Lars Rohwedder <rok### [at] gmxde> wrote:
>...

> > So I had expected that a formula like 0.9 - mandel would give the
>
> > What went wrong here?
>
> Part of what's going wrong is that mandel is a POV-Ray pattern that has a built
> in color map.   And that wreaks hell with everything right from the beginning.
>
> I'd say try using:
>
> #declare Mandel = function { pigment {mandel 1000 exterior 1, 1 color_map {[0
> rgb 0] [1 rgb 1]}}}
>...

Hi Bill and Lars

AFAIK, patterns can not have built in color maps, while pigments can.
So here I would rater suggest a pattern function instead of a pigment function:

#declare MandelbrotFn =
    function {
        pattern {
            mandel 1000
            exterior 1, 1
        }
    }
;

Pattern functions do not return colors as pigment functions do, but float values
between 0 and 1.

Patterns and pattern functions (and other functions returning floats) can be
used to select colors from color maps in pigments, e.g. like this:

    plane {
        +z, 0
        pigment {
            mandel 1000
            color_map {
                [ 0.0 color rgb <0, 0, 0> ]
                [ 0.2 color rgb <1, 0, 0> ]
                [ 0.4 color rgb <1, 1, 0> ]
                [ 1.0 color rgb <1, 1, 1> ]
                [ 1.0 color rgb <0, 0, 0> ]
            }
        }
    }

- or like this:

    #declare MandelFn = function { pattern { mandel 1000 } };

    plane {
        +z, 0
        pigment {
            function { MandelFn(x, y, z) }
            color_map {
                [ 0.0 color rgb <0, 0, 0> ]
                [ 0.2 color rgb <1, 0, 0> ]
                [ 0.4 color rgb <1, 1, 0> ]
                [ 1.0 color rgb <1, 1, 1> ]
                [ 1.0 color rgb <0, 0, 0> ]
            }
        }
    }

--
Tor Olav
http://subcube.com
https://github.com/t-o-k


Post a reply to this message

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