From af6c9be8f7556cd12b224c52cffb84e1173566a1 Mon Sep 17 00:00:00 2001 From: Florian Festi Date: Thu, 7 Nov 2019 15:17:52 +0100 Subject: [PATCH] SBCMicroRack: Rearrange parts --- boxes/generators/microrack.py | 54 +++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/boxes/generators/microrack.py b/boxes/generators/microrack.py index 35d8784..6d7285c 100644 --- a/boxes/generators/microrack.py +++ b/boxes/generators/microrack.py @@ -161,24 +161,42 @@ class SBCMicroRack(Boxes): # render your parts here - self.rectangularWall(height_total + height_per/2, x + self.hole_dist_edge * 2, "eseS", callback=[ - self.paint_finger_holes, - self.paint_netusb_holes, - ], - move="right") - self.rectangularWall(y + self.hole_dist_edge * 2, x + self.hole_dist_edge * 2, "efef", - move="right") + with self.saved_context(): + self.rectangularWall(height_total + height_per/2, + x + self.hole_dist_edge * 2, + "eseS", + callback=[self.paint_finger_holes, + self.paint_netusb_holes], + move="up") + + self.rectangularWall(height_total + height_per/2, + x + self.hole_dist_edge * 2, + "eseS", + callback=[self.paint_finger_holes, + self.paint_stable_features], + move="up") + + if self.switch: + self.rectangularWall(height_total + height_per / 2, + x + self.hole_dist_edge * 2, + "eseS", + callback=[self.paint_stable_features], + move="up") + + self.rectangularWall(height_total + height_per/2, + x + self.hole_dist_edge * 2, + "eseS", + move="right only") + + self.rectangularWall(y + self.hole_dist_edge * 2, + x + self.hole_dist_edge * 2, + "efef", + move="up") for i in range(self.sbcs): - self.rectangularWall(y + self.hole_dist_edge * 2, x + self.hole_dist_edge * 2, "efef", callback=[ - self.paint_mounting_holes - ], move="up") + self.rectangularWall(y + self.hole_dist_edge * 2, + x + self.hole_dist_edge * 2, + "efef", + callback=[self.paint_mounting_holes], + move="up") - self.rectangularWall(height_total + height_per/2, x + self.hole_dist_edge * 2, "eseS", callback=[ - self.paint_finger_holes, - self.paint_stable_features - ], - move="left") - - if self.switch: - self.rectangularWall(height_total + height_per / 2, x + self.hole_dist_edge * 2, "eseS", callback=[self.paint_stable_features], move="down")