POV-Ray : Newsgroups : povray.advanced-users : isosurface: Does the order of multiple functions matter? : Re: isosurface: Does the order of multiple functions matter? Server Time
18 May 2024 20:29:38 EDT (-0400)
  Re: isosurface: Does the order of multiple functions matter?  
From: Kenneth
Date: 29 Jan 2023 13:00:00
Message: <web.63d6b2b79b90547b9b4924336e066e29@news.povray.org>
"Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:
> "Kenneth" <kdw### [at] gmailcom> wrote:
> >
> > In my current real scene...here is a somewhat simplified version of a
> > problem I had:
> >...
> > #declare OBJ_PATTERN_FUNC = function{pigment{object{MY_OBJECT rgb 0 rgb 1}}}

>
> I recommend that you use pattern functions here instead of pigment
> functions...
>
> You can then write your declared functions like this:
>
> #declare OBJECT_FUNC =
>     function {
>         pattern {
>             object { MY_OBJECT }
>         }
>     }

You are correct...as I have just discovered(!)-- not because I didn't try using
'pattern' there (which I did) but because it outright failed for me. The syntax
was not accepted. HOWEVER, this is because I actually did not write my real
scene's object pattern/function code like the one-line example I gave, but
instead split-up the code into two parts, for no real reason:

#declare OBJ_PATTERN = pigment{object{MY_OBJECT rgb 0 rgb 1}}

#declare OBJ_PATTERN_FUNC = function{pigment{OBJ_PATTERN}}

When OBJ_PATTERN is written this way--initially without a function wrapper--
POV-ray does not accept 'pattern' as a valid parameter, only 'pigment' and
'density'. So, I thought that this was the only way to write it. If I had
thought to combine the two operations into one, 'pattern' would have been
accepted! This is one of several undocumented syntax-rule quirks of the 'object
pattern'; there are others too, as I keep discovering. The docs say that it is a
color-list pattern, so I guess it has special rules and limitations like similar
patterns.


Post a reply to this message

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