I grabbed the code to render a gear from a Mathematica Demo, but I'm having difficulty reproducing the way it's to be used:
gear[{x_, y_}, n_] := ParametricPlot[{
{x + (1 + 2 n) Cos[1.5708/n + theta] - Cos[1.5708/n + theta + 2 n theta],
y + (1 + 2 n) Sin[1.5708/n + theta] - Sin[1.5708/n + theta + 2 n theta]},
{x + (-1 + 2 n) Sin[1.5708 - 4.7124/n - theta]
- Sin[4.7124 - 4.7124/n - theta + 2 n theta],
y + (-1 + 2 n) Cos[1.5708 - 4.7124/n - theta]
- Cos[4.7124 - 4.7124/n - theta + 2 n theta]}},
{theta, 0, 2 Pi},
PlotPoints -> 101, RegionFunction -> (SquareWave[n #3/6.2832] > 1*^-6 &),
Axes -> False]
Then
Graphics[gear[{0, 0}, 20]]
works as expected, but
Graphics[{Thick, gear[{0, 0}, 20]}]
generates the Graphics is not a Graphics primitive or directive
error. Is there a way to make this work?
Rotate[gear[...],theta]
. Unfortunately nowFirst
simply removes theRotate
. Any suggestions for what will work in this case? $\endgroup$ – Keith Feb 9 '15 at 18:34