From 015263ab1f1f84977391ca77c55bcb75f7517a7e Mon Sep 17 00:00:00 2001 From: "A.M. Rowsell" Date: Sun, 27 Jun 2021 17:29:33 -0400 Subject: [PATCH] Step size refuses to change. Small updates to plot size. --- spirographs.glade | 24 ++++++++++++------------ spirographs.py | 9 ++++++--- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/spirographs.glade b/spirographs.glade index 9ad6e2a..1b75573 100644 --- a/spirographs.glade +++ b/spirographs.glade @@ -3,27 +3,27 @@ - 0.10 + 0.5 100 - 0.10 - 0.10 - 1 + 0.5 + 0.5 + 5 - 0.10 + 0.5 100 - 0.10 - 0.10 - 1 + 0.5 + 0.5 + 5 - 0.10 + 0.5 100 - 0.10 - 0.10 - 1 + 0.5 + 0.5 + 5 diff --git a/spirographs.py b/spirographs.py index 2923717..38d43ad 100644 --- a/spirographs.py +++ b/spirographs.py @@ -28,15 +28,18 @@ class spirographs: bigRadiusAdjustment = builder.get_object('bigRadiusAdjustment') smallRadiusAdjustment = builder.get_object('smallRadiusAdjustment') distanceAdjustment = builder.get_object('distanceAdjustment') + # set the initial values to a neat shape bigRadiusAdjustment.set_value(self.bigRadius) smallRadiusAdjustment.set_value(self.smallRadius) distanceAdjustment.set_value(self.distance) + # try and set the step size?! + bigRadiusAdjustment.set_step_increment(0.5) + smallRadiusAdjustment.set_step_increment(0.5) + distanceAdjustment.set_step_increment(0.5) # create initial plot self.recalcPoints() self.showPlot() - - def calcEpiX(self, theta): return ((self.bigRadius + self.smallRadius) * math.cos(theta)) - (self.distance * math.cos(((self.bigRadius + self.smallRadius)/(self.smallRadius))*theta)) @@ -76,7 +79,7 @@ class spirographs: def showPlot(self): viewport = builder.get_object('plotViewport') - self.plotFigure = Figure(figsize=(5, 4), dpi=100) + self.plotFigure = Figure(figsize=(5, 5), dpi=100) self.epiPlot, self.hypoPlot = self.plotFigure.subplots(1, 2) self.epiPlot.set_title(f"Epichondroid of {self.bigRadius}, {self.smallRadius}, {self.distance}") self.epiPlot.plot(self.epiX, self.epiY)