Do Paths Work Yet?
Moderators: MtnViewJohn, chris, mtnviewmark
Do Paths Work Yet?
I just downloaded yesterday and tried to make a simple path but nothing draws. I tried various combinations of parameters for the stroke command and nothing happened. Took it out which should force a fill and still nothing drew.
- MtnViewJohn
- Site Admin
- Posts: 882
- Joined: Fri May 06, 2005 2:26 pm
- Location: Mountain View, California
- Contact:
Code sample
I pared it down with no recursion.
Code: Select all
startshape SQUAREINSQUARE
rule SQUAREINSQUARE {
ONESQUARE { }
ONESQUARE { x .75 y .75 s .25 }
}
path ONESQUARE {
moveto { x 0.5 y 0.5 }
lineto { x -0.5 y 0.5 }
lineto { x -0.5 y -0.5 }
lineto { x 0.5 y -0.5 }
closepoly { }
stroke { }
}
- MtnViewJohn
- Site Admin
- Posts: 882
- Joined: Fri May 06, 2005 2:26 pm
- Location: Mountain View, California
- Contact:
Context Free is case sensitive and all of the path operation are upper case
That you got no error message is clearly a bug. If you fix the path operation names then you get two shapes, as expected.
Code: Select all
startshape SQUAREINSQUARE
rule SQUAREINSQUARE {
ONESQUARE { }
ONESQUARE { x .75 y .75 s .25 }
}
path ONESQUARE {
MOVETO { x 0.5 y 0.5 }
LINETO { x -0.5 y 0.5 }
LINETO { x -0.5 y -0.5 }
LINETO { x 0.5 y -0.5 }
CLOSEPOLY { }
STROKE { }
}
Got a path to work
I tried working on another image and got paths to work with arcto drawing ellipses. I uploaded it to the gallery. I was surprised to see that it uploaded the last version that I had saved rather than the version that was in my window at the time I uploaded. (I think it was the saved version, could have been some other random version. But the version on the screen at the time had the hue parameter removed from the DrawEllipse call.) Is that a feature or a bug?
Figured out my problem
OK, the original problem was that my path commands, moveto, lineto, closepoly, etc were lower case. Changing them to uppercase fixed it. Would be nice to get some kind of error message for this, I'm not used to case sensitive languages.
- MtnViewJohn
- Site Admin
- Posts: 882
- Joined: Fri May 06, 2005 2:26 pm
- Location: Mountain View, California
- Contact:
Re: Got a path to work
Sounds like a bug. We should ask people to save before uploading.bevbh wrote:I tried working on another image and got paths to work with arcto drawing ellipses. I uploaded it to the gallery. I was surprised to see that it uploaded the last version that I had saved rather than the version that was in my window at the time I uploaded. (I think it was the saved version, could have been some other random version. But the version on the screen at the time had the hue parameter removed from the DrawEllipse call.) Is that a feature or a bug?
- MtnViewJohn
- Site Admin
- Posts: 882
- Joined: Fri May 06, 2005 2:26 pm
- Location: Mountain View, California
- Contact:
I played around with Context Free in Windows. It looks like the cfdg text that is uploaded to the gallery is that text that was present in the editor window when you hit the render button. So if you change the cfdg text after hitting render the changes won't be uploaded to the gallery. This is still a bug, but I think I'll delay fixing it until the next release. I'll list it as a known bug on the download page.
The work-around is to re-render the cfdg file before uploading to the gallery.
The work-around is to re-render the cfdg file before uploading to the gallery.