POV-Ray : Newsgroups : povray.advanced-users : Problems building new [mixed] arrays. Bug(s)? : Re: Problems building new [mixed] arrays. Bug(s)? Server Time
25 Apr 2024 15:28:45 EDT (-0400)
  Re: Problems building new [mixed] arrays. Bug(s)?  
From: Bald Eagle
Date: 31 May 2020 11:05:01
Message: <web.5ed3c78cb622b740fb0b41570@news.povray.org>
"B. Gimeno" <nomail@nomail> wrote:

> Can an array be invoked from another array?

Arrays can be child elements of other parent arrays.

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

> >#if (
> >  _p.x > _r.x - _rw &&
> >  _p.x < _r.x + _rw &&
> >  _p.y > _r.x - _rh &&
> >  _p.y > _r.x + _rh &&
> > )
>
> And pov-ray reads "&&" the same as "&"?

No, probably not.   That was a macro I was copy/pasting from a javascript
function that I have yet to invoke, get errors, and edit for proper syntax.  ;)

A dozen segmentation faults kinda derailed all of that.


At the moment, I have tracked the problem down to something I ran into before
(somewhere), but had forgotten about - creating an array of arrays, and then
trying to access an uninitialized element of that data structure.   POV-Ray's
source code doesn't have any safeguards against that sort of shenanigans by the
user, freaks out when the element of a parent array is another array, and the
desired element of _that_ array doesn't exist --- and it crashes.

I'm not sure if an ifdef() will protect against this kind of thing, but I will
likely try it out and see - perhaps later on today.

I still need to get the "big picture" straigtened out in my head - even if it's
just a flowchart or pseudo-code, so any advice, help, nuggest of wisdom, or
other breadcrumbs are most appreciated.


Post a reply to this message

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