POV-Ray : Newsgroups : povray.advanced-users : Problem wih POV-Syntax Server Time
29 Jul 2024 18:19:01 EDT (-0400)
  Problem wih POV-Syntax (Message 1 to 3 of 3)  
From: Thies Heidecke
Subject: Problem wih POV-Syntax
Date: 8 Oct 2001 07:56:16
Message: <3bc19460$1@news.povray.org>
Hi NG,

i am working on a macro for creating Blobcomponents. I've already
successfully implemented this with a blob-object. But now i want to use an
isosurface, because of the freedom of adding additional functions. when i
try my new macro i get a parser-error stating a vectoridentifier where an
operand should be, but i used the .x (.y / .z) operator to extract a
float-value but povray doesn't seem to care... has anyone tips what i made
wrong? Thanks in advance
    Thies Heidecke

the macro :
#macro Icosaeder(C,S,CR,R,L)   // Recursive Macro
    #if(L=0)
        S*(1 - ( ( (x-C.x)^2 + (y-C.y)^2 + (z-C.z)^2 ) / (CR*R)^2 )^2 +   //
<---here's the error
    #else
        #local New_L = L-1;
        #local New_R = R*nsr;

        Icosaeder(C+ P1*R*ir,S,CR,New_R,New_L)
        Icosaeder(C+ P2*R*ir,S,CR,New_R,New_L)
        Icosaeder(C+ P3*R*ir,S,CR,New_R,New_L)
        Icosaeder(C+ P4*R*ir,S,CR,New_R,New_L)
        Icosaeder(C+ P5*R*ir,S,CR,New_R,New_L)
        Icosaeder(C+ P6*R*ir,S,CR,New_R,New_L)
        Icosaeder(C+ P7*R*ir,S,CR,New_R,New_L)
        Icosaeder(C+ P8*R*ir,S,CR,New_R,New_L)
        Icosaeder(C+ P9*R*ir,S,CR,New_R,New_L)
        Icosaeder(C+P10*R*ir,S,CR,New_R,New_L)
        Icosaeder(C+P11*R*ir,S,CR,New_R,New_L)
        Icosaeder(C+P12*R*ir,S,CR,New_R,New_L)
    #end
#end


Post a reply to this message

From: Christoph Hormann
Subject: Re: Problem wih POV-Syntax
Date: 8 Oct 2001 08:34:28
Message: <3BC19E3F.C374CD59@gmx.de>
Thies Heidecke wrote:
> 
> Hi NG,
> 
> i am working on a macro for creating Blobcomponents. I've already
> successfully implemented this with a blob-object. But now i want to use an
> isosurface, because of the freedom of adding additional functions. when i
> try my new macro i get a parser-error stating a vectoridentifier where an
> operand should be, but i used the .x (.y / .z) operator to extract a
> float-value but povray doesn't seem to care... has anyone tips what i made
> wrong? Thanks in advance

Try declaring locals like:

  #local Cx = C.x;

at the beginning of the macro.

Christoph

-- 
Christoph Hormann <chr### [at] gmxde>
IsoWood include, radiosity tutorial, TransSkin and other 
things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Mike Williams
Subject: Re: Problem wih POV-Syntax
Date: 8 Oct 2001 21:56:44
Message: <i8bDCHArvew7EwTi@econym.demon.co.uk>
Wasn't it Christoph Hormann who wrote:
>
>
>Thies Heidecke wrote:
>> 
>> Hi NG,
>> 
>> i am working on a macro for creating Blobcomponents. I've already
>> successfully implemented this with a blob-object. But now i want to use an
>> isosurface, because of the freedom of adding additional functions. when i
>> try my new macro i get a parser-error stating a vectoridentifier where an
>> operand should be, but i used the .x (.y / .z) operator to extract a
>> float-value but povray doesn't seem to care... has anyone tips what i made
>> wrong? Thanks in advance
>
>Try declaring locals like:
>
>  #local Cx = C.x;
>
>at the beginning of the macro.

Also, note that the line

        S*(1 - ( ( (x-Cx)^2 + (y-Cy)^2 + (z-Cz)^2 ) / (CR*R)^2 )^2 +  //

has seven "("s and only six ")"s. You either need to slip in a seventh
")" on that line somewhere or write a heck of a lot of them when you
return from your macro.

And remember that the expression returned by the macro has a spurious
"+" on the end, so you're going to have to call it something like

isosurface {
   function{
      Icosaeder(...)
      0
   }
   ...

Where the extra "0" is simply there to prevent the trailing "+" being
syntactically incorrect.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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