Context Free Art – Tutorial 4

The following examples illustrate the use of repetition in Context Free Art.

startshape MyShape

path Line1 {
	MOVETO {x 0 y 0}
	LINETO {x 1 y 0}
	STROKE {width .01}
}

rule MyShape {
	36 * {r 10} Line1 {}
}
Repetition with rotation
startshape MyShape

path Line1 {
	MOVETO {x 0 y 0}
	LINETO {x 1 y 0}
	STROKE {width .01}
}

rule MyShape {
	36 * {r 10 x 0.03} Line1 {}
}
Repetition with rotation and displacement

Context Free Art – Tutorial 3

These exercises cover the use of path in a shape.

startshape MyShape

path Line1 {
	MOVETO {x 0 y 0}
	LINETO {x 1 y 1}
	STROKE {width .01}
}

rule MyShape {
	Line1 {}
}
Line
startshape MyShape

path Line1 {
	MOVETO {x 0 y 0}
	LINETO {x 1 y 1}
	LINETO {x 0 y 1}
	LINETO {x 1 y 0}
	LINETO {x 0 y 0}
	STROKE {width .01}
}

rule MyShape {
	Line1 {}
}
Multiple lines
startshape MyShape

path Line1 {
	MOVETO {x 0 y 0}
	LINETO {x 1 y 0}
	STROKE {width .01}
}

rule MyShape {
	Line1 {r 25}
}
Rotation adjustment