POV-Ray : Newsgroups : povray.general : L-Systems in Povray Server Time
1 Jun 2024 20:33:43 EDT (-0400)
  L-Systems in Povray (Message 35 to 44 of 64)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Droj
Subject: Re: L-Systems in Povray
Date: 10 Jul 2023 13:05:00
Message: <web.64ac397e453cebfcf62c2adc3b2af915@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:
> hi,
>
> "Droj" <803### [at] drojde> wrote:
> > ...
> > not faint at the sight of a #while but of (a) 35 years WHILE I've been missing
> > crucial things in Povray :-)).
> > Being a _bloody_user_only (starting with Povray 2.? and Moray 1.5, MS DOS
> > versions) now 'wasted WHILE time' strikes back.
>
> looking at the image posted, methinks thou protest too much.  </grin>  v nice.
>
>
> > I feel like Ingo got me by the 'short hair': I am able to use a macro (most of
> > the times), sometimes adapt something (happy when it works, if not: depressed),
> > understanding the concept (sometimes - more or less - not 'word by word') but
> > separating positions and angles for 3D / creating a LIFO array - that's way
> > beyond me.
> > I'll try to do my best but to cover that gap is a huge thing. At least I could
> > add something to Ingo's code to produce the 'Pentaplexity' (still crude using
> > Ingo's words).
>
> re LIFOs, have a look at 'queues.inc'.  (even though the demos suck)
>
>
> regards, jr.

Hi,

after a lot of brooding over LIFO ( and waiting for one of the Muses to kiss me
- none of them did) I gave it a try.
Be warned Povray complains: Expected 'array identifier', undeclared identfier
'Vertices' found instead.
What it should do is: produce a simple sort Pythagoras tree.

Hope you are not laughing your head off when you see my humble efforts.

Please advice

Cheers
Droj


Post a reply to this message


Attachments:
Download 'lsys7.pov.txt' (4 KB)

From: jr
Subject: Re: L-Systems in Povray
Date: 10 Jul 2023 13:35:00
Message: <web.64ac410a453cebfcb49d80446cde94f1@news.povray.org>
hi,

"Droj" <803### [at] drojde> wrote:
> ...
> after a lot of brooding over LIFO ( and waiting for one of the Muses to kiss me
> - none of them did) I gave it a try.

you're supposed to be clean shaven before kissing :-)


> Be warned Povray complains: Expected 'array identifier', undeclared identfier
> 'Vertices' found instead.
> What it should do is: produce a simple sort Pythagoras tree.
>
> Hope you are not laughing your head off when you see my humble efforts.

"ha ha".  so, we got that out of the way ;-)


> Please advice

should be able to find some time to look over the code (thanks) before the week
is out.


regards, jr.


Post a reply to this message

From: Bald Eagle
Subject: Re: L-Systems in Povray
Date: 10 Jul 2023 13:50:00
Message: <web.64ac43e2453cebfc1f9dae3025979125@news.povray.org>
"Droj" <803### [at] drojde> wrote:

> Be warned Povray complains: Expected 'array identifier', undeclared identfier
> 'Vertices' found instead.

So, I dabbled a bit with this to get it to work, and it seems that you're
running into the same sort of weird behaviour of the parser that I was running
into with my kumiko triangles.  POV-Ray should definitely be assigning a value -
any value - to Vertices, but it doesn't.

In order to force the issue, I changed the ending of the macro to:
#declare Vertices = Return;
Vertices


and then POV-Ray crashed, almost immediately.

So I'm again strongly suggesting that there IS a bug, Lvalues are NOT getting
defined when they are clearly being declared in the usual manner.  I've done
this sort of thing before for years, and it's not a newbie error, bad syntax, or
some misunderstanding about how things get declared.  I changed all of the
pertinent #local statements to #declare, and all manner of other hocus pocus to
try to get the macro to work.

_Something_ is going awry in the source code that has something to do with the
scope of variables declared in macros, and possibly include files.  Since jr
(and IIRC someone else) looked into this and tested my triangle code and it
seemed to work for them, the problem seems to be system architecture / OS /
version / build dependent.

So - I don't see you doing anything wrong - I think there's a real problem that
doesn't seem like it will be easy to track down.

I do suggest that you take that into account and see if you can code a
workaround, and plug in a few lines of debugging code to see what gets defined,
what the array dimensions are as the code progresses, and how many iterations of
loops you're instantiating - since I'm not sure what's making my monkey-wrenched
code trigger a hard crash.

- BW


Post a reply to this message


Attachments:
Download 'lsys7_bw_crashes.pov.txt' (5 KB)

From: jr
Subject: Re: L-Systems in Povray
Date: 10 Jul 2023 13:50:00
Message: <web.64ac441c453cebfcb49d80446cde94f1@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:
> ...
> should be able to find some time to look over the code (thanks) before the week
> is out.

as a first clue though, testing for 'Vertices's existence in the line following
the declaration says no.  so the workings in 'Lvertices()' need to be
"debugged", it looks.


regards, jr.


Post a reply to this message

From: jr
Subject: Re: L-Systems in Povray
Date: 10 Jul 2023 18:15:00
Message: <web.64ac82c7453cebfcb49d80446cde94f1@news.povray.org>
> "jr" <cre### [at] gmailcom> wrote:
> > ...
> > should be able to find some time to look over the code (thanks) before the week
> > is out.
>
> ... so the workings in 'Lvertices()' need to be "debugged", it looks.

in Lvertices(), the for loop needs to read '#for (i,1,strlen(Lstr))'.  then the
problem becomes that you have no 'BuildRules' key for 'X', yet.  hth.


regards, jr.


Post a reply to this message

From: Bald Eagle
Subject: Re: L-Systems in Povray
Date: 10 Jul 2023 20:10:00
Message: <web.64ac9d71453cebfc1f9dae3025979125@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:

> in Lvertices(), the for loop needs to read '#for (i,1,strlen(Lstr))'.  then the
> problem becomes that you have no 'BuildRules' key for 'X', yet.  hth.

So, I added:

#declare BuildRules["X"] = asc("X");

and

#declare Axiom = "FFFFX";
#declare Rules = dictionary {
  ["X"] : "F[-F|][+F|]",
 // ["Y"] : "FX-Y"
}

I have NO idea what I'm doing, but that gets me a completed render and no
crashing.

I'm wondering if the X's in the Rules create an infinite recursion of some sort,
and that causes the crash?



--- I'm interested in how the branching works, since I was toying with a scene
to make "roots" or "vines" randomly grow and branch out around the outside of a
cylinder....


- BW


Post a reply to this message

From: ingo
Subject: Re: L-Systems in Povray
Date: 11 Jul 2023 01:05:00
Message: <web.64ace273453cebfc17bac71e8ffb8ce3@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "jr" <cre### [at] gmailcom> wrote:
>
> > in Lvertices(), the for loop needs to read '#for (i,1,strlen(Lstr))'.  then the
> > problem becomes that you have no 'BuildRules' key for 'X', yet.  hth.
>
> So, I added:
>
> #declare BuildRules["X"] = asc("X");


The #switch needs an #else and do nothing there, for all symbols that do not
have a build rule, such as 'X' in this case


Regarding muses, besides shaving, although she prefers photography, point your
attention to the 'muse with the glass eye'. She likes ray tracing too.

ingo


Post a reply to this message

From: jr
Subject: Re: L-Systems in Povray
Date: 11 Jul 2023 06:55:00
Message: <web.64ad3482453cebfcb49d80446cde94f1@news.povray.org>
hi,

"Bald Eagle" <cre### [at] netscapenet> wrote:
> ...
> I have NO idea what I'm doing, but that gets me a completed render and no
> crashing.

_neat_.  (and thanks, that'll give me .. encouragement to play a little more
:-))


regards, jr.


Post a reply to this message

From: Bald Eagle
Subject: Re: L-Systems in Povray
Date: 11 Jul 2023 13:20:00
Message: <web.64ad8ef9453cebfc1f9dae3025979125@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:
> hi,
>
> "Bald Eagle" <cre### [at] netscapenet> wrote:
> > ...
> > I have NO idea what I'm doing, but that gets me a completed render and no
> > crashing.
>
> _neat_.  (and thanks, that'll give me .. encouragement to play a little more
> :-))
>
>
> regards, jr.

Other changes:

#declare BuildRules["X"] = asc("X"); // 88

#debug concat( "X = ", str(asc("X"), 0, 0), "\n")

#macro MoveRight (T_Pos)
 <T_Pos.x + 1, T_Pos.y, T_Pos.z>
 //#local T_Pos = <T_Pos.x + 1, T_Pos.y, T_Pos.z>;
 //#declare VXY_Arr[Curr_Items] = T_Pos;
 //#declare AZZ_Arr[Curr_Items] = AngleZZ;
 //#declare Curr_Items = Curr_Items + 1;
#end

    #case (88)
    #local T_Pos = MoveRight (T_Pos);
    #break

    #else
    #break
   #end // end switch


#declare Axiom = "FFFFX";
#declare Rules = dictionary {
  ["X"] : "F[-X|][+F|]",
 // ["Y"] : "FX-Y"
}

#declare Iterations = 50;


Doesn't get me much, except a few line segments.  Once I have more time to
decipher the Big Picture, then it will be easier to make things work.


Post a reply to this message


Attachments:
Download 'lsys7.pov.txt' (5 KB)

From: Droj
Subject: Re: L-Systems in Povray
Date: 12 Jul 2023 10:10:00
Message: <web.64aeb317453cebfcdec7f1e73b2af915@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "jr" <cre### [at] gmailcom> wrote:
> > hi,
> >
> > "Bald Eagle" <cre### [at] netscapenet> wrote:
> > > ...
> > > I have NO idea what I'm doing, but that gets me a completed render and no
> > > crashing.
> >
> > _neat_.  (and thanks, that'll give me .. encouragement to play a little more
> > :-))
> >
> >
> > regards, jr.
>
> Other changes:
>
> #declare BuildRules["X"] = asc("X"); // 88
>
> #debug concat( "X = ", str(asc("X"), 0, 0), "\n")
>
> #macro MoveRight (T_Pos)
>  <T_Pos.x + 1, T_Pos.y, T_Pos.z>
>  //#local T_Pos = <T_Pos.x + 1, T_Pos.y, T_Pos.z>;
>  //#declare VXY_Arr[Curr_Items] = T_Pos;
>  //#declare AZZ_Arr[Curr_Items] = AngleZZ;
>  //#declare Curr_Items = Curr_Items + 1;
> #end
>
>     #case (88)
>     #local T_Pos = MoveRight (T_Pos);
>     #break
>
>     #else
>     #break
>    #end // end switch
>
>
> #declare Axiom = "FFFFX";
> #declare Rules = dictionary {
>   ["X"] : "F[-X|][+F|]",
>  // ["Y"] : "FX-Y"
> }
>
> #declare Iterations = 50;
>



>
> Doesn't get me much, except a few line segments.  Once I have more time to
> decipher the Big Picture, then it will be easier to make things work.

Hi,

first of all thanks to all of you for your engagement to solve this 'mystery'.

Just one remark: please do not use 'Iterations = 50;'. If the coding works
properly Povray will produce an amount of data to choke a horse with.

As far as using "X" or "Y" without declaring it is concerned: I used Ingo's
original code - means vector and angle are not separated - with

#declare Axiom = "X";
#declare Rules = dictionary{
  ["X"] : "XFYFX+F+YFXFY-F-XFYFX",
  ["Y"] : "YFXFY-F-XFYFX+F+YFXFY"
}
and it works like a charm (see attachment).

Furthermore I used Ingo's original and added Push and Pop stacks and...
Povray again complained about (vertices).
Could it be that Povray hates LIFO arrays <grin>.

Can't wait until Ingo's 'muse with the glass eye' is kissing me - I AM cleanly
shaven.

Time to investigate further.

Regards
Droj


Post a reply to this message


Attachments:
Download 'lsys3.pov.txt' (3 KB)

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

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