From 7fb5a0608805630b0def90d497c474b9bf1bdb2c Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Thu, 31 Mar 2011 22:08:25 -0400 Subject: [PATCH] add drawFilledCircle() and cap lines --- SketchWidget.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/SketchWidget.py b/SketchWidget.py index 76185f4..a189cb5 100644 --- a/SketchWidget.py +++ b/SketchWidget.py @@ -115,6 +115,13 @@ class SketchWidget: glVertex(x1 + x_right, y1 + y_right) glVertex(x1 + x_left, y1 + y_left) glEnd() + self.drawFilledCircle(x0, y0, size, 16) + self.drawFilledCircle(x1, y1, size, 16) def drawFilledCircle(self, x, y, radius, steps): - pass + glBegin(GL_TRIANGLE_FAN) + glVertex(x, y) + for i in range(steps + 1): + angle = i * 2 * math.pi / steps + glVertex(x + radius * math.cos(angle), y + radius * math.sin(angle)) + glEnd()