If the number of teeth on the cog evenly divides the number of teeth on the wheel N times then we get a simple N-pointed shape. For example, here is the pattern generated by a wheel of size 150 with a cog of size 50 and varying hole positions from 0 to 75.
The code is Pattern2.java.
SpiroGraphics
Star Patterns