Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error in script parsing ? #44

Closed
kronpano opened this issue Oct 18, 2016 · 6 comments
Closed

error in script parsing ? #44

kronpano opened this issue Oct 18, 2016 · 6 comments

Comments

@kronpano
Copy link

kronpano commented Oct 18, 2016

following script should produce some sort of Beddard's pyramid

crate
rule crate md 3{
{} fbox
{ s 0.5 x 0.9 z 0.9 y -0.9 } crate //1
{ s 0.5 x -0.9 z 0.9 y -0.9 } crate //2
{ s 0.5 x 0.9 z -0.9 y -0.9 } crate //3
{ s 0.5 x -0.9 z -0.9 y -0.9 } crate //4
}
rule fbox{
{} frame
{rx 90} frame
{rz 90}frame
}
rule frame{
{ y 0.46 } ring
{ y -0.46 } ring
}
rule ring {
// front
{ s 1 0.08 0.08 z 5.75 } box
// back
{ s 1 0.08 0.08 z -5.75 } box
// left
{ s 0.08 0.08 1 x -5.75 } box
// right
{ s 0.08 0.08 1 x 5.75 } box
// middle horizontal
{ s 0.08 0.08 1 x 0} box
// middle vertical
{ s 1 0.08 0.08 x 0 } box
}

It does so in Structure Synth but - as far as I can see - here it does not traverse into the crate rule and through number 2,3 and 4 - only number one is executed.

Perhaps an issue with breadth first -not depth?
Not sure where to look for that one.

Structure Synth
image
vs BrowserSynth
image

@ghost
Copy link

ghost commented Oct 19, 2016

I think it may be a bug around the random choosing of weighted rules. In case of rule's weight of 1, it seems to run every rules. But eisenscript runs only one rules according to random seeds. So it should be fixed the bug.

@after12am
Copy link
Owner

fix version is:
https://raw.githubusercontent.com/after12am/eisenscript/master/build/eisenscript.js

This was hard to fix very than I think. And I think transcompiler is very difficult again.
But It is happy to have user like you.

Thank you,

@after12am after12am reopened this Oct 19, 2016
@after12am
Copy link
Owner

after12am commented Oct 19, 2016

Here is works. But the code you tested was not work well...

crate
rule crate md 2 {
{} fbox
{ s 0.5 x 0.9 z 0.9 y -0.9 } crate //1
{ s 0.5 x -0.9 z 0.9 y -0.9 } crate //2
}

rule fbox{
  box
}

@after12am
Copy link
Owner

Sorry, it worked. My testing code was a bit tweaked. try it, please.

@kronpano
Copy link
Author

Thanks a lot!!! Yes - looks like it works well!!!

Question: do you want it to work like Structure Synth? That means - do you expect to see the same structure when you use the same script in Stucture Synth and in BrowserSynth (sorry for the name - just using it to distinguish the two).

@after12am
Copy link
Owner

BrowserSynth is sound good. You have a nice sence for naming things.

The anser is yes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants