Page 1 of 1

Do Paths Work Yet?

Posted: Sat May 02, 2009 9:08 pm
by bevbh
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.

Posted: Sat May 02, 2009 10:29 pm
by MtnViewJohn
Paths work in the current version. Can you post your code?

Code sample

Posted: Sun May 03, 2009 9:12 pm
by bevbh
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 { }
}


more info

Posted: Sun May 03, 2009 9:16 pm
by bevbh
When I render this, there are no syntax errors, and it says 2 rules were loaded and there are 12 shapes. I don't understand why 12 shapes, I would guess 2 polygons or 8 lines.

Posted: Sun May 03, 2009 9:33 pm
by MtnViewJohn
Context Free is case sensitive and all of the path operation are upper case

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 { } 
} 
That you got no error message is clearly a bug. If you fix the path operation names then you get two shapes, as expected.

Got a path to work

Posted: Sun May 03, 2009 10:46 pm
by bevbh
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

Posted: Sun May 03, 2009 10:52 pm
by bevbh
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.

Re: Got a path to work

Posted: Tue May 05, 2009 7:49 am
by MtnViewJohn
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?
Sounds like a bug. We should ask people to save before uploading.

Posted: Sun May 10, 2009 10:11 am
by MtnViewJohn
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.