Wow! You makes it looks very pro.
I am coming up with a new idea, a plugin to make gears -- in fact, it should be generally to be a multiple folded center point symmetric, with the target curve represents by bezier curve (therefore we are dealing with points in fact and finally connect them by bezier curve) --- need some restriction to prevent it looks stupid.
BTW, I am sorry the vector operation is not flawless -- even it is fast to calculate a 3000 vertex star, the end can't be closed because of the round off error. Only cos and sin can survive.
Dim n As Integer = 7
Dim a As Double = 30.0
Dim b As Double = 0.0
Dim R1 As Integer = 250 'CInt(Math.Min(Me.ClientSize.Width, Me.ClientSize.Height) / 2 - 4)
Dim R2 As Integer = 200 'CInt(R1 / 2)
Dim ray As Integer = 2
Dim x1, y1, x2, y2, xt, yt As Integer
Dim x0 As Integer = 300 ' CInt(Me.ClientSize.Width / 2)
Dim y0 As Integer = 300 ' CInt(Me.ClientSize.Height / 2)
Dim aa As Single = a * Math.PI / 180
Dim bb As Single = b * Math.PI / 180
Dim cc As Single = Math.PI / n
xt = x0 + R2 * Math.Cos(bb - cc)
yt = x0 + R2 * Math.Sin(bb - cc)
Dim i As Integer
For i = 0 To n Step 1
x1 = x0 + R1 * Math.Cos(aa + bb + 2 * i * cc)
y1 = x0 + R1 * Math.Sin(aa + bb + 2 * i * cc)
x2 = x0 + R2 * Math.Cos(bb + (2 * i + 1) * cc)
y2 = x0 + R2 * Math.Sin(bb + (2 * i + 1) * cc)
If ray = 2 Or ray = 3 Then
gr.DrawLine(Pens.Red, x1, y1, x2, y2)
gr.DrawLine(Pens.Red, x1, y1, xt, yt)
End If
If ray = 1 Or ray = 3 Then
gr.DrawLine(Pens.Red, x0, y0, x1, y1)
gr.DrawLine(Pens.Red, x0, y0, x2, y2)
End If
xt = x2
yt = y2
Next
The bezier curve to draw gear ends with result, might be used somewhere else



Private Sub form2_paint(ByVal sender As Object, ByVal e As PaintEventArgs) Handles MyBase.Paint
Dim gr As Graphics = e.Graphics
Dim n As Integer = 12
Dim i As Integer
Dim R1, R2 As Integer
Dim x0 As Integer = 150, y0 As Integer = 150
R1 = 100
R2 = 70
Dim s As Integer
s = 1
' local variables
Dim A1, A2, A3, A4 As Double
Dim x1, y1, x2, y2, x3, y3, x4, y4, R As Integer
A1 = Math.PI / n
A2 = Math.PI * 0 / 180
x1 = x0 + R1 * Math.Cos(A2)
y1 = y0 + R1 * Math.Sin(A2)
A3 = A2 + s * Math.PI / 3
x2 = x0 + 2 * R1 * Math.Cos(A3)
y2 = y0 + 2 * R1 * Math.Sin(A3)
R = R1
For i = 1 To 2 * n
'adjust the reference direction
If R = R1 Then
R = R2
Else
R = R1
End If
A3 = i * A1 + A2
x3 = x0 + R * Math.Cos(A3)
y3 = y0 + R * Math.Sin(A3)
A4 = A3 - s * Math.PI / 3
x4 = x0 + 2 * R * Math.Cos(A4)
y4 = y0 + 2 * R * Math.Sin(A4)
gr.DrawBezier(Pens.Black, x1, y1, x2, y2, x4, y4, x3, y3)
x1 = x3
y1 = y3
x2 = 2 * x3 - x4
y2 = 2 * y3 - y4
'gr.DrawLine(Pens.Black, x0, y0, x1, y1)
'gr.DrawLine(Pens.Black, x1, y1, x2, y2)
Next
gr.Dispose()
End Sub