POV-Ray : Newsgroups : povray.newusers : Mixed array Server Time
7 Jul 2026 12:57:03 EDT (-0400)
  Mixed array (Message 1 to 8 of 8)  
From: kurtz le pirate
Subject: Mixed array
Date: 3 Jul 2026 12:11:44
Message: <6a47df40$1@news.povray.org>
Hello,


With this :

#declare Datas = array mixed;

#declare Datas[0] = <1,2,3>;
#declare Datas[1] = <1,2,3,4>;
#declare Datas[2] = <1,2>;


how can you tell that the vector in Datas[0] has 3 components and the 
vector in Datas[1] 4 ?


So far, I haven't found anything online about this. So a little help 
would be appreciated ;)



-- 
kurtz le pirate
compagnie de la banquise


Post a reply to this message

From: jr
Subject: Re: Mixed array
Date: 3 Jul 2026 16:10:00
Message: <web.6a4816b0208027db22ad5b506cde94f1@news.povray.org>
hi,

kurtz le pirate <kur### [at] freefr> wrote:
> With this :
> #declare Datas = array mixed;
> #declare Datas[0] = <1,2,3>;
> #declare Datas[1] = <1,2,3,4>;
> #declare Datas[2] = <1,2>;
>
> how can you tell that the vector in Datas[0] has 3 components and the
> vector in Datas[1] 4 ?

in a word, you/we cannot.


> So far, I haven't found anything online about this. So a little help
> would be appreciated ;)

iirc, both Bald Eagle and WFP have partial solutions.  (no refs, sorry)

if only 2/3/4 vector data is stored, you could combine vector and #components in
a 5-vector ?


regards, jr.


Post a reply to this message

From: Cousin Ricky
Subject: Re: Mixed array
Date: 3 Jul 2026 20:02:01
Message: <6a484d79@news.povray.org>
On 2026-07-03 12:11 (-4), kurtz le pirate wrote:
> 
> #declare Datas = array mixed;
> 
> #declare Datas[0] = <1,2,3>;
> #declare Datas[1] = <1,2,3,4>;
> #declare Datas[2] = <1,2>;
> 
> 
> how can you tell that the vector in Datas[0] has 3 components and the
> vector in Datas[1] 4 ?

I managed to figure something out for some special applications in two
of my libraries.  Have a look at macro Caption__Get_padding() in
caption.inc and macro Lamp_Has4D() in desklamp.inc and see if you can
generalize them.

  https://github.com/CousinRicky/POV-Caption/blob/main/caption.inc
  https://github.com/CousinRicky/POV-DeskLamp/blob/main/desklamp.inc


Post a reply to this message

From: Bald Eagle
Subject: Re: Mixed array
Date: 3 Jul 2026 20:55:00
Message: <web.6a4858c9208027dbd1d09a9825979125@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:

> iirc, both Bald Eagle and WFP have partial solutions.  (no refs, sorry)

I have a full solution.

https://news.povray.org/povray.general/message/%3Cweb.682bc388985098ff1f9dae3025979125%40news.povray.org%3E/#%3Cweb.682
bc388985098ff1f9dae3025979125%40news.povray.org%3E

There's a slightly more advanced version posted sometime last year, but this
should do ya.

- BE


Post a reply to this message

From: Bald Eagle
Subject: Re: Mixed array
Date: 4 Jul 2026 08:50:00
Message: <web.6a4900ca208027dbd1d09a9825979125@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

> There's a slightly more advanced version posted sometime last year,

https://news.povray.org/povray.advanced-users/message/%3Cweb.68478f382f29ff11f9dae3025979125%40news.povray.org%3E/#%3Cw
eb.68478f382f29ff11f9dae3025979125%40news.povray.org%3E

- BE


Post a reply to this message

From: kurtz le pirate
Subject: Re: Mixed array
Date: 4 Jul 2026 12:16:53
Message: <6a4931f5$1@news.povray.org>
Thanks for your replies, guys.
Those are some really clever solutions. Bravo.

I'm not sure yet if I'll use them or rewrite my code so I don't have to 
run those tests anymore.

Thanks again




-- 
kurtz le pirate
compagnie de la banquise


Post a reply to this message

From: William F Pokorny
Subject: Re: Mixed array
Date: 5 Jul 2026 12:07:33
Message: <6a4a8145$1@news.povray.org>
On 7/3/26 16:08, jr wrote:
> iirc, both Bald Eagle and WFP have partial solutions.  (no refs, sorry)

FWIW, sample yuqk code using its id_type() keyword.

//---
#version unofficial 3.8; // yuqk
#if (file_exists("version.inc"))
     #include "version.inc"
#end
#if (!defined(Fork_yuqk))
     #error "This POV-Ray SDL code requires the yuqk fork."
#end

#include "setidtypes.inc"       // init global.dictIdTypes dictionary
McrPrintGlobalDictIdTypes(true) // Utility macro to print types

#declare Datas = array mixed;

#declare Datas[0] = <1,2,3>;
#declare Datas[1] = <1,2,3,4>;
#declare Datas[2] = <1,2>;

#if (id_type(Datas[2])=global.dictIdTypes.v2d)
     #debug "\nDatas[2] is a 2D vector\n"
#end
#if (id_type(Datas[0])=global.dictIdTypes.v3d)
     #debug "\nDatas[0] is a 3D vector\n"
#end
#if (id_type(Datas[1])=global.dictIdTypes.v4d)
     #debug "\nDatas[1] is a 4D vector\n"
#end
#debug "\n"

#error "No objects. Testing SDL."
//---

Bill P.


Post a reply to this message

From: Bald Eagle
Subject: Re: Mixed array
Date: 7 Jul 2026 08:05:00
Message: <web.6a4ceab7208027dbd1d09a9825979125@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:

Well hello there, stranger.
Hope all is going as well as can be.

We've missed you in these parts.

- BW


Post a reply to this message

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