Please help me understand how ARCTO is drawn.

If you're having trouble using Context Free or don't understand the language, ask for help here.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
applegrew
Posts: 5
Joined: Mon Jun 20, 2011 8:49 am

Please help me understand how ARCTO is drawn.

Post by applegrew »

I have the following code.

Code: Select all

startshape BL
 
path BL {
    MOVETO {x 0 y 0}
    2* [r 90]
     ARCTO {
       x 1
       y 0
       r 1
     }
  STROKE{}
}
When drawn the second curve is not really a circle, but looks skewed. Isn't this supposed to draw a perfect circle, or am I missing something?

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

Re: Please help me understand how ARCTO is drawn.

Post by MtnViewJohn »

Code: Select all

startshape BL

path BL {
    MOVETO {x 1 y 0}
    4* [r 90]
     ARCTO {
       x 0
       y 1
       r 1
     }
  CLOSEPOLY {}
  STROKE {}
}

applegrew
Posts: 5
Joined: Mon Jun 20, 2011 8:49 am

Re: Please help me understand how ARCTO is drawn.

Post by applegrew »

MtnViewJohn wrote:

Code: Select all

startshape BL

path BL {
    MOVETO {x 1 y 0}
    4* [r 90]
     ARCTO {
       x 0
       y 1
       r 1
     }
  CLOSEPOLY {}
  STROKE {}
}
@MtnViewJohn Can you please make me understand why this is drawing a skewed arc in my case? The reason I ask is that I am trying to understand who is drawing correctly - my program (http://cink.applegrew.com), or ContextFree.

Please see the attached screenshots.
Attachments
Output from CInk for the very same program.
Output from CInk for the very same program.
cink.PNG (1.75 KiB) Viewed 23228 times
Output from ContextFree.
Output from ContextFree.
cf.png (3.67 KiB) Viewed 23228 times

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

Re: Please help me understand how ARCTO is drawn.

Post by MtnViewJohn »

Your CInk program is correct. Context Free isn't even drawing a true arc. If you manually unroll the loop:

Code: Select all

startshape BL

path BL {
    MOVETO {x 0 y 0}
    //2* [r 90]
     ARCTO {
       x 1
       y 0
       r 1
     }
     ARCTO {
       x 0
       y 1
       r 1
     }
  STROKE{}
}
You get the same result as CInk. When I try this on Context Free 3 I get the correct result. Clearly there is a bug in ARCTO rotation in Context Free 2.

applegrew
Posts: 5
Joined: Mon Jun 20, 2011 8:49 am

Re: Please help me understand how ARCTO is drawn.

Post by applegrew »

@MtnViewJohn

Oh I never noticed the version 3. When are you planning to release that?

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

Re: Please help me understand how ARCTO is drawn.

Post by MtnViewJohn »

I'm working on the last feature right now: user-defined functions. Then I will put out a beta release. You can get an alpha release with most of the features right now.

applegrew
Posts: 5
Joined: Mon Jun 20, 2011 8:49 am

Re: Please help me understand how ARCTO is drawn.

Post by applegrew »

Good to know.

Post Reply