POV-Ray : Newsgroups : povray.bugreports : array mixed crashes in parser Server Time
21 Nov 2024 14:51:02 EST (-0500)
  array mixed crashes in parser (Message 1 to 10 of 14)  
Goto Latest 10 Messages Next 4 Messages >>>
From: TreeLimb Jim
Subject: array mixed crashes in parser
Date: 8 Jul 2019 20:35:01
Message: <web.5d23e03185121475799a5f510@news.povray.org>
Dictionary and mixed arrays, what a pleasant adoption.

Developed my files with POV-Ray-3.8.0-alpha.9844500-avx

Running in POV-Ray-3.8.0-alpha.10013324-avx, the example snippet:

#declare EmptySystem = dictionary  {
..LeftMain2515: array mixed[7][4] {
{ 1001, 1, array[10] , array[10] },
{ 1001, 1, array[10] { 0,0,0,0,0, 0,0,0,0,0 }, array[10]{ 0,0,0,0,0, 0,0,0,0,0 }
},
{ 1001, 1, array[10] { 0,0,0,0,0, 0,0,0,0,0 }, array[10]{ 0,0,0,0,0, 0,0,0,0,0 }
},
....

provides an ungraceful exit from parsing:
Possible Parse Error: Uncategorized error thrown at
/Volumes/WDVrijstuk/PovRayUnofficial_3.8.0-alpha. 10013324-avx
source/source/parser/parser_tokenizer.cpp line 2413.

Fatal error in parser: Uncategorized error.


Tried some very simple implementations of array mixed to same result.


Using the OS X front end so I couldn't regress through the intermediate builds
and find where it broke.


Post a reply to this message

From: TreeLimb Jim
Subject: Re: array mixed crashes in parser
Date: 10 Jul 2019 01:15:00
Message: <web.5d2573793c87cc69799a5f510@news.povray.org>
> #declare EmptySystem = dictionary  {
> ..LeftMain2515: array mixed[7][4] {
> ...

#declare EmptySystem = dictionary  {
   .LeftMain2515: array mixed[7][4] {
....


Post a reply to this message

From: Bald Eagle
Subject: Re: array mixed crashes in parser
Date: 10 Jul 2019 06:20:01
Message: <web.5d25bb643c87cc694eec112d0@news.povray.org>
I don't have any time to look at this, and array syntax can get picky even on a
good day, I also have NO experience with dictionaries (perhaps jr can chime in
here if he sees it) so just take a look at:

http://wiki.povray.org/content/Reference:Array


1) I'm not sure what the dots that look like an ellipsis are.
2) I think it would be easier to declare a (very small) mixed array first and
THEN create a dictionary for it
3) those internal array declarations don't look right to me
3) then you could see if you can create a dictionary using a direct declaration
of the mixed array


Post a reply to this message

From: jr
Subject: Re: array mixed crashes in parser
Date: 10 Jul 2019 16:20:02
Message: <web.5d2648113c87cc693936914a0@news.povray.org>
hi,

"Bald Eagle" <cre### [at] netscapenet> wrote:
> I don't have any time to look at this, and array syntax can get picky even on a
> good day, I also have NO experience with dictionaries (perhaps jr can chime in
> here if he sees it) so just take a look at:

if there'd been a complete example.  :-(  anyway, I guess the OP will have
solved the problem already.


regards, jr.


Post a reply to this message

From: Bald Eagle
Subject: Re: array mixed crashes in parser
Date: 10 Jul 2019 16:50:00
Message: <web.5d264e643c87cc694eec112d0@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:

> if there'd been a complete example.  :-(  anyway, I guess the OP will have
> solved the problem already.

Maybe.  The way I read his initial post was that he was trying to run an
"example snippet" - maybe from a file included with the distribution.

I looked in
/usr/share/qtpovray-3.8/scenes/language/arrays/
but nothing there had any mixed array or dictionary examples, but maybe I'm
looking in the wrong place.

The only things I found online were the wiki link I provided, and some example
code for _mixed_ by Ingo.

Maybe he will return with clarification and a solution...


Post a reply to this message

From: TreeLimb Jim
Subject: Re: array mixed crashes in parser
Date: 10 Jul 2019 19:25:00
Message: <web.5d2673883c87cc69799a5f510@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> 1) I'm not sure what the dots that look like an ellipsis are.

Three sequential dots are indeed ellipses. I posted a correction where there
were two dots in the initial post should have been whitespace followed by the
dot-prefixed naming convention.

> 2) I think it would be easier to declare a (very small) mixed array first and
> THEN create a dictionary for it

This would be a logical progression, with experimentation due.
I'd be glad to work with a mixed array data type and then to extend the code to
read it as a dictionary.
During initial scene development I had complex sets of (single-type) arrays
which became a nightmare to extend.

I'd also be glad to create a mixed array and then initialize a dictionary
element. That'll help debugging but not in the spirit of the outcome. It may
soon be.


> 3) those internal array declarations don't look right to me

I'm not sure what you are referring to as 'internal' array declarations. I'll
discuss the composition of this complex data type in a later posting.

>>> THIS IS CERTAIN <<<
They work fine and fantastic in Pov-Ray 3.8.0a.9844500. In fact, I'm continuing
developing the scene in 9844500/

Presently, with 9844500, the uninitialized { integer, integer, array[10],
array[10]} declaration of the first element of the dictionary, .LeftMain2515:
entry is now, for my purposes { integer, integer, array[20], array[20]}  and
works as interpreted by Reference:Array:

http://wiki.povray.org/content/Reference:Array


> 3) then you could see if you can create a dictionary using a direct declaration
> of the mixed array

This would be a logical progression, with experimentation due.


Post a reply to this message

From: Bald Eagle
Subject: Re: array mixed crashes in parser
Date: 10 Jul 2019 20:55:00
Message: <web.5d2688ab3c87cc694eec112d0@news.povray.org>
"TreeLimb Jim" <all### [at] yahoocom> wrote:

> During initial scene development I had complex sets of (single-type) arrays
> which became a nightmare to extend.


Are you aware of:
http://news.povray.org/povray.text.tutorials/thread/%3C3f13449b$1@news.povray.org%3E/

Not sure if that helps at all.

> I'd also be glad to create a mixed array and then initialize a dictionary
> element. That'll help debugging but not in the spirit of the outcome. It may
> soon be.
>
>
> > 3) those internal array declarations don't look right to me
>
> I'm not sure what you are referring to as 'internal' array declarations. I'll
> discuss the composition of this complex data type in a later posting.

IIRC, it looked like you were trying to declare a dictionary, composed of
arrays, that had elements, all in one go.

I was just looking at the syntax of the array declarations, and they didn't
strike me as "properly formed", but it was hard to puzzle out that little
snippet.

No worries - if what you have is working for you, then carry on!   :)


Post a reply to this message

From: TreeLimb Jim
Subject: Re: array mixed crashes in parser
Date: 10 Jul 2019 22:35:00
Message: <web.5d26a0363c87cc69799a5f510@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

> Are you aware of:
>
http://news.povray.org/povray.text.tutorials/thread/%3C3f13449b$1@news.povray.org%3E/

This is fantastic -- IF I have to write a work around.

> Not sure if that helps at all.

I wouldn't have been even closely where to begin searching the archives. Much
thanks.

[[ What I really want is a way to keep track of a core object's location and
orientation as it becomes part of more complex objects ]]


What I am up to is modeling the ARP 2500 modular synthesizer.

https://encyclotronic.com/synthesizers/arp/2500-r167/

Instead of planting arbitrary knob positions and the matrix switch panels for
every instance of module, I used some data abstraction. An entire System is a
dictionary, divided into one or more cabinets filled with info on the modules'
state. For now the data structure is:

//=============Code==========

#declare System = dictionary {
  .ACabinet: array <mixed> [ slotsInCabinet ][ controlValues ] {
    // First slot
    { moduleID.float, panelSize.float, topJackPosition[20].{locVect, rotVect},
bottomJackPositions[20].{locVect, rotVect} }
    //  Middle slots
    { moduleID.float, panelSize.float, topSliderPositions[],
bottomSliderPositions[] }
   // Last slot, same as the first
  } // end of .ACabinet
.... more cabinets and components
} // end of System


Post a reply to this message

From: TreeLimb Jim
Subject: Re: array mixed crashes in parser
Date: 10 Jul 2019 23:05:01
Message: <web.5d26a6743c87cc69799a5f510@news.povray.org>
Using the files in scenes/language/arrays/ I extended each sample .pov file to
include a cursory extension of storing and accessing data in mixed arrays, a
dictionary, and a dictionary containing a mixed array. Just basic data types,
float, string, vector. Baseline worked fine, no problems.

//  Example Data structure snip from "array3 mixed dictionary.pov"
#declare MyDictionary = dictionary {
 .Digit:
  array mixed[4][10]
  {
    {<7,7,7>,6,7,0,2,1,6,5,5,0},
    {<1,1,1>,2,3,4,5,6,7,8,9,0},
    {<0,0,0>,9,8,7,6,5,4,3,2,1},
    {<1,1,1>,1,2,2,3,3,4,4,5,5}
  }
}
// Works!

One test scenario yet to be tested is to implement a multi-dimensional array,
partially initialized. Sounds similar to my problem.

OT Observation: Within a dictionary one can declare another dictionary

// Data structure snip [condensed] from my project
// Dictionary element representingthe
 .CustomCaps:  array[2] {
  dictionary  { // Upper
   ["1004.3"]: array[5]{ Blue, Green, Yellow, Black, Black } // Never shown
   ["1006.1"]: array[5]{ arpPink, Yellow, White, White, Red } // not a 1006
   ["1016" ]: array[5]{ Black, Black, Black, Black, Black } // Never shown
   ["1023.1"]: array[5]{ Blue, Green, Yellow, Black, Blue }
   ["1027.2"]: array[5]{ Orange, Orange, Green, Green, Red }
   ["1045" ]: array[5]{ Red, Red, Red, Green, Yellow } // PT
   }
  dictionary {  // Lower
   ["1004.3"]: array[5]{ Black, Yellow, Green, Red, White } // Never shown
   ["1006.1"]: array[5]{ Yellow, arpPink, arpPink, arpPink, arpPink } // custom
   ["1016" ]: array[5]{ Gray, Black, White, Black, Yellow } // Never shown
   ["1023.1"]: array[5]{ Yellow, Green, Blue, arpPink, Red }
   ["1027.1"]: array[5]{ White, White, White, Yellow, Yellow }
   ["1027.2"]: array[5]{ Orange, Orange, Green, Green, Red }

   }
  }
// This time implementing string labels, represents the colored slider caps for
a particular module

OT Observation: no message flagging when  .pov files used #version 3.7 or 3.8
and mixed arrays or dictionary implemented. No biggie, I used to test software.

Oh, and kudos for all those working on the parser. I'm trying to stay just an
end user.


Post a reply to this message

From: Bald Eagle
Subject: Re: array mixed crashes in parser
Date: 11 Jul 2019 07:05:01
Message: <web.5d27176b3c87cc694eec112d0@news.povray.org>
"TreeLimb Jim" <all### [at] yahoocom> wrote:

> What I am up to is modeling the ARP 2500 modular synthesizer.
>
> https://encyclotronic.com/synthesizers/arp/2500-r167/
>
> Instead of planting arbitrary knob positions and the matrix switch panels for
> every instance of module, I used some data abstraction. An entire System is a
> dictionary, divided into one or more cabinets filled with info on the modules'
> state.

Excellent.   You're completely psychotic.
I like that in a POV-Ray user.   :D

Also keep in mind that vectors can be up to 7 elements long.
And instead of strings, you can store colors as rgb vectors.
And "save" those vectors in #declared constants.
#declare White = <1, 1, 1>;
Then those words are vectors, not strings.

and if you really needed to store strings, but for whatever reason couldn't, you
could do something like:

#declare _one = 1;
#declare _two = 2;
#declare _three = 3;

#declare Label = array [3] {"One", "Two", "Three"};
and then access the Label element with a "named" value:

#declare SliderLabel = Label [_two];


Just some random pre-coffee ideas that may or may not have any real value.
Hoping to see some of your WIP's   =)


Post a reply to this message

Goto Latest 10 Messages Next 4 Messages >>>

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