elfnor / generative-art-examples

Examples for the *Generative Art* node from *Sverchok*
15 stars 2 forks source link

eisenscript_to_xml.py python 3.9 #2

Closed zeromold closed 2 years ago

zeromold commented 2 years ago

In es_call() change: CHANGE: atr_value = pcall.rule_name[0] TO: atr_value = pcall[0]

Where did the 'rule_name' property come from?

elfnor commented 2 years ago

Honest answer - I have no idea, I haven't looked at that code in six years.
I fired up the existing code with the current version of pyparsing (3.0.7) and it no longer runs.

Your suggested fix runs but I get malformed results for example in the translation of https://github.com/elfnor/generative-art-examples/blob/master/koch_snowflake.es

{y 0.866 } R1
should translate to
<call transforms="ty 0.866" rule="R1"/> but now gives <call transforms="" rule="[['y', '0.866']]"/>

Which doesn't work in Sverchok, and is probably a problem somewhere else in my code or changes in pyparsing, not with the suggested fix.

I'll have a look - but no promises

elfnor commented 2 years ago

I've tested the code is working with python 3.9.5 and pyparsing 2.1.3. There have been significant changes to pyparsing since then (latest version is 3.0.7)

Updating it to work with latest pyparsing is possible but low priority for me.