Page 1 of 1

v3 bugs?

Posted: Thu May 26, 2011 2:17 am
by kipling
I have been trying out the v3 alpha (Mac OS X, #26) and am found some quirks/bugs. Some need more testing before I am sure what is going on. Do you want them here or in the wiki?
e.g. I am pretty sure this is a bug

Code: Select all

startshape A

shape A{ X{} XX{} }

shape X{
	loop j=0,3
		{y .3}
		{
//		SQUARE{  s .2 b 1 sat 1}
		MOVETO(.2,0) LINETO(1,-.1) ARCTO(1,.1,.2) LINETO(.2,0)
		CLOSEPOLY()
		FILL(){}
		}
	}

shape XX{
	loop j=0,3
		{y .3}
		{
		SQUARE{  s .2 b 1 sat 1}
//		MOVETO(.2,0) LINETO(1,-.1) ARCTO(1,.1,.2) LINETO(.2,0)
//		CLOSEPOLY()
//		FILL(){}
		}
	}
bug1.png
bug1.png (3.41 KiB) Viewed 15115 times

Re: v3 bugs?

Posted: Thu May 26, 2011 6:46 pm
by MtnViewJohn
Yeah, that's a bug. I can't reproduce it so it must be one of the bugs that I fixed already. I'll put out a new alpha release with the latest bug fixes and feature updates.

ETA - I just noticed that your loop body contains path operations and a path command. This wasn't allowed in version 2, but is allowed in version 3. I just didn't implement it correctly.

Re: v3 bugs?

Posted: Sat May 28, 2011 11:17 pm
by Monkstone

Code: Select all

startshape A

shape A{ X{} XX{} }

shape X{
   loop j=0,3
      {y .3}
      {
//      SQUARE{  s .2 b 1 sat 1}
      DD{}
      }
   }

shape XX{
   loop j=0,3
      {y .3}
      {
      SQUARE{  s .2 b 1 sat 1}
//      MOVETO(.2,0) LINETO(1,-.1) ARCTO(1,.1,.2) LINETO(.2,0)
//      CLOSEPOLY()
//      FILL(){}
      }
}

shape DD{
      MOVETO(.2,0) LINETO(1,-.1) ARCTO(1,.1,.2) LINETO(.2,0)
      CLOSEPOLY()
      FILL(){}
}
Yeah interestingly the shapes line up when the path shape is separated ( and of course you can then combine the two shapes in one rule).

Re: v3 bugs?

Posted: Sun May 29, 2011 8:09 am
by MtnViewJohn
Yes, the bug only occurs if you have a loop that has both path operations (MOVETO, LINETO, etc) and path commands (STROKE and FILL). Loops in rules are OK, as are loops in paths that don't mix operations and commands.

Code: Select all

shape XX{
   MOVETO(.2,0) LINETO(1,-.1) ARCTO(1,.1,.2) LINETO(.2,0)
   CLOSEPOLY()
   loop j=0,3 {y .3}
      FILL{}
}
Also doesn't have the issue because the path operations are hoisted out of the loop.