repeat a path

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

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
surrealista1
Posts: 3
Joined: Mon Jan 30, 2012 7:54 pm

repeat a path

Post by surrealista1 »

I want to repeat and rotate the following path, but i cant, i had try using a rule before and after the path, but i had not success

Code: Select all

startshape serp
path serp {

    MOVETO {x 0 y 0}

     ARCTO { x -1  y 0  r 1     }
 ARCTO{x -2  y 0 r -1}
ARCTO{x -3  y 0 r 1}
ARCTO{x -3.2 y 0 r 0.2}
ARCTO{x -3 y 0 r 0.2}
  STROKE { h 248.33 sat 0.8728 b 1.0000}
}
Does anybody know what i should do.
Thanks

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

Re: repeat a path

Post by MtnViewJohn »

This works fine for me:

Code: Select all

startshape serps
path serp {

MOVETO {x 0 y 0}

ARCTO { x -1 y 0 r 1 }
ARCTO{x -2 y 0 r -1}
ARCTO{x -3 y 0 r 1}
ARCTO{x -3.2 y 0 r 0.2}
ARCTO{x -3 y 0 r 0.2}
STROKE { h 248.33 sat 0.8728 b 1.0000}
}

rule serps {
  10* [x 1 y 1]
    serp {}
}
Did you remember to change the startshape to the name of your rule?

surrealista1
Posts: 3
Joined: Mon Jan 30, 2012 7:54 pm

Re: repeat a path

Post by surrealista1 »

Thank you Mountview john, it solve my problem

Post Reply