POV-Ray : Newsgroups : povray.bugreports : tuple-style assignment fails after including transforms.inc Server Time
22 Nov 2024 09:10:22 EST (-0500)
  tuple-style assignment fails after including transforms.inc (Message 1 to 3 of 3)  
From: Bald Eagle
Subject: tuple-style assignment fails after including transforms.inc
Date: 26 Dec 2023 15:20:00
Message: <web.658b3545f063947a1f9dae3025979125@news.povray.org>
Doodling a bit before work, and I need to find the position of a point after
rotating around an axis.

So I need to include transforms.inc to have use of vtransform, but then that
suddenly triggered a parse error of a macro I was using that exports its values
via a (N1, N2) tuple-style assignment.

I tried redeclaring the version after the inc file invocation, but (since this
happens upon exiting the inc file already) that didn't fix anything.

So this looks like a bug in source.

Perhaps someone can confirm and investigate.

(Also, many of these silly macros ought to be inbuilt functions in future
versions)

- BW


Post a reply to this message

From: Bald Eagle
Subject: Re: tuple-style assignment fails after including transforms.inc
Date: 26 Dec 2023 15:45:00
Message: <web.658b3afdecdb07e11f9dae3025979125@news.povray.org>
But then I commented out transforms.inc and everything worked fine, so then I
copied the vtransform macro and pasted into the scene and ...

now the tuple-style assignment feature seems to be permanently broken. :(

So there seems to be some persistent thing somewhere that gets triggered
haphazardly - which are always the most fun bugs to track down and fix.


- BW


Post a reply to this message

From: William F Pokorny
Subject: Re: tuple-style assignment fails after including transforms.inc
Date: 26 Dec 2023 16:57:52
Message: <658b4c60$1@news.povray.org>
On 12/26/23 15:43, Bald Eagle wrote:
> But then I commented out transforms.inc and everything worked fine, so then I
> copied the vtransform macro and pasted into the scene and ...
> 
> now the tuple-style assignment feature seems to be permanently broken. 🙁
> 
> So there seems to be some persistent thing somewhere that gets triggered
> haphazardly - which are always the most fun bugs to track down and fix.

This is probably a case of the tuple related error messages not being 
that clear when the tuple / list / batch assignment types get mixed. I 
mentioned this somewhere else - maybe only a direct email to you, though?

I'm guessing you have written something like this:

#version 3.8;
#include "transforms.inc"
#declare Xfrm = transform {translate -z}
#declare (Vx,Vy) = vtransform(x, Xfrm);
...

If so, that last tuple assignment from the result of the vtransform 
macro (which returns a vector) needs to be something like:

#declare <Vx,Vy> = vtransform(x, Xfrm);

or

#declare <Vx,Vy,Vz> = vtransform(x, Xfrm); // all vector components


---
Aside:

Where still shipped in the core includes, the yuqk fork renamed all 
lower case macro names (and include compiled functions) with leading 
upper case characters to make clear what is a true inbuilt functionality 
and what is not. Official releases of POV-Ray have too many include 
coded things which 'look' like keywords that are not. So, yuqk's 
vtransform() is called VTransform(). This renaming also a step toward 
adding additional, true, inbuilt functions.

Further, the recommended vector transform macro in yuqk is called 
VectorTransform() which comes from Tor Olav Kristensen's vectors.inc 
which ships as a yuqk core include file.

Bill P.


Post a reply to this message

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