diff --git a/img/example_epi.png b/img/example_epi.png new file mode 100644 index 0000000..1ed6cda Binary files /dev/null and b/img/example_epi.png differ diff --git a/spirographs.glade b/spirographs.glade index 08c4e53..56c8a57 100644 --- a/spirographs.glade +++ b/spirographs.glade @@ -1,7 +1,156 @@ - + + + Spirographs is a Python 3 application made with +Glade & GTK for Linux. It exists to help you play +around with hyportrochoids and epitrochoids. +These are the shapes that the classic Spirograph +toys make! + + + False + dialog + + + False + vertical + 2 + + + False + end + + + Close + True + True + True + + + + True + True + 1 + + + + + False + False + 0 + + + + + True + False + vertical + + + True + False + + + True + False + img/example_epi.png + + + False + True + 0 + + + + + True + True + center + 1 + False + 6 + 6 + False + aboutBuffer + False + + + True + True + 1 + + + + + True + False + 6 + 6 + Created by A.M. Rowsell ©2026 +License: Mozilla Public License v2 + center + + + False + True + 2 + + + + + True + True + 0 + + + + + True + False + True + + + True + False + img/small_epitrochoid.png + + + False + True + 0 + + + + + True + False + img/small_hypotrochoid.png + + + False + True + 1 + + + + + True + True + 1 + + + + + True + True + 1 + + + + + 0.5 100 @@ -10,11 +159,27 @@ 5 + + 0.5 + 100 + 0.5 + 0.5 + 5 + + + + 0.5 + 100 + 0.5 + 0.5 + 5 + + False Spirographs center - 800 + 1200 800 @@ -27,33 +192,13 @@ 5 5 10 - - - True - False - img/small_epitrochoid.png - - - 0 - 2 - - - - - True - False - img/small_hypotrochoid.png - - - 1 - 2 - - True True False + True + True natural natural @@ -62,12 +207,12 @@ 0 - 0 + 1 2 - + True False @@ -219,30 +364,130 @@ 2 + + + True + False + 5 + 5 + 5 + 5 + 4 + 0 + + + + + 16π + Automatic (beta) + + + + + 1 + 3 + 2 + + + + + True + False + Theta (θ) + + + 0 + 3 + + 0 - 1 + 2 + 2 + + + + + True + False + True + + + True + False + _File + True + + + True + False + + + True + False + Quit + True + + + + + + + + + + True + False + _View + True + + + True + False + + + True + False + Settings + True + + + + + + + + + True + False + _Help + True + + + True + False + + + True + False + _About Spirograph... + True + + + + + + + + + + 0 + 0 2 - - 0.5 - 100 - 0.5 - 0.5 - 5 - - - - 0.5 - 100 - 0.5 - 0.5 - 5 - - diff --git a/spirographs.py b/spirographs.py index cbe5d20..6bf629d 100644 --- a/spirographs.py +++ b/spirographs.py @@ -25,7 +25,7 @@ class spirographs: self.smallRadius = 5 self.distance = 4 self.rotations = 2 - self.highestTheta = (np.lcm(self.smallRadius, self.bigRadius)/self.bigRadius) * self.rotations * math.pi + self.highestTheta = (np.lcm(self.smallRadius, self.bigRadius)/self.bigRadius) * 2 * math.pi self.stepSize = self.highestTheta / 4096 # update initial slider positions self.bigRadiusAdjustment = builder.get_object('bigRadiusAdjustment') @@ -136,8 +136,10 @@ class spirographs: self.plotFigure = Figure(figsize=(5, 8), dpi=100) self.epiPlot, self.hypoPlot = self.plotFigure.subplots(1, 2) self.epiPlot.set_title(f"Epitrochoid of {self.bigRadius}, {self.smallRadius}, {self.distance}") + self.epiPlot.axis('equal') self.epiPlot.plot(self.epiX, self.epiY) self.hypoPlot.set_title(f"Hypotrochoid of {self.bigRadius}, {self.smallRadius}, {self.distance}") + self.hypoPlot.axis('equal') self.hypoPlot.plot(self.hypoX, self.hypoY) self.canvas = FigureCanvas(self.plotFigure) @@ -149,7 +151,9 @@ class spirographs: self.hypoPlot.clear() self.epiPlot.set_title(f"Epitrochoid of {self.bigRadius}, {self.smallRadius}, {self.distance}") self.hypoPlot.set_title(f"Hypotrochoid of {self.bigRadius}, {self.smallRadius}, {self.distance}") + self.epiPlot.axis('equal') self.epiPlot.plot(self.epiX, self.epiY) + self.hypoPlot.axis('equal') self.hypoPlot.plot(self.hypoX, self.hypoY) self.canvas.draw_idle()