POV-Ray : Newsgroups : povray.newusers : Parametric Object Server Time 5 Aug 2024 20:49:28 EDT (-0400)
 Parametric Object (Message 1 to 3 of 3)
 From: kurtz le pirate Subject: Parametric Object Date: 6 Apr 2023 10:15:15 Message: <642ed3f3\$1@news.povray.org>
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#642ed3f3%241%40news.povray.org",
"dateCreated": "2023-04-06T14:15:15+00:00",
"datePublished": "2023-04-06T14:15:15+00:00",
"author": {
"@type": "Person",
"name": "kurtz le pirate"
}
}
Hello,

Documentation POVRay 2.4.5 :

parametric {
function { FUNCTION_ITEMS },
function { FUNCTION_ITEMS },
function { FUNCTION_ITEMS }
<u1,v1>, <u2,v2>
...
}

I run into the following problem : how to introduce in the three
functions f(x), g(y) and h(z), a parameter that also depends
on u and v ?

For exemple :
parametric {
function { sin(u)*cos(v)*K }
function { sin(u)*sin(v)*K }
function { cos(u)/K }
...
}
with K = k*sin(2*u)*sin(nv)
'k' and 'n' are constants.

I have to add the complete calculation of the parameter 'K' in the three
functions ?

--
Kurtz le pirate
Compagnie de la Banquise
```
 From: kurtz le pirate Subject: Re: Parametric Object Date: 6 Apr 2023 10:51:35 Message: <642edc77\$1@news.povray.org>
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#642edc77%241%40news.povray.org",
"dateCreated": "2023-04-06T14:51:35+00:00",
"datePublished": "2023-04-06T14:51:35+00:00",
"author": {
"@type": "Person",
"name": "kurtz le pirate"
}
}
On 06/04/2023 16:15, kurtz le pirate wrote:
>
> I have to add the complete calculation of the parameter 'K' in the three
> functions ?
>

Find the solution.

#declare fnK = function(u,v) { ... }
parametric {
function { fnK(u,v)*(...) }
function { fnK(u,v)*(...) }
function { fnK(u,v)*(...) }

Must also specify the parameters for fnK().

--
Kurtz le pirate
Compagnie de la Banquise
```
 From: Bald Eagle Subject: Re: Parametric Object Date: 6 Apr 2023 13:55:00 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.642f06b8535bc3e01f9dae3025979125%40news.povray.org",
"dateCreated": "2023-04-06T17:55:00+00:00",
"datePublished": "2023-04-06T17:55:00+00:00",
"author": {
"@type": "Person",
"name": "Bald Eagle"
}
}
kurtz le pirate <kur### [at] gmailcom> wrote:

> Find the solution.
>
> #declare fnK = function(u,v) { ... }
> parametric {
>  function { fnK(u,v)*(...) }
>  function { fnK(u,v)*(...) }
>  function { fnK(u,v)*(...) }
>
> Must also specify the parameters for fnK().

Yes.   This is what I often refer to as "daisy-chaining".

https://www.props4shows.co.uk/Portals/1/product/images/prd35729f1d-79d7-4e7b-9f10-8aa76ed62377.jpg

One function depends on the result of another function, which may depend on yet
another function....
```