v3 bugs?

Let the developers know what you think of the software and what can be done to either improve the CFDG language or the Context Free program.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
User avatar
kipling
Posts: 91
Joined: Wed Jun 18, 2008 2:36 am

v3 bugs?

Post 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 59191 times

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Re: v3 bugs?

Post 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.

User avatar
Monkstone
Posts: 13
Joined: Fri Jul 03, 2009 10:40 pm
Location: Pembrokeshire, UK
Contact:

Re: v3 bugs?

Post 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).

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Re: v3 bugs?

Post 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.

Post Reply