diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml
index d80ca6079..9966a4378 100644
--- a/.github/workflows/pages.yml
+++ b/.github/workflows/pages.yml
@@ -35,7 +35,7 @@ jobs:
cd ../build/ && ls && ls html/
cp -r ../../static .
rm -rf doctrees
- touch .nojekyll
+ touch .nojekyll
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
diff --git a/MANIFEST.in b/MANIFEST.in
index 4d410d192..58a9fdca0 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -3,4 +3,4 @@ include examples/*.svg
include documentation/presentation.odp
include inkex/*.txt
include po/*
-include scripts/boxes2pot scripts/boxes2inkscape scripts/boxes_proxy.py
\ No newline at end of file
+include scripts/boxes2pot scripts/boxes2inkscape scripts/boxes_proxy.py
diff --git a/boxes/__init__.py b/boxes/__init__.py
index c5b43927e..217696ca9 100755
--- a/boxes/__init__.py
+++ b/boxes/__init__.py
@@ -17,6 +17,7 @@
import argparse
import copy
+import gettext
import math
import random
import re
@@ -28,20 +29,14 @@
from typing import Any
from xml.sax.saxutils import quoteattr
+import qrcode
from shapely.geometry import *
from shapely.ops import split
-import gettext
-from boxes import edges
-from boxes import formats
-from boxes import gears
-from boxes import parts
-from boxes import pulley
+from boxes import edges, formats, gears, parts, pulley
from boxes.Color import *
-from boxes.vectors import kerf
-
-import qrcode
from boxes.qrcode_factory import BoxesQrCodeFactory
+from boxes.vectors import kerf
### Helpers
@@ -413,7 +408,7 @@ def open(self):
if self.qr_code:
self.renderQrCode()
self.ctx.stroke()
-
+
def renderQrCode(self):
content = self.metadata['url_short'] or self.metadata["cli_short"]
size = 1.5
diff --git a/boxes/drawing.py b/boxes/drawing.py
index da1e78c26..3645772fd 100644
--- a/boxes/drawing.py
+++ b/boxes/drawing.py
@@ -1,9 +1,9 @@
from __future__ import annotations
+import codecs
import datetime
-import math
import io
-import codecs
+import math
from typing import Any
from xml.etree import ElementTree as ET
@@ -519,7 +519,7 @@ def finish(self, inner_corners="loop"):
tree = ET.ElementTree(svg)
self._add_metadata(svg)
-
+
for i, part in enumerate(self.parts):
if not part.pathes:
continue
@@ -789,7 +789,7 @@ def finish(self, inner_corners="loop"):
tree = ET.ElementTree(svg)
if self.dbg: print ("8", num)
-
+
cs = ET.SubElement(svg, "CutSetting", Type="Cut")
index = ET.SubElement(cs, "index", Value="3") # green layer (ETCHING)
name = ET.SubElement(cs, "name", Value="Etch")
@@ -829,7 +829,7 @@ def finish(self, inner_corners="loop"):
index = ET.SubElement(cs, "index", Value="30") # T1 layer (ANNOTATIONS)
name = ET.SubElement(cs, "name", Value="T1") # tool layer do not support names
priority = ET.SubElement(cs, "priority", Value="7") # is not cut at all
-
+
for i, part in enumerate(self.parts):
if self.dbg: print ("7", num)
if not part.pathes:
@@ -840,7 +840,7 @@ def finish(self, inner_corners="loop"):
children = ET.SubElement(gp, "Children")
children.text = "\n "
children.tail = "\n"
-
+
for j, path in enumerate(part.pathes):
myColor = self.lbrn2_colors[4*int(path.params["rgb"][0])+2*int(path.params["rgb"][1])+int(path.params["rgb"][2])]
@@ -858,7 +858,7 @@ def finish(self, inner_corners="loop"):
print ("6",num, c)
num += 1
num = 0
-
+
c = path.path[num]
C, x, y = c[0:3]
if self.dbg:
@@ -917,7 +917,7 @@ def finish(self, inner_corners="loop"):
print("unknown", c)
if done == False:
x0, y0 = x, y
-
+
if start and points_equal(start[1], start[2], x0, y0):
if bspline == False:
pl.text = "LineClosed"
@@ -947,7 +947,7 @@ def finish(self, inner_corners="loop"):
else:
hor = '0'
ver = 1 # vertical is always bottom, text is shifted in box class
-
+
pos = text.find('%')
offs = 0
if pos >- 1:
@@ -997,7 +997,7 @@ def finish(self, inner_corners="loop"):
num += 1
url = self.metadata["url"].replace("&render=1", "") # remove render argument to get web form again
-
+
pl = ET.SubElement(svg, "Notes", ShowOnLoad="1", Notes="File created by Boxes.py script, programmed by Florian Festi.\nLightburn output by Klaus Steinhammer.\n\nURL with settings:\n" + str(url))
pl.text = ""
pl.tail = "\n"
diff --git a/boxes/formats.py b/boxes/formats.py
index 4b4ef19d3..f7e67c3c0 100644
--- a/boxes/formats.py
+++ b/boxes/formats.py
@@ -14,13 +14,13 @@
# along with this program. If not, see .
+import io
import os
import shutil
import subprocess
-import io
import tempfile
-from boxes.drawing import SVGSurface, PSSurface, LBRN2Surface, Context
+from boxes.drawing import Context, LBRN2Surface, PSSurface, SVGSurface
class Formats:
diff --git a/boxes/gears.py b/boxes/gears.py
index 3761601e4..55c5f20ba 100644
--- a/boxes/gears.py
+++ b/boxes/gears.py
@@ -35,12 +35,13 @@
# AttributeError: 'module' object inkex has no attribute 'uutounit
# Fixed https://github.com/jnweiger/inkscape-gears-dev
-from math import pi, cos, sin, tan, radians, degrees, ceil, asin, acos, sqrt
+from math import acos, asin, ceil, cos, degrees, pi, radians, sin, sqrt, tan
from os import devnull # for debugging
two_pi = 2 * pi
import argparse
-from boxes.vectors import kerf, vdiff, vlength
+
+from boxes.vectors import vdiff, vlength
__version__ = '0.9'
@@ -99,7 +100,7 @@ def have_undercut(teeth, pitch_angle=20.0, k=1.0):
## gather all basic gear calculations in one place
def gear_calculations(num_teeth, circular_pitch, pressure_angle, clearance=0, ring_gear=False, profile_shift=0.):
""" Put base calcs for spur/ring gears in one place.
- - negative profile shifting helps against undercut.
+ - negative profile shifting helps against undercut.
"""
diametral_pitch = pi / circular_pitch
pitch_diameter = num_teeth / diametral_pitch
@@ -134,7 +135,7 @@ def generate_rack_points(tooth_count, pitch, addendum, pressure_angle,
- involute on a circle of infinite radius is a simple linear ramp
- - the meshing circle touches at y = 0,
+ - the meshing circle touches at y = 0,
- the highest elevation of the teeth is at y = +addendum
- the lowest elevation of the teeth is at y = -addendum-clearance
- the base_height extends downwards from the lowest elevation.
@@ -171,7 +172,7 @@ def generate_rack_points(tooth_count, pitch, addendum, pressure_angle,
points.append((x-tasc, base_top))
points.append((x+tas, -addendum))
points.append((x+spacing-tas, -addendum))
- points.append((x+spacing+tasc, base_top))
+ points.append((x+spacing+tasc, base_top))
x += pitch
# add base on RHS
@@ -215,7 +216,7 @@ def generate_spur_points(teeth, base_radius, pitch_radius, outer_radius, root_ra
pitch2 = c + half_thick_angle
base2 = pitch2 + pitch_to_base_angle
- offsetangles2 = [ base2 - x for x in angles]
+ offsetangles2 = [ base2 - x for x in angles]
points2 = [ point_on_circle( radii[i], offsetangles2[i]) for i in range(0,len(radii)) ]
points_on_outer_radius = [ point_on_circle(outer_radius, x) for x in linspace(offsetangles1[-1], offsetangles2[-1], accuracy_circular) ]
@@ -274,7 +275,7 @@ def __init__(self, boxes, **kw) -> None:
help="Number of teeth")
self.OptionParser.add_option("-s", "--system",
- action="store", type="string",
+ action="store", type="string",
dest="system", default='MM',
help="Select system: 'CP' (Cyclic Pitch (default)), 'DP' (Diametral Pitch), 'MM' (Metric Module)")
@@ -310,7 +311,7 @@ def __init__(self, boxes, **kw) -> None:
help="Clearance between bottom of gap of this gear and top of tooth of another")
self.OptionParser.add_option("", "--annotation",
- action="store", type="inkbool",
+ action="store", type="inkbool",
dest="annotation", default=False,
help="Draw annotation text")
@@ -350,7 +351,7 @@ def __init__(self, boxes, **kw) -> None:
help="Active tab. Not used now.")
self.OptionParser.add_option("-x", "--centercross",
- action="store", type="inkbool",
+ action="store", type="inkbool",
dest="centercross", default=False,
help="Draw cross in center")
@@ -360,7 +361,7 @@ def __init__(self, boxes, **kw) -> None:
help="Draw pitch circle (for mating)")
self.OptionParser.add_option("-r", "--draw-rack",
- action="store", type="inkbool",
+ action="store", type="inkbool",
dest="drawrack", default=False,
help="Draw rack gear instead of spur gear")
@@ -380,7 +381,7 @@ def __init__(self, boxes, **kw) -> None:
help="Length of tabs on ends of rack")
self.OptionParser.add_option("", "--undercut-alert",
- action="store", type="inkbool",
+ action="store", type="inkbool",
dest="undercut_alert", default=False,
help="Let the user confirm a warning dialog if undercut occurs. This dialog also shows helpful hints against undercut")
@@ -389,7 +390,7 @@ def calc_circular_pitch(self):
dimension = self.options.dimension
if self.options.system == 'CP': # circular pitch
circular_pitch = dimension * 25.4
- elif self.options.system == 'DP': # diametral pitch
+ elif self.options.system == 'DP': # diametral pitch
circular_pitch = pi * 25.4 / dimension
elif self.options.system == 'MM': # module (metric)
circular_pitch = pi * dimension
@@ -539,26 +540,26 @@ def gearCarrier(self, r, spoke_width, positions, mount_radius, mount_hole, circl
self.boxes.moveTo(r+0.5*spoke_width+self.boxes.burn, 0, 90)
self.boxes.corner(360, r+0.5*spoke_width)
-
+
self.boxes.ctx.restore()
self.boxes.move(width, width, move)
def __call__(self, teeth_only=False, move="", callback=None, **kw):
""" Calculate Gear factors from inputs.
- - Make list of radii, angles, and centers for each tooth and
+ - Make list of radii, angles, and centers for each tooth and
iterate through them
- Turn on other visual features e.g. cross, rack, annotations, etc
"""
self.options = self.OptionParser.parse_args([f"--{name}={value}" for name, value in kw.items()])
warnings = [] # list of extra messages to be shown in annotations
- # calculate unit factor for units defined in dialog.
+ # calculate unit factor for units defined in dialog.
unit_factor = 1
# User defined options
teeth = self.options.teeth
# Angle of tangent to tooth at circular pitch wrt radial line.
- angle = self.options.angle
- # Clearance: Radial distance between top of tooth on one gear to
+ angle = self.options.angle
+ # Clearance: Radial distance between top of tooth on one gear to
# bottom of gap on another.
clearance = self.options.clearance * unit_factor
mount_hole = self.options.mount_hole * unit_factor
@@ -575,7 +576,7 @@ def __call__(self, teeth_only=False, move="", callback=None, **kw):
accuracy_involute = 20 # Number of points of the involute curve
accuracy_circular = 9 # Number of points on circular parts
if self.options.accuracy is not None:
- if self.options.accuracy == 0:
+ if self.options.accuracy == 0:
# automatic
if teeth < 10: accuracy_involute = 20
elif teeth < 30: accuracy_involute = 12
@@ -706,4 +707,3 @@ def __call__(self, teeth_only=False, move="", callback=None, **kw):
if not teeth_only:
self.boxes.move(width, height, move)
-
diff --git a/boxes/generators/__init__.py b/boxes/generators/__init__.py
index 6e5602f68..89de2fd8a 100644
--- a/boxes/generators/__init__.py
+++ b/boxes/generators/__init__.py
@@ -2,8 +2,8 @@
import importlib
import inspect
-import pkgutil
import os
+import pkgutil
from types import ModuleType
from typing import Any
diff --git a/boxes/generators/_swtemplate.py b/boxes/generators/_swtemplate.py
index 7697c02e1..a185bfe26 100644
--- a/boxes/generators/_swtemplate.py
+++ b/boxes/generators/_swtemplate.py
@@ -17,6 +17,7 @@
from boxes import *
+
class SlatwallXXX(Boxes): # Change class name!
"""DESCRIPTION"""
diff --git a/boxes/generators/_template.py b/boxes/generators/_template.py
index 25d73712d..a99cb1907 100644
--- a/boxes/generators/_template.py
+++ b/boxes/generators/_template.py
@@ -15,6 +15,7 @@
from boxes import *
+
class BOX(Boxes): # Change class name!
"""DESCRIPTION"""
@@ -58,4 +59,3 @@ def render(self):
self.addPart(p)
# render your parts here
-
diff --git a/boxes/generators/abox.py b/boxes/generators/abox.py
index 19c2ded6f..4e32ea5ce 100644
--- a/boxes/generators/abox.py
+++ b/boxes/generators/abox.py
@@ -16,11 +16,12 @@
from boxes import *
from boxes.lids import LidSettings
+
class ABox(Boxes):
"""A simple Box"""
description = "This box is kept simple on purpose. If you need more features have a look at the UniversalBox."
-
+
ui_group = "Box"
def __init__(self) -> None:
@@ -58,5 +59,3 @@ def render(self):
ignore_widths=[1, 6], move="up")
self.rectangularWall(y, h, [b, "f", t4, "f"],
ignore_widths=[1, 6], move="up")
-
-
diff --git a/boxes/generators/agricolainsert.py b/boxes/generators/agricolainsert.py
index b8ac97464..3b1a8a63c 100644
--- a/boxes/generators/agricolainsert.py
+++ b/boxes/generators/agricolainsert.py
@@ -17,10 +17,8 @@
from functools import partial
from boxes import Boxes, edges
-from .dividertray import (
- SlotDescriptionsGenerator,
- DividerSlotsEdge,
-)
+
+from .dividertray import DividerSlotsEdge, SlotDescriptionsGenerator
class AgricolaInsert(Boxes):
diff --git a/boxes/generators/airpurifier.py b/boxes/generators/airpurifier.py
index 977ac1db4..c308c7b81 100644
--- a/boxes/generators/airpurifier.py
+++ b/boxes/generators/airpurifier.py
@@ -15,6 +15,7 @@
from boxes import *
+
class AirPurifier(Boxes):
"""Housing for the Nukit Open Air Purifier"""
@@ -31,13 +32,13 @@ class AirPurifier(Boxes):
120.: 105,
140.: 125,
}
-
+
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)
self.addSettingsArgs(edges.DoveTailSettings, size=2.0, depth=1)
-
+
self.buildArgParser(x=498., y=496.)
self.argparser.add_argument(
@@ -126,7 +127,7 @@ def render(self):
fh = self.filter_height
h = d + 2 + self.filters * (fh + t)
-
+
self.rectangularWall(x, d, "ffff", callback=[
self.fanCB(self.fans_top, d, x, False)], label="top", move="up")
self.rectangularWall(x, h, "ffff", callback=[
diff --git a/boxes/generators/alledges.py b/boxes/generators/alledges.py
index ea7924357..6f31f9225 100644
--- a/boxes/generators/alledges.py
+++ b/boxes/generators/alledges.py
@@ -15,6 +15,7 @@
from boxes import *
+
class AllEdges(Boxes):
"""Showing all edge types"""
@@ -42,7 +43,7 @@ def render(self):
chars.reverse()
self.moveTo(0, 10*t)
-
+
for c in chars:
with self.saved_context():
self.move(0, 0, "", True)
@@ -57,4 +58,3 @@ def render(self):
self.moveTo(0, 3*t + self.edges[c].spacing())
self.text(f"{c} - {self.edges[c].description}")
self.moveTo(0, 12*t)
-
diff --git a/boxes/generators/angledbox.py b/boxes/generators/angledbox.py
index 68a54b03c..35e86f2b0 100644
--- a/boxes/generators/angledbox.py
+++ b/boxes/generators/angledbox.py
@@ -36,17 +36,17 @@ def __init__(self) -> None:
def floor(self, x, y, n, edge='e', hole=None, move=None, callback=None, label=""):
r, h, side = self.regularPolygon(2*n+2, h=y/2.0)
t = self.thickness
-
+
if n % 2:
lx = x - 2 * h + side
else:
lx = x - 2 * r + side
-
+
edge = self.edges.get(edge, edge)
tx = x + 2 * edge.spacing()
ty = y + 2 * edge.spacing()
-
+
if self.move(tx, ty, move, before=True):
return
@@ -57,7 +57,7 @@ def floor(self, x, y, n, edge='e', hole=None, move=None, callback=None, label=""
hr, hh, hside = self.regularPolygon(2*n+2, h=y/2.0-t)
dx = side - hside
hlx = lx - dx
-
+
self.moveTo(dx/2.0, t+edge.spacing())
for i, l in enumerate(([hlx] + ([hside] * n))* 2):
self.edge(l)
@@ -94,12 +94,12 @@ def render(self):
t = self.thickness
r, hp, side = self.regularPolygon(2*n+2, h=y/2.0)
-
+
if n % 2:
lx = x - 2 * hp + side
else:
lx = x - 2 * r + side
-
+
fingerJointSettings = copy.deepcopy(self.edges["f"].settings)
fingerJointSettings.setValues(self.thickness, angle=360./(2 * (n+1)))
fingerJointSettings.edgeObjects(self, chars="gGH")
@@ -139,7 +139,3 @@ def render(self):
self.rectangularWall(side, h, move="right",
edges=b+"gfg" if fingers else b+"geg",
label=f"wall {cnt}")
-
-
-
-
diff --git a/boxes/generators/angledcutjig.py b/boxes/generators/angledcutjig.py
index 820453440..08e5ebf4e 100644
--- a/boxes/generators/angledcutjig.py
+++ b/boxes/generators/angledcutjig.py
@@ -15,6 +15,7 @@
from boxes import *
+
class AngledCutJig(Boxes): # Change class name!
"""Jig for making angled cuts in a laser cutter"""
@@ -58,7 +59,6 @@ def render(self):
lambda:self.fingerHolesAt(0, 4.5*t, l2, 0), None,
lambda:self.fingerHolesAt(0, 4.5*t, l2, 0), None],
move="right")
-
+
self.rectangularTriangle(x, th, "fef", num=2, move="up")
self.rectangularTriangle(20, th2, "fef", num=2, move="up")
-
diff --git a/boxes/generators/arcade.py b/boxes/generators/arcade.py
index 390f58fc7..37c6008e7 100644
--- a/boxes/generators/arcade.py
+++ b/boxes/generators/arcade.py
@@ -15,9 +15,10 @@
from boxes import *
+
class Arcade(Boxes):
"""Desktop Arcade Machine"""
-
+
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)
@@ -42,18 +43,18 @@ def side(self, move=None):
tw, th = y+2*r+(self.front+t) * math.sin(math.radians(15)), h+2*r+(self.topback+t)/2**0.5
if self.move(tw, th, move, True):
return
-
+
self.moveTo(r+(self.front+t) * math.sin(math.radians(15)), 0)
with self.saved_context():
self.moveTo(0, r)
self.polyline(y, 90, h, 45, self.topback+t, 90, self.top+2*t, 90, 100, -90, self.monitor_height, -30, self.keyboard_depth+2*t, 90, self.front+t, 75)
-
+
self.fingerHolesAt(10, r+t/2, self.bottom, 0)
self.polyline(y, (90, r))
self.fingerHolesAt(0.5*t, r+t/2, self.back, 0)
self.fingerHolesAt(h-40-40, r+t/2, self.back, 0)
-
+
self.polyline(h, (45, r))
self.fingerHolesAt(0, r+t/2, self.topback, 0)
self.fingerHolesAt(self.topback+t/2, r+t, self.top, 90)
@@ -65,7 +66,7 @@ def side(self, move=None):
self.polyline(self.keyboard_depth-d_30+2*t, (90, r), self.front+t, (75, r))
self.move(tw, th, move)
-
+
def keyboard(self):
# Add holes for the joystick and buttons here
pass
@@ -73,7 +74,7 @@ def keyboard(self):
def speakers(self):
self.hole(self.width/4., 50, 40)
self.hole(self.width*3/4., 50, 40)
-
+
def render(self):
width = self.width
t = self.thickness
@@ -91,7 +92,7 @@ def render(self):
h = self.h = ((self.monitor_height-self.topback+self.top+1*t+100) / 2**0.5 +
+ (self.keyboard_depth+2*t)*math.sin(math.radians(15))
+ (self.front+t) * math.cos(math.radians(15)))
-
+
self.bottom = y-40-0.5*t
self.backwall = h-40
@@ -113,5 +114,3 @@ def render(self):
# Sides
self.side(move="up")
self.side(move="up")
-
-
diff --git a/boxes/generators/atreus21.py b/boxes/generators/atreus21.py
index cc2ccc887..eee3b5af4 100644
--- a/boxes/generators/atreus21.py
+++ b/boxes/generators/atreus21.py
@@ -1,6 +1,7 @@
"""Generator for a split atreus keyboard."""
from boxes import Boxes, restore
+
from .keyboard import Keyboard
diff --git a/boxes/generators/basedbox.py b/boxes/generators/basedbox.py
index 062f61223..065a5f730 100644
--- a/boxes/generators/basedbox.py
+++ b/boxes/generators/basedbox.py
@@ -25,7 +25,7 @@ class BasedBox(Boxes):
Use a vector graphics program (like Inkscape) to add holes or adjust the base
plate. The width of the "brim" can also be adjusted with the **edge_width**
parameter in the **Finger Joints Settings**.
-
+
See ClosedBox for variant without a base.
"""
@@ -52,6 +52,3 @@ def render(self):
self.rectangularWall(x, y, "ffff", move="right", label="Top")
self.rectangularWall(x, y, "hhhh", label="Base")
-
-
-
diff --git a/boxes/generators/bayonetbox.py b/boxes/generators/bayonetbox.py
index 959072c0f..136178e69 100644
--- a/boxes/generators/bayonetbox.py
+++ b/boxes/generators/bayonetbox.py
@@ -15,6 +15,7 @@
from boxes import *
+
class BayonetBox(Boxes):
"""Round box made from layers with twist on top"""
@@ -23,7 +24,7 @@ class BayonetBox(Boxes):
def __init__(self) -> None:
Boxes.__init__(self)
-
+
self.argparser.add_argument(
"--diameter", action="store", type=float, default=50.,
help="Diameter of the box in mm")
@@ -64,7 +65,7 @@ def lowerLayer(self, asPart=False, move=None):
if self.move(d, d, move, True):
return
self.moveTo(d/2, d/2)
-
+
self.alignmentHoles(inner=True)
self.hole(0, 0, r=d/2 - 2.5*t)
self.moveTo(d/2 - 1.5*t, 0, -90)
@@ -101,14 +102,14 @@ def upperCB(self):
l = self.lugs
a = 180 / l
-
+
self.hole(0, 0, r=d/2 - 2.5*t)
self.hole(0, 0, r=d/2 - 1.5*t)
self.alignmentHoles(inner=True, outer=True)
self.moveTo(d/2 - 1.5*t, 0, -90)
for i in range(l):
- self.polyline(0, (-1.3*a, r-1.5*t+p), 0, 90, 0.5*t, -90, 0, (-0.7*a, r-t+p), 0, -90, 0.5*t, 90)
+ self.polyline(0, (-1.3*a, r-1.5*t+p), 0, 90, 0.5*t, -90, 0, (-0.7*a, r-t+p), 0, -90, 0.5*t, 90)
def render(self):
@@ -118,8 +119,8 @@ def render(self):
if not self.outside:
self.diameter = d = d - 3*t
-
-
+
+
self.parts.disc(d, callback=lambda: self.alignmentHoles(outer=True), move="right")
self.parts.disc(d, callback=lambda: (self.alignmentHoles(outer=True), self.hole(0, 0, d/2-1.5*t)), move="right")
self.parts.disc(d, callback=self.lowerCB, move="right")
diff --git a/boxes/generators/bintray.py b/boxes/generators/bintray.py
index f0dd35f18..f872be306 100644
--- a/boxes/generators/bintray.py
+++ b/boxes/generators/bintray.py
@@ -25,7 +25,7 @@ def __call__(self, length, **kw):
self.corner(-a1)
for i, l in enumerate(self.settings.sy):
self.edges["e"](l* (f**2+(1-f)**2)**0.5)
- self.corner(a2)
+ self.corner(a2)
self.edges["f"](l*f*2**0.5)
if i < len(self.settings.sy)-1:
if self.char == "B":
@@ -72,7 +72,7 @@ def ySlots(self):
for x in self.sx:
self.fingerHolesAt(posy, posx, x)
posx += x + self.thickness
-
+
def addMount(self):
ds = self.hole_dD[0]
@@ -95,7 +95,7 @@ def xHoles(self):
for x in self.sx[:-1]:
posx += x + self.thickness
self.fingerHolesAt(posx, 0, self.hi)
-
+
def frontHoles(self, i):
def CB():
posx = -0.5 * self.thickness
@@ -118,7 +118,7 @@ def render(self):
x = sum(self.sx) + self.thickness * (len(self.sx) - 1)
y = sum(self.sy) + self.thickness * (len(self.sy) - 1)
-
+
h = self.h
hi = self.hi = h
t = self.thickness
diff --git a/boxes/generators/birdhouse.py b/boxes/generators/birdhouse.py
index 574068962..e3638224d 100644
--- a/boxes/generators/birdhouse.py
+++ b/boxes/generators/birdhouse.py
@@ -15,6 +15,7 @@
from boxes import *
+
class BirdHouse(Boxes):
"""Simple Bird House"""
@@ -48,8 +49,8 @@ def side(self, x, h, edges="hfeffef", callback=None, move=None):
for i in range(7):
self.cc(callback, i, y=self.burn+edges[i].startwidth())
edges[i](lengths[i])
- self.edgeCorner(edges[i], edges[i+1], angles[i])
-
+ self.edgeCorner(edges[i], edges[i+1], angles[i])
+
self.move(tw, th, move)
def roof(self, x, h, overhang, edges="eefe", move=None):
@@ -86,10 +87,10 @@ def render(self):
roof = 2**0.5 * x / 2
overhang = roof * self.roof_overhang
-
+
cbx = [lambda: self.side_hole(x)]
cby = [lambda: self.side_hole(y)]
-
+
self.side(x, h, callback=cbx, move="right")
self.side(x, h, callback=cbx, move="right")
self.rectangularWall(y, h, "hFeF", callback=cby, move="right")
diff --git a/boxes/generators/bottlestack.py b/boxes/generators/bottlestack.py
index 7bb1047e8..fb96e6f93 100644
--- a/boxes/generators/bottlestack.py
+++ b/boxes/generators/bottlestack.py
@@ -15,6 +15,7 @@
from boxes import *
+
class BottleStack(Boxes):
"""Stack bottles in a fridge"""
@@ -27,7 +28,7 @@ class BottleStack(Boxes):
def __init__(self) -> None:
Boxes.__init__(self)
-
+
self.argparser.add_argument(
"--diameter", action="store", type=float, default=80,
help="diameter of the bottles in mm")
@@ -40,7 +41,7 @@ def __init__(self) -> None:
self.argparser.add_argument(
"--double", action="store", type=boolarg, default=True,
help="two pieces that can be combined to up to double the width")
-
+
def front(self, h_sides, offset=0, move=None):
@@ -57,10 +58,10 @@ def front(self, h_sides, offset=0, move=None):
h_extra = 1*t
h_s = h_sides - t
p = 0.05*t # play
-
+
tw, th = nr * r1 * 2 + 2*r3, h + 2*t
-
+
if self.move(tw, th, move, True):
return
@@ -115,26 +116,26 @@ def front(self, h_sides, offset=0, move=None):
if open_sides:
h_extra -= h_s
-
+
self.polyline(0, 90, h_extra+h-r3, (90, r3))
for i in range(nr):
self.polyline(0, (a, r2), 0, (-2*a, r1), 0, (a, r2))
self.polyline(0, (90, r3), h_extra+h-r3, 90)
-
+
self.move(tw, th, move)
def side(self, l, h, short=False, move=None):
t = self.thickness
short = bool(short)
-
+
tw, th = l + 2*t - 4*t*short, h
if self.move(tw, th, move, True):
return
self.moveTo(t, 0)
-
+
self.polyline(l-3*t*short)
if short:
end = [90, h-t, 90, t, -90, t, 90]
@@ -152,7 +153,7 @@ def render(self):
nr = self.number
h_sides = 2*t
pieces = 2 if self.double else 1
-
+
for offset in range(pieces):
self.front(h_sides, offset, move="up")
self.front(h_sides, offset, move="up")
@@ -160,5 +161,3 @@ def render(self):
for short in range(pieces):
for i in range(nr+1):
self.side(d, h_sides, short, move="up")
-
-
diff --git a/boxes/generators/bottletag.py b/boxes/generators/bottletag.py
index e8ab2c2dd..5d6a70411 100644
--- a/boxes/generators/bottletag.py
+++ b/boxes/generators/bottletag.py
@@ -85,4 +85,3 @@ def render(self):
with self.saved_context():
self.moveTo(0, 0, -90)
self.edge(0.5)
-
diff --git a/boxes/generators/breadbox.py b/boxes/generators/breadbox.py
index 40ba35cb7..492f02c72 100644
--- a/boxes/generators/breadbox.py
+++ b/boxes/generators/breadbox.py
@@ -15,6 +15,7 @@
from boxes import *
+
class BreadBox(Boxes):
"""A BreadBox with a gliding door"""
@@ -25,7 +26,7 @@ class BreadBox(Boxes):
def side(self, l, h, r, move=None):
t = self.thickness
-
+
if self.move(l+2*t, h+2*t, move, True):
return
@@ -51,7 +52,7 @@ def side(self, l, h, r, move=None):
self.edges["f"](l/2)
self.polyline(0, 90)
self.edges["f"](h)
-
+
self.move(l+2*t, h+2*t, move)
def cornerRadius(self, r, two=False, move=None):
@@ -79,7 +80,7 @@ def rails(self, l, h, r, move=None):
self.polyline(l/2-r, (90, r-1.5*t), h-r, 90, t, 90, h-r, (-90, r-2.5*t), l/2-r, 90, t, 90)
self.moveTo(-t-s, t+s)
self.polyline(l/2-r, (90, r-1.5*t), h-r, 90, t, 90, h-r, (-90, r-2.5*t), l/2-r, 90, t, 90)
-
+
self.move(tw, th, move)
def door(self, l, h, move=None):
@@ -106,7 +107,7 @@ def __init__(self) -> None:
def render(self):
x, y, h, r = self.x, self.y, self.h, self.radius
self.n = n = 3
-
+
if not r:
self.radius = r = h / 2
self.radius = r = min(r, h/2)
@@ -122,11 +123,11 @@ def render(self):
self.rectangularWall(x, y, "FEFF", move="right")
self.rectangularWall(x/2, y, "FeFF", move="right")
-
+
self.door(x/2 + h - 2*r + 0.5*math.pi*r + 2*t, y-0.2*t, move="right")
self.rectangularWall(2*t, y-2.2*t, edges="eeef", move="right")
-
+
a = 90. / n
ls = 2*math.sin(math.radians(a/2)) * (r-2.5*t)
@@ -136,9 +137,9 @@ def render(self):
self.rectangularWall(h-r, y, "fbfe", move="right")
-
+
self.rectangularWall(ls, y, "fafB", move="right")
-
+
for i in range(n-2):
self.rectangularWall(ls, y, "fafA", move="right")
diff --git a/boxes/generators/burntest.py b/boxes/generators/burntest.py
index 539dd815d..7180feefc 100644
--- a/boxes/generators/burntest.py
+++ b/boxes/generators/burntest.py
@@ -15,6 +15,7 @@
from boxes import *
+
class BurnTest(Boxes):
"""Test different burn values"""
description = """This generator will make shapes that you can use to select
@@ -49,19 +50,19 @@ def __init__(self) -> None:
def render(self):
x, s = self.x, self.step
t = self.thickness
-
+
fsize = 12.5 * self.x / 100 if self.x < 81 else 10
self.moveTo(t, t)
for cnt in range(self.pairs):
-
+
for i in range(4):
self.text("%.3fmm" % self.burn, x/2, t, fontsize = fsize, align="center", color=Color.ETCHING)
self.edges["f"](x)
self.corner(90)
self.burn += s
-
+
self.burn -= 4*s
self.moveTo(x+2*t+self.spacing, -t)
diff --git a/boxes/generators/can_storage.py b/boxes/generators/can_storage.py
index 28e771956..1c32e1717 100644
--- a/boxes/generators/can_storage.py
+++ b/boxes/generators/can_storage.py
@@ -23,7 +23,7 @@ def __call__(self, length, **kw):
x = math.ceil( ((self.canDiameter * 0.5 + 2 * self.thickness) * math.sin(math.radians(self.chuteAngle))) / self.thickness)
if self.top_edge != "e":
self.corner(90, self.thickness)
- self.edge(0.5 * self.canDiameter)
+ self.edge(0.5 * self.canDiameter)
self.corner(-90, 0.25 * self.canDiameter)
else:
self.moveTo(-self.burn, self.canDiameter + self.thickness, -90)
@@ -87,7 +87,7 @@ class CanStorage(Boxes):
ui_group = "Misc"
-
+
def __init__(self) -> None:
Boxes.__init__(self)
@@ -117,7 +117,7 @@ def __init__(self) -> None:
self.argparser.add_argument(
"--chuteAngle", action="store", type=float, default=5.0,
help="slope angle of the chutes")
-
+
def DrawPusher(self, dbg = False):
with self.saved_context():
if dbg == False:
@@ -131,9 +131,9 @@ def DrawPusher(self, dbg = False):
self.edge(self.thickness)
self.corner(-90)
self.edge(0.25*self.pusherA)
-
+
self.corner(90-self.chuteAngle)
-
+
self.edge(0.25*self.pusherB)
self.corner(-90)
self.edge(self.thickness)
@@ -146,54 +146,54 @@ def DrawPusher(self, dbg = False):
self.corner(90+self.pusherAngle+self.chuteAngle)
self.edge(self.pusherC)
-
+
def cb_top_chute(self, nr):
if nr == 0:
# fill with holes
border = [
- (0, 0),
- (self.top_chute_depth, 0),
- (self.top_chute_depth, 0.2 * self.width - self.thickness),
- (self.top_chute_depth - self.thickness, 0.2 * self.width),
- (self.top_chute_depth - 1.5*self.canDiameter, 0.2 * self.width),
- (self.top_chute_depth - 1.5*self.canDiameter, 0.8 * self.width),
- (self.top_chute_depth - self.thickness, 0.8 * self.width),
- (self.top_chute_depth, 0.8 * self.width + self.thickness),
- (self.top_chute_depth, self.width),
- (0, self.width),
+ (0, 0),
+ (self.top_chute_depth, 0),
+ (self.top_chute_depth, 0.2 * self.width - self.thickness),
+ (self.top_chute_depth - self.thickness, 0.2 * self.width),
+ (self.top_chute_depth - 1.5*self.canDiameter, 0.2 * self.width),
+ (self.top_chute_depth - 1.5*self.canDiameter, 0.8 * self.width),
+ (self.top_chute_depth - self.thickness, 0.8 * self.width),
+ (self.top_chute_depth, 0.8 * self.width + self.thickness),
+ (self.top_chute_depth, self.width),
+ (0, self.width),
]
if self.fillHoles_fill_pattern != "no fill":
self.fillHoles(
- pattern="hbar",
+ pattern="hbar",
border=border,
max_radius = min(2*self.thickness, self.fillHoles_hole_max_radius) if self.fillHoles_fill_pattern in ["hbar", "vbar"] else min(2*self.thickness, self.width/30),
hspace=min(2*self.thickness, self.fillHoles_space_between_holes) if self.fillHoles_fill_pattern in ["hbar", "vbar"] else min(2*self.thickness, self.width/20),
bspace=min(2*self.thickness, self.fillHoles_space_to_border) if self.fillHoles_fill_pattern in ["hbar", "vbar"] else min(2*self.thickness, self.width/20),
bar_length=self.fillHoles_bar_length,
max_random=self.fillHoles_max_random,
- )
-
+ )
+
def cb_top(self, nr):
if nr == 0:
# fill with holes
border = [
- (0, 0),
- (self.depth, 0),
- (self.depth, self.width),
- (0, self.width),
+ (0, 0),
+ (self.depth, 0),
+ (self.depth, self.width),
+ (0, self.width),
]
if self.fillHoles_fill_pattern != "no fill":
self.fillHoles(
- pattern="hbar",
+ pattern="hbar",
border=border,
max_radius = min(2*self.thickness, self.fillHoles_hole_max_radius) if self.fillHoles_fill_pattern in ["hbar", "vbar"] else min(2*self.thickness, self.width/30),
hspace=min(2*self.thickness, self.fillHoles_space_between_holes) if self.fillHoles_fill_pattern in ["hbar", "vbar"] else min(2*self.thickness, self.width/20),
bspace=min(2*self.thickness, self.fillHoles_space_to_border) if self.fillHoles_fill_pattern in ["hbar", "vbar"] else min(2*self.thickness, self.width/20),
bar_length=self.fillHoles_bar_length,
max_random=self.fillHoles_max_random,
- )
+ )
def cb_bottom_chute(self, nr):
if nr == 1:
@@ -201,7 +201,7 @@ def cb_bottom_chute(self, nr):
self.rectangularHole(self.width*0.85-0.5*self.thickness, 0.25*self.pusherA, self.thickness, 0.5*self.pusherA, center_x=False, center_y=False)
self.rectangularHole(self.width*0.5 -0.5*self.thickness, 0.25*self.pusherA, self.thickness, 0.5*self.pusherA, center_x=False, center_y=False)
self.rectangularHole(self.width*0.15-0.5*self.thickness, 0.25*self.pusherA, self.thickness, 0.5*self.pusherA, center_x=False, center_y=False)
-
+
def cb_back(self, nr):
if nr == 1:
@@ -210,7 +210,7 @@ def cb_back(self, nr):
self.rectangularHole(self.width*0.5 -0.5*self.thickness, self.thickness + self.depth * math.tan(math.radians(self.chuteAngle)) + 0.25*self.pusherB, self.thickness, 0.5*self.pusherB + self.thickness, center_x=False, center_y=False)
self.rectangularHole(self.width*0.15-0.5*self.thickness, self.thickness + self.depth * math.tan(math.radians(self.chuteAngle)) + 0.25*self.pusherB, self.thickness, 0.5*self.pusherB + self.thickness, center_x=False, center_y=False)
-
+
def cb_sides(self, nr):
if nr == 0:
# for debugging only
@@ -237,7 +237,7 @@ def cb_sides(self, nr):
self.moveTo(self.depth-self.pusherA, self.thickness + (self.depth-self.pusherA) * math.tan(math.radians(self.chuteAngle)))
self.moveTo(0,0,self.chuteAngle)
self.DrawPusher(True)
-
+
with self.saved_context():
# draw cans, top row
self.moveTo(0, self.thickness + self.canDiameter + self.bottom_chute_height + self.top_chute_height + 0.5 * self.thickness, -self.chuteAngle)
@@ -263,47 +263,47 @@ def cb_sides(self, nr):
self.fingerHolesAt(0, 0, self.barrier_height, 0)
# fill with holes
border = [
- (2*self.thickness, 0.5*self.thickness + 2*self.thickness * math.tan(math.radians(self.chuteAngle)) + 0.5*self.thickness/math.cos(math.radians(self.chuteAngle))),
- (self.depth, self.thickness + self.depth * math.tan(math.radians(self.chuteAngle))),
- (self.depth, self.height),
+ (2*self.thickness, 0.5*self.thickness + 2*self.thickness * math.tan(math.radians(self.chuteAngle)) + 0.5*self.thickness/math.cos(math.radians(self.chuteAngle))),
+ (self.depth, self.thickness + self.depth * math.tan(math.radians(self.chuteAngle))),
+ (self.depth, self.height),
(self.thickness + 0.75 * self.canDiameter, self.height),
(self.thickness + 0.75 * self.canDiameter, 0.5*self.thickness + self.canDiameter + self.bottom_chute_height + self.top_chute_height + self.thickness - (self.thickness + 0.75 * self.canDiameter) * math.tan(math.radians(self.chuteAngle)) + 0.5*self.thickness/math.cos(math.radians(self.chuteAngle))),
(self.top_chute_depth * math.cos(math.radians(self.chuteAngle)), self.thickness + self.canDiameter + self.bottom_chute_height + self.top_chute_height + self.thickness - (self.top_chute_depth) * math.sin(math.radians(self.chuteAngle))),
(self.top_chute_depth * math.cos(math.radians(self.chuteAngle)), self.thickness + self.canDiameter + self.bottom_chute_height + self.top_chute_height - (self.top_chute_depth) * math.sin(math.radians(self.chuteAngle))),
(self.thickness + 0.75 * self.canDiameter, 1.5*self.thickness + self.canDiameter + self.bottom_chute_height + self.top_chute_height - (self.thickness + 0.75 * self.canDiameter) * math.tan(math.radians(self.chuteAngle)) - 0.5*self.thickness/math.cos(math.radians(self.chuteAngle))),
(self.thickness + 0.75 * self.canDiameter, 2*self.thickness + self.barrier_height ),
- (2*self.thickness, 2*self.thickness + self.barrier_height),
+ (2*self.thickness, 2*self.thickness + self.barrier_height),
]
self.fillHoles(
- pattern=self.fillHoles_fill_pattern,
- border=border,
- max_radius=self.fillHoles_hole_max_radius,
- hspace=self.fillHoles_space_between_holes,
- bspace=self.fillHoles_space_to_border,
- min_radius=self.fillHoles_hole_min_radius,
+ pattern=self.fillHoles_fill_pattern,
+ border=border,
+ max_radius=self.fillHoles_hole_max_radius,
+ hspace=self.fillHoles_space_between_holes,
+ bspace=self.fillHoles_space_to_border,
+ min_radius=self.fillHoles_hole_min_radius,
style=self.fillHoles_hole_style,
bar_length=self.fillHoles_bar_length,
max_random=self.fillHoles_max_random,
)
-
+
def render(self):
self.chuteAngle = self.chuteAngle
-
+
self.pusherAngle = 30 # angle of pusher
self.pusherA = 0.75 * self.canDiameter # length of pusher
self.pusherB = self.pusherA / math.sin(math.radians(180 - (90+self.chuteAngle) - self.pusherAngle)) * math.sin(math.radians(self.pusherAngle))
self.pusherC = self.pusherA / math.sin(math.radians(180 - (90+self.chuteAngle) - self.pusherAngle)) * math.sin(math.radians(90+self.chuteAngle))
-
+
self.addPart(FrontEdge(self, self))
self.addPart(TopChuteEdge(self, self))
self.addPart(BarrierEdge(self, self))
-
+
if self.canDiameter < 8 * self.thickness:
self.edges["f"].settings.setValues(self.thickness, True, finger=1.0)
self.edges["f"].settings.setValues(self.thickness, True, space=1.0)
self.edges["f"].settings.setValues(self.thickness, True, surroundingspaces=0.0)
-
+
if self.canDiameter < 4 * self.thickness:
raise ValueError("Can diameter has to be at least 4 times the material thickness!")
@@ -316,28 +316,28 @@ def render(self):
self.bottom_chute_height = max((self.depth - 1.1 * self.canDiameter) * math.sin(math.radians(self.chuteAngle)), 0.1 * self.canDiameter)
self.bottom_chute_depth = self.depth / math.cos(math.radians(self.chuteAngle))
self.barrier_height = 0.25 * self.canDiameter
-
+
if (self.top_chute_depth + self.bottom_chute_height - self.thickness) < (self.barrier_height + self.canDiameter * 0.1):
self.bottom_chute_height = self.barrier_height + self.canDiameter * 0.1 + self.thickness - self.top_chute_depth
-
+
self.height = self.thickness + self.canDiameter + self.bottom_chute_height + self.top_chute_height + 0.5 * self.thickness + self.canDiameter + 1.5 * self.thickness # measurements from bottom to top
self.width = 0.01 * self.canHeight + self.canHeight + 0.01 * self.canHeight
edgs = self.bottom_edge + "h" + self.top_edge + "a"
-
+
# render your parts here
self.rectangularWall(self.depth, self.height, edges=edgs, callback=self.cb_sides, move="up", label="right")
self.rectangularWall(self.depth, self.height, edges=edgs, callback=self.cb_sides, move="up mirror", label="left")
-
+
self.rectangularWall(self.bottom_chute_depth, self.width, "fefe", callback=self.cb_bottom_chute, move="up", label="bottom chute")
self.rectangularWall(self.top_chute_depth, self.width, "fbfe", callback=self.cb_top_chute, move="up", label="top chute")
self.rectangularWall(self.barrier_height, self.width, "fAfe", move="right", label="barrier")
self.rectangularWall(self.height, self.width, "fefe", callback=self.cb_back, move="up", label="back")
self.rectangularWall(self.barrier_height, self.width, "fefe", move="left only", label="invisible")
-
+
if self.top_edge != "e":
self.rectangularWall(self.depth, self.width, "fefe", callback=self.cb_top, move="up", label="top")
-
+
pusherH = self.pusherB * math.cos(math.radians(self.chuteAngle)) + self.thickness
pusherV = self.pusherC * math.cos(math.radians(self.chuteAngle)) + self.thickness
@@ -361,4 +361,3 @@ def render(self):
self.rectangularWall(self.edges["š"].settings.width+5*self.thickness, self.edges["š"].settings.height-4*self.burn, "eeee", move="right", label="Stabilizer 3")
self.rectangularWall(self.edges["š"].settings.width+5*self.thickness, self.edges["š"].settings.height-4*self.burn, "eeee", move="right", label="Stabilizer 4")
self.text("Glue a stabilizer on the inside of each bottom\nside stacking foot for lateral stabilization.",3 ,0 , fontsize=4, color=Color.ANNOTATIONS)
-
diff --git a/boxes/generators/carbonfilter.py b/boxes/generators/carbonfilter.py
index 5d7599ed7..ebf2c8cb6 100644
--- a/boxes/generators/carbonfilter.py
+++ b/boxes/generators/carbonfilter.py
@@ -15,6 +15,7 @@
from boxes import *
+
class CarbonFilter(Boxes):
"""Compact filter for activated char coal pellets"""
@@ -63,15 +64,15 @@ def sideCB(self):
self.fingerHolesAt(t/2, h, 50, -90)
self.fingerHolesAt(x-t/2, h, 50, -90)
-
+
for i in range(p):
self.fingerHolesAt(posx + t/2, h, 50, -90+a)
self.fingerHolesAt(posx + 40 + t/2, h, 50, -90+a)
- self.fingerHolesAt(posx + w - t/2, h, 50, -90-a)
+ self.fingerHolesAt(posx + w - t/2, h, 50, -90-a)
self.fingerHolesAt(posx + w - 40 - t/2, h, 50, -90-a)
self.fingerHolesAt(posx + w/2 -50 + t, 3.5*t, 100 - 2*t, 0)
-
+
posx += w
def bottomCB(self):
@@ -87,7 +88,7 @@ def topRailCB(self):
for i in range(self.ribs):
self.fingerHolesAt((i+1) * self.y / (self.ribs + 1) - 1.5 * t,
0, 30, 90)
-
+
def innerRibs(self, n, move=None):
x, y, h = self.x, self.y, self.h
@@ -102,7 +103,7 @@ def innerRibs(self, n, move=None):
if self.move(tw, th, move, True):
return
-
+
self.moveTo(0, t)
for i in range(n):
@@ -114,7 +115,7 @@ def innerRibs(self, n, move=None):
self.moveTo(20 + self.spacing)
self.ctx.stroke()
-
+
self.move(tw, th, move, label="Inner ribs")
def sideHolders(self, n, move=None):
@@ -181,7 +182,7 @@ def outerRibs(self, n, n_edge, move=None):
return
self.moveTo(2*t)
-
+
for i in range(n):
self.polyline(0*t + 20, (90, 2*t), 2*t, -a)
if i < n_edge:
@@ -201,15 +202,15 @@ def outerRibs(self, n, n_edge, move=None):
self.ctx.stroke()
self.move(tw, th, move, label="Outer ribs")
-
+
def render(self):
# adjust to the variables you want in the local scope
x, y, h = self.x, self.y, self.h
self.y = y = self.adjustSize(y)
-
+
t = self.thickness
-
+
self.w = (x - 2*t) / self.pockets
self.a = math.degrees(math.atan((self.w - 100) / 2 / (h - 4*t)))
diff --git a/boxes/generators/cardbox.py b/boxes/generators/cardbox.py
index 17ab99d0d..a9cef505f 100644
--- a/boxes/generators/cardbox.py
+++ b/boxes/generators/cardbox.py
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
-from boxes import edges, Boxes, BoolArg
+from boxes import BoolArg, Boxes, edges
class InsetEdgeSettings(edges.Settings):
diff --git a/boxes/generators/castle.py b/boxes/generators/castle.py
index 52f0c6def..61d40db5e 100644
--- a/boxes/generators/castle.py
+++ b/boxes/generators/castle.py
@@ -42,6 +42,3 @@ def render(self, t_x=70, t_h=250, w1_x=300, w1_h=120, w2_x=100, w2_h=120):
self.rectangularWall(w1_x, w1_h, "efpe", move="right")
self.rectangularWall(w2_x, w2_h, "efpe", move="right")
-
-
-
diff --git a/boxes/generators/closedbox.py b/boxes/generators/closedbox.py
index 49c857441..95dd6bcd2 100644
--- a/boxes/generators/closedbox.py
+++ b/boxes/generators/closedbox.py
@@ -55,6 +55,3 @@ def render(self):
self.rectangularWall(x, y, "ffff", bedBolts=[d2, d3, d2, d3], move="right", label="Top")
self.rectangularWall(x, y, "ffff", bedBolts=[d2, d3, d2, d3], label="Bottom")
-
-
-
diff --git a/boxes/generators/coindisplay.py b/boxes/generators/coindisplay.py
index d4da26a9b..b98190d7f 100644
--- a/boxes/generators/coindisplay.py
+++ b/boxes/generators/coindisplay.py
@@ -15,6 +15,7 @@
from boxes import *
+
class CoinHolderSideEdge(edges.BaseEdge):
char = "B"
def __call__(self, length, **kw):
@@ -111,4 +112,3 @@ def render(self):
self.rectangularWall(self.coin_plate, self.coin_plate, "efef", move="down", label="Coin Plate", callback=[self.coinCutout])
self.rectangularWall(self.coin_plate, self.coin_showcase_h, "fFeF", move="down", label="CoinSide3")
-
diff --git a/boxes/generators/concaveknob.py b/boxes/generators/concaveknob.py
index ca4bf8ca2..19cbe8d93 100644
--- a/boxes/generators/concaveknob.py
+++ b/boxes/generators/concaveknob.py
@@ -15,9 +15,10 @@
from boxes import *
+
class ConcaveKnob(Boxes):
"""Round knob serrated outside for better gripping"""
-
+
ui_group = "Part"
def __init__(self) -> None:
@@ -35,7 +36,7 @@ def __init__(self) -> None:
help="Amount of circumference used for non convex parts")
self.argparser.add_argument(
"--angle", action="store", type=float, default=70.,
- help="Angle between convex and concave parts")
+ help="Angle between convex and concave parts")
self.argparser.add_argument(
"--bolthole", action="store", type=float, default=6.,
help="Diameter of the bolt hole (mm)")
@@ -60,5 +61,3 @@ def render(self):
move="right")
self.parts.concaveKnob(self.diameter, self.serrations,
self.rounded, self.angle)
-
-
diff --git a/boxes/generators/console.py b/boxes/generators/console.py
index 61c1acb96..09105ee0e 100644
--- a/boxes/generators/console.py
+++ b/boxes/generators/console.py
@@ -15,6 +15,7 @@
from boxes import *
+
class Console(Boxes):
"""Console with slanted panel"""
diff --git a/boxes/generators/console2.py b/boxes/generators/console2.py
index 48f465775..300a85c61 100644
--- a/boxes/generators/console2.py
+++ b/boxes/generators/console2.py
@@ -15,6 +15,7 @@
from boxes import *
+
class Console2(Boxes):
"""Console with slanted panel and service hatches"""
@@ -98,7 +99,7 @@ def latch(self, move=None):
if self.move(tw, th, move, True):
return
-
+
self.moveTo(0, 1.2*t)
self.polyline(t, -90, .2*t, 90, 2*t, -90, t, 90, t, 90, t, -90, 3*t,
90, t, -90, t, 90, t, 90, 2*t, 90, 0.5*t,
@@ -193,7 +194,7 @@ def side(self, borders, bottom="s", move=None, label=""):
t = self.thickness
bottom = self.edges.get(bottom, bottom)
-
+
tw = borders[0] + 2* self.edges["f"].spacing()
th = borders[-2] + bottom.spacing() + self.edges["f"].spacing()
if self.move(tw, th, move, True):
@@ -201,7 +202,7 @@ def side(self, borders, bottom="s", move=None, label=""):
d1 = t * math.cos(math.radians(self.angle))
d2 = t * math.sin(math.radians(self.angle))
-
+
self.moveTo(t, 0)
bottom(borders[0])
self.corner(90)
@@ -228,9 +229,9 @@ def side(self, borders, bottom="s", move=None, label=""):
else:
self.edges["f"](borders[-2]+bottom.startwidth())
self.corner(borders[-1])
-
+
self.move(tw, th, move, label=label)
-
+
def render(self):
x, y, h = self.x, self.y, self.h
t = self.thickness
diff --git a/boxes/generators/desksign.py b/boxes/generators/desksign.py
index 141992c44..44c4395a7 100644
--- a/boxes/generators/desksign.py
+++ b/boxes/generators/desksign.py
@@ -15,6 +15,7 @@
from boxes import *
+
class Desksign(Boxes):
"""Simple diagonal plate with stands to show name or message."""
@@ -75,7 +76,7 @@ def render(self):
fontsize = fontsize, align="center", color=Color.ETCHING)]) # add text
else:
self.rectangularWall(width, height, "eheh", move="right") # front
-
+
# stands at back/side
edge = "šef" if feet else "eef"
if mirror:
diff --git a/boxes/generators/dinrailbox.py b/boxes/generators/dinrailbox.py
index 3b821cd53..ed9b2b369 100644
--- a/boxes/generators/dinrailbox.py
+++ b/boxes/generators/dinrailbox.py
@@ -39,7 +39,7 @@ def __call__(self, length, bedBolts=None, bedBoltSettings=None, **kw):
w+0.25,
-90, 1, 30, 5*2*3**-.5, 60, (l-w)/2+o-3.25)
-
+
class DinRailBox(Boxes):
"""Box for DIN rail used in electrical junction boxes"""
@@ -60,7 +60,7 @@ def latch(self, l, move=None):
4+1.25, 90, 4.5, -90, t+4, -90, 2, 90, l-.8*t-9, 90, 2, -90, 5+t, 90, 4, 90)
self.move(tw, th, move)
-
+
def __init__(self) -> None:
Boxes.__init__(self)
@@ -113,7 +113,7 @@ def render(self):
lambda:self.fingerHolesAt(.55*t, .05*t, y-.1*t, 90), None,
lambda:self.fingerHolesAt(.55*t, .05*t, y-.1*t, 90), None],
move="right", label="Lid")
-
+
self.lid_lip(y-.1*t, move="rotated right")
self.lid_lip(y-.1*t, move="rotated right")
diff --git a/boxes/generators/discrack.py b/boxes/generators/discrack.py
index e7d6206ba..f40adc14a 100644
--- a/boxes/generators/discrack.py
+++ b/boxes/generators/discrack.py
@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
-from math import sqrt, pi, sin, cos
+from math import cos, pi, sin, sqrt
from boxes import *
diff --git a/boxes/generators/dispenser.py b/boxes/generators/dispenser.py
index 978db6814..c624b0423 100644
--- a/boxes/generators/dispenser.py
+++ b/boxes/generators/dispenser.py
@@ -15,6 +15,7 @@
from boxes import *
+
class FrontEdge(edges.BaseEdge):
"""An edge with room to get your fingers around cards"""
def __call__(self, length, **kw):
@@ -37,7 +38,7 @@ class Dispenser(Boxes):
description = """Set *bottomheight* to 0 for a wall mounting variant.
Please add mounting holes yourself."""
-
+
ui_group = "Misc"
def __init__(self) -> None:
@@ -80,7 +81,7 @@ def render(self):
self.rectangularWall(x, y, "ffff", move="up only")
-
+
if hb:
frontedge = edges.CompoundEdge(self, "Ef", (hb+t+hs, h-hs))
self.rectangularWall(
@@ -112,4 +113,3 @@ def render(self):
label="Left front", move="right")
self.rectangularWall(x/3, h-hs, "eee" + se,
label="Right front", move="mirror right")
-
diff --git a/boxes/generators/display.py b/boxes/generators/display.py
index d8bd8a9c3..3f4e4299f 100644
--- a/boxes/generators/display.py
+++ b/boxes/generators/display.py
@@ -50,4 +50,3 @@ def render(self):
self.polyline(x-2*r, (90-a, r), oh, (90+a, r),
x-2*r+2*math.sin(math.radians(a))*oh,
(90+a, r), oh, (90-a, r))
-
diff --git a/boxes/generators/displaycase.py b/boxes/generators/displaycase.py
index abd73c2b9..5ec363dda 100644
--- a/boxes/generators/displaycase.py
+++ b/boxes/generators/displaycase.py
@@ -57,4 +57,3 @@ def render(self):
self.flangedWall(x, y, "FFFF", flanges=[self.overhang] * 4, move="right", label="Top")
self.flangedWall(x, y, "FFFF", flanges=[self.overhang] * 4, label="Bottom")
-
diff --git a/boxes/generators/dividertray.py b/boxes/generators/dividertray.py
index b685713b0..e3d28ec5c 100644
--- a/boxes/generators/dividertray.py
+++ b/boxes/generators/dividertray.py
@@ -18,7 +18,7 @@
import math
from functools import partial
-from boxes import Boxes, edges, boolarg, lids
+from boxes import Boxes, boolarg, edges, lids
class NotchSettings(edges.Settings):
diff --git a/boxes/generators/doubleflexdoorbox.py b/boxes/generators/doubleflexdoorbox.py
index 0a89d47bc..8eb3a607d 100644
--- a/boxes/generators/doubleflexdoorbox.py
+++ b/boxes/generators/doubleflexdoorbox.py
@@ -54,7 +54,7 @@ def flexBoxSide(self, x, y, r, callback=None, move=None):
self.latch(self.latchsize)
self.latch(self.latchsize, reverse=True)
self.edge(ll)
-
+
self.corner(90, r)
self.cc(callback, 3)
self.edges["f"](y - 2 * r)
diff --git a/boxes/generators/drillbox.py b/boxes/generators/drillbox.py
index f8cbb0878..7306d6038 100644
--- a/boxes/generators/drillbox.py
+++ b/boxes/generators/drillbox.py
@@ -13,8 +13,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
-from boxes import Boxes, edges, Color, ArgparseEdgeType
-from boxes.lids import _TopEdge, LidSettings
+from boxes import ArgparseEdgeType, Boxes, Color, edges
+from boxes.lids import LidSettings, _TopEdge
+
class DrillBox(_TopEdge):
"""A parametrized box for drills"""
diff --git a/boxes/generators/drillstand.py b/boxes/generators/drillstand.py
index 727a0af14..53ecc169b 100644
--- a/boxes/generators/drillstand.py
+++ b/boxes/generators/drillstand.py
@@ -50,7 +50,7 @@ def __init__(self) -> None:
def yWall(self, nr, move=None):
t = self.thickness
- x, sx, y, sy, sh = self.x, self.sx, self.y, self.sy, self.sh
+ x, sx, y, sy, sh = self.x, self.sx, self.y, self.sy, self.sh
eh = self.extra_height * (sum(sx[:nr])+ nr*t - t)/x
tw, th = sum(sy) + t * len(sy) + t, max(sh) + eh
@@ -65,12 +65,12 @@ def yWall(self, nr, move=None):
for i in range(len(sy)-1, 0, -1):
s1 = max(sh[i]-sh[i-1], 0) + 4*t
s2 = max(sh[i-1]-sh[i], 0) + 4*t
-
+
self.polyline(sy[i], 90, s1, -90, t, -90, s2, 90)
self.polyline(sy[0], 90)
self.edges["f"](sh[0] + eh)
self.corner(90)
-
+
self.move(tw, th, move)
def sideWall(self, extra_height=0.0, foot_height=0.0, edges="šFf", move=None):
@@ -109,7 +109,7 @@ def sideWall(self, extra_height=0.0, foot_height=0.0, edges="šFf", move=None):
self.step(t - edges[2].endwidth())
self.polyline(fh)
self.edgeCorner("e", edges[0])
-
+
self.move(tw, th, move)
def xWall(self, nr, move=None):
@@ -125,7 +125,7 @@ def xWall(self, nr, move=None):
if self.move(tw, th, move, True):
return
-
+
self.moveTo(t, eh+t, -a)
for i in range(len(sx)-1):
@@ -147,7 +147,7 @@ def xWall(self, nr, move=None):
def xOutsideWall(self, h, edges="fFeF", move=None):
t = self.thickness
x, sx, y, sy, sh = self.x, self.sx, self.y, self.sy, self.sh
-
+
edges = [self.edges.get(e, e) for e in edges]
eh = self.extra_height
@@ -160,7 +160,7 @@ def xOutsideWall(self, h, edges="fFeF", move=None):
if self.move(tw, th, move, True):
return
-
+
self.moveTo(edges[3].spacing(), eh+edges[0].margin(), -a)
self.edge(t*math.tan(math.radians(a)))
@@ -188,7 +188,7 @@ def xOutsideWall(self, h, edges="fFeF", move=None):
self.edgeCorner("e", edges[0], 90)
self.moveTo(0, self.burn+edges[0].startwidth(), 0)
-
+
for i in range(1, len(sx)):
posx = sum(sx[:i]) + i*t - 0.5 * t
length = h + self.extra_height * (sum(sx[:i]) + i*t - t)/x
@@ -198,7 +198,7 @@ def xOutsideWall(self, h, edges="fFeF", move=None):
def bottomCB(self):
t = self.thickness
- x, sx, y, sy, sh = self.x, self.sx, self.y, self.sy, self.sh
+ x, sx, y, sy, sh = self.x, self.sx, self.y, self.sy, self.sh
eh = self.extra_height
a = math.degrees(math.atan(eh / x))
@@ -226,9 +226,8 @@ def render(self):
self.xOutsideWall(sh[-1], "hfef", move="up")
self.rectangularWall(x/math.cos(bottom_angle)-t*math.tan(bottom_angle), y, "fefe", callback=[self.bottomCB], move="up")
-
+
self.sideWall(foot_height=self.extra_height+2*t, move="right")
for i in range(1, len(sx)):
self.yWall(i, move="right")
self.sideWall(self.extra_height, 2*t, move="right")
-
diff --git a/boxes/generators/edges.py b/boxes/generators/edges.py
index d897c3362..663873d1c 100644
--- a/boxes/generators/edges.py
+++ b/boxes/generators/edges.py
@@ -15,13 +15,14 @@
from boxes import *
+
class Edges(Boxes):
"""Print all registered Edge types"""
-
+
webinterface = False
def __init__(self) -> None:
- Boxes.__init__(self)
+ Boxes.__init__(self)
def render(self):
self.ctx = None
@@ -30,4 +31,3 @@ def render(self):
for c in sorted(chars, key=lambda x:(x.lower(), x.isupper())):
print("%s %s - %s" %(c, self.edges[c].__class__.__name__,
self.edges[c].__doc__))
-
diff --git a/boxes/generators/electronicsbox.py b/boxes/generators/electronicsbox.py
index 7a95d17cf..ad4f327be 100644
--- a/boxes/generators/electronicsbox.py
+++ b/boxes/generators/electronicsbox.py
@@ -48,12 +48,12 @@ def wallxCB(self):
t = self.thickness
self.fingerHolesAt(0, self.h-1.5*t, self.triangle, 0)
self.fingerHolesAt(self.x, self.h-1.5*t, self.triangle, 180)
-
+
def wallyCB(self):
t = self.thickness
self.fingerHolesAt(0, self.h-1.5*t, self.triangle, 0)
self.fingerHolesAt(self.y, self.h-1.5*t, self.triangle, 180)
-
+
def render(self):
t = self.thickness
@@ -63,7 +63,7 @@ def render(self):
hd = self.holedist
tr = self.triangle
trh = tr / 3.
-
+
if self.outside:
self.x = x = self.adjustSize(x)
self.y = y = self.adjustSize(y)
@@ -73,7 +73,7 @@ def render(self):
move="right", label="Wall 1")
self.rectangularWall(y, h, "ffef", callback=[self.wallyCB],
move="up", label="Wall 2")
- self.rectangularWall(y, h, "ffef", callback=[self.wallyCB],
+ self.rectangularWall(y, h, "ffef", callback=[self.wallyCB],
label="Wall 4")
self.rectangularWall(x, h, "fFeF", callback=[self.wallxCB],
move="left up", label="Wall 3")
@@ -93,6 +93,3 @@ def render(self):
self.rectangularTriangle(tr, tr, "ffe", num=4,
callback=[None, lambda: self.hole(trh, trh, d=d1)])
-
-
-
diff --git a/boxes/generators/eurorackskiff.py b/boxes/generators/eurorackskiff.py
index ca6d387e6..c5490b680 100644
--- a/boxes/generators/eurorackskiff.py
+++ b/boxes/generators/eurorackskiff.py
@@ -28,11 +28,11 @@ def __init__(self) -> None:
self.argparser.add_argument(
"--hp", action="store", type=int, default=84,
help="Width of the case in HP")
-
+
def wallxCB(self, x):
t = self.thickness
-
+
def wallyCB(self, y):
t = self.thickness
self.fingerHolesAt(0, self.h-1.5*t, y, 0)
@@ -40,15 +40,15 @@ def wallyCB(self, y):
def railHoles(self):
for i in range(0, self.hp):
self.hole(i*5.08 + 2.54, 3, d=3.0)
-
+
def render(self):
t = self.thickness
h = self.h
y = self.hp * 5.08
x = 128.5
-
-
+
+
self.rectangularWall(y, 6, "feee", callback=[self.railHoles] , move="up")
self.rectangularWall(y, 6, "feee", callback=[self.railHoles] , move="up")
self.rectangularWall(x, h, "fFeF", callback=[lambda: self.wallxCB(x)],
@@ -58,7 +58,3 @@ def render(self):
self.rectangularWall(x, h, "fFeF", callback=[lambda: self.wallxCB(x)],
move="left up")
self.rectangularWall(x, y, "FFFF", callback=[], move="right")
-
-
-
-
diff --git a/boxes/generators/fanhole.py b/boxes/generators/fanhole.py
index 6f4df8d41..e8ede93d8 100644
--- a/boxes/generators/fanhole.py
+++ b/boxes/generators/fanhole.py
@@ -15,6 +15,7 @@
from boxes import *
+
class FanHole(Boxes):
"""Hole pattern for mounting a fan"""
@@ -42,7 +43,7 @@ def __init__(self) -> None:
"--style", action="store", type=str, default="CW Swirl",
choices=["CW Swirl", "CCW Swirl", "Hole"],
help="Style of the fan hole")
-
+
def arc(self, d, a):
r = abs(1/math.cos(math.radians(90-a/2))*d/2)
@@ -59,7 +60,7 @@ def swirl(self, r, ri_rel=.1, n=20):
ai = 90
ao = 360/n * 0.8
# angle going in
- a1 = math.degrees(math.atan(
+ a1 = math.degrees(math.atan(
ri*math.sin(math.radians(ai)) /
(r - ri*math.cos(math.radians(ai)))))
d1= (ri*math.sin(math.radians(ai))**2 +
@@ -84,8 +85,8 @@ def swirl(self, r, ri_rel=.1, n=20):
self.corner(-180+a3)
self.arc(d1, 85)
self.corner(-90-a1)
-
- self.moveArc(-360./n, r)
+
+ self.moveArc(-360./n, r)
def render(self):
r_h = self.mounting_holes / 2
diff --git a/boxes/generators/filamentspool.py b/boxes/generators/filamentspool.py
index 187a0ee0d..848c5aa06 100644
--- a/boxes/generators/filamentspool.py
+++ b/boxes/generators/filamentspool.py
@@ -16,6 +16,7 @@
from boxes import *
from boxes.generators.bayonetbox import BayonetBox
+
class FilamentSpool(BayonetBox):
"""A two part spool for 3D printing filament"""
@@ -68,8 +69,8 @@ def outerHolesCB(self):
self.rectangularHole(
(self.outer_diameter + self.inner_diameter) / 4, 0,
(self.outer_diameter - self.inner_diameter) / 2 - 4*t, t, r=t/2)
-
-
+
+
def render(self):
t = self.thickness
diff --git a/boxes/generators/filltest.py b/boxes/generators/filltest.py
index 73b1ba287..8fd29a31c 100644
--- a/boxes/generators/filltest.py
+++ b/boxes/generators/filltest.py
@@ -73,5 +73,3 @@ def xHoles(self):
def render(self):
self.rectangularWall(self.x, self.y, "eeee", callback=[self.xHoles, None, None, None],)
-
-
diff --git a/boxes/generators/flexbook.py b/boxes/generators/flexbook.py
index 2a3bf49c6..4f4d1832f 100644
--- a/boxes/generators/flexbook.py
+++ b/boxes/generators/flexbook.py
@@ -15,6 +15,7 @@
from boxes import *
+
class FlexBook(Boxes):
"""Box with living hinge styled after a book."""
@@ -65,7 +66,7 @@ def flexBookRecessedWall(self, h, y, include_recess, callback=None, move=None):
if self.move(tw, th, move, True):
return
-
+
# TODO: figure out math for gentler angles
cutout_radius = min(h/4, y/8)
cutout_angle = 90
@@ -95,9 +96,9 @@ def flexBookRecessedWall(self, h, y, include_recess, callback=None, move=None):
else :
self.edges["e"](y)
self.corner(90)
-
+
self.move(tw, th, move)
-
+
def flexBookLatchWall(self, h, y, latchSize, callback=None, move=None):
t = self.thickness
@@ -122,7 +123,7 @@ def flexBookLatchWall(self, h, y, latchSize, callback=None, move=None):
self.corner(90)
self.rectangularHole(y/2, -1.5*t, latchSize - 2*t, t)
-
+
self.polyline(
(y-latchSize) / 2,
-90,
@@ -149,7 +150,7 @@ def flexBookCover(self, move=None):
if self.move(tw, th, move, True):
return
-
+
self.moveTo(2*t, 0)
self.edges["h"](x+t)
@@ -181,7 +182,7 @@ def flexBookCover(self, move=None):
self.corner(90)
self.edges["e"](y)
self.corner(90)
-
+
self.edges["e"](x)
self.corner(90)
self.edges["e"](y)
@@ -200,7 +201,7 @@ def flexBookLatchBracket(self, isCover, move=None):
tw, th = 5*t, 5.5*t
if self.move(tw, th, move, True):
return
-
+
if isCover:
self.edge(5*t)
else:
@@ -215,7 +216,7 @@ def flexBookLatchBracket(self, isCover, move=None):
self.edge(2*t - round)
self.corner(90)
self.edge(t)
-
+
self.corner(90)
self.edge(3*t)
self.corner(180, 2.5 * t)
@@ -228,7 +229,7 @@ def flexBookLatchBracket(self, isCover, move=None):
self.rectangularWall(t, 2*t)
self.move(tw, th, move)
-
+
def flexBookLatchPin(self, move=None):
t = self.thickness
l = self.latchsize
@@ -237,7 +238,7 @@ def flexBookLatchPin(self, move=None):
if self.move(tw, th, move, True):
return
-
+
round = t/3
self.moveTo(2*t, 0)
@@ -269,7 +270,7 @@ def flexBookLatchPin(self, move=None):
90)
self.move(tw, th, move)
-
+
def render(self):
@@ -279,7 +280,7 @@ def render(self):
self.h = self.y
self.y = y
t = self.thickness
-
+
self.radius = self.h / 2
self.c4 = c4 = math.pi * self.radius * 0.5
@@ -310,4 +311,3 @@ def render(self):
callback=[lambda: self.rectangularHole(2*t, l/2, 2.5*t, .8*l, r=2*t)],
move="right")
self.flexBookLatchPin(move="right")
-
diff --git a/boxes/generators/flexbox.py b/boxes/generators/flexbox.py
index b8b8fd5a8..e385f5c19 100644
--- a/boxes/generators/flexbox.py
+++ b/boxes/generators/flexbox.py
@@ -120,6 +120,3 @@ def render(self):
self.surroundingWall(move="up")
self.flexBoxSide(self.x, self.y, self.radius, move="right")
self.flexBoxSide(self.x, self.y, self.radius, move="mirror")
-
-
-
diff --git a/boxes/generators/flexbox2.py b/boxes/generators/flexbox2.py
index 05b47b78b..87298882b 100644
--- a/boxes/generators/flexbox2.py
+++ b/boxes/generators/flexbox2.py
@@ -116,5 +116,3 @@ def render(self):
self.flexBoxSide(self.y, self.h, self.radius, move="right")
self.flexBoxSide(self.y, self.h, self.radius, move= "mirror right")
self.rectangularWall(self.x, self.h - self.radius - self.latchsize, edges="fFeF")
-
-
diff --git a/boxes/generators/flexbox3.py b/boxes/generators/flexbox3.py
index ca5528d21..97b143eff 100644
--- a/boxes/generators/flexbox3.py
+++ b/boxes/generators/flexbox3.py
@@ -161,6 +161,3 @@ def render(self):
self.flexBoxSide(x, y, r, move="right")
self.flexBoxSide(x, y, r, move="mirror right")
self.rectangularWall(z, y, edges="fFeF")
-
-
-
diff --git a/boxes/generators/flexbox4.py b/boxes/generators/flexbox4.py
index 416df0a4b..e2f4bfd7c 100644
--- a/boxes/generators/flexbox4.py
+++ b/boxes/generators/flexbox4.py
@@ -113,6 +113,3 @@ def render(self):
self.flexBoxSide(self.x, self.y, self.radius, move="right")
self.flexBoxSide(self.x, self.y, self.radius, move="mirror right")
self.rectangularWall(self.x, self.h, edges="FeFF")
-
-
-
diff --git a/boxes/generators/flexbox5.py b/boxes/generators/flexbox5.py
index 9bd005d13..f9faf94f7 100644
--- a/boxes/generators/flexbox5.py
+++ b/boxes/generators/flexbox5.py
@@ -46,7 +46,7 @@ def flexBoxSide(self, callback=None, move=None):
l = self.l
tw , th = l+r1+r2, 2*max(r1, r2)+2*t
-
+
if self.move(tw, th, move, True):
return
@@ -107,7 +107,7 @@ def render(self):
self.h = self.adjustSize(self.h)
self.top_diameter = self.adjustSize(self.top_diameter)
self.bottom_diameter = self.adjustSize(self.bottom_diameter)
-
+
t = self.thickness
self.latchsize *= self.thickness
d_t, d_b = self.top_diameter, self.bottom_diameter
diff --git a/boxes/generators/flextest.py b/boxes/generators/flextest.py
index e866d6ea0..4e1a71891 100644
--- a/boxes/generators/flextest.py
+++ b/boxes/generators/flextest.py
@@ -40,6 +40,3 @@ def render(self):
self.corner(90)
self.edge(y)
self.corner(90)
-
-
-
diff --git a/boxes/generators/flextest2.py b/boxes/generators/flextest2.py
index 53e425226..033c04901 100644
--- a/boxes/generators/flextest2.py
+++ b/boxes/generators/flextest2.py
@@ -32,5 +32,3 @@ def render(self):
x, y = self.x, self.y
self.rectangularWall(x, y, callback=[lambda: self.flex2D(x, y, self.fw)])
-
-
diff --git a/boxes/generators/folder.py b/boxes/generators/folder.py
index dbea458b9..020e482e0 100644
--- a/boxes/generators/folder.py
+++ b/boxes/generators/folder.py
@@ -42,6 +42,3 @@ def render(self):
self.corner(90, r)
self.edge(y - 2 * r)
self.corner(90, r)
-
-
-
diff --git a/boxes/generators/frontpanel.py b/boxes/generators/frontpanel.py
index 7928b5c29..5234e155d 100644
--- a/boxes/generators/frontpanel.py
+++ b/boxes/generators/frontpanel.py
@@ -13,10 +13,12 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
-from boxes import *
import io
import shlex
+from boxes import *
+
+
def str_to_bool(s):
if (s.lower() in ['true', '1', 't', 'y', 'yes', 'yeah', 'yup', 'certainly', 'uh-huh']):
return True
@@ -39,7 +41,7 @@ class FrontPanel(Boxes):
circles and mounting holes. The default shows an example layout with all
currently supported objects.
-####
+####
`rect x y w h [cr=0] [cx=True] [cy=True]`
x: x position
@@ -57,7 +59,7 @@ class FrontPanel(Boxes):
w: width
h: height
-`outline` has a special meaning: You can create multiple panel outlines with one command.
+`outline` has a special meaning: You can create multiple panel outlines with one command.
This has the effect of making it easy to manage all the holes on all the sides of
your boxes.
@@ -144,7 +146,7 @@ def __init__(self) -> None:
def applyOffset(self, x, y):
return (x+self.offset[0], y+self.offset[1])
-
+
def drawRect(self, x, y, w, h, r=0, center_x="True", center_y="True") -> None:
x, y, w, h, r = (float(i) for i in [x, y, w, h, r])
x, y = self.applyOffset(x, y)
@@ -178,13 +180,13 @@ def drawText(self, x, y, size, text, angle=0, align='bottom|left'):
x, y = self.applyOffset(x, y)
align = align.replace("|", " ")
self.text(text=text, x=x, y=y, fontsize=size, angle=angle, align=align)
-
+
def drawNema(self, x, y, size, screwhole_size=0):
x, y, size, screwhole_size = (float(i) for i in [x, y, size, screwhole_size])
if size in self.nema_sizes:
x, y = self.applyOffset(x, y)
self.NEMA(size, x, y, screwholes=screwhole_size)
-
+
def parse_layout(self, layout):
f = io.StringIO(layout)
line = 0
diff --git a/boxes/generators/frontpanel_test.json b/boxes/generators/frontpanel_test.json
index b40683ca8..892bf74de 100644
--- a/boxes/generators/frontpanel_test.json
+++ b/boxes/generators/frontpanel_test.json
@@ -1,4 +1,3 @@
outline 60 60
squre 10 20 25 34
circle 10 20 40
-
diff --git a/boxes/generators/gear.py b/boxes/generators/gear.py
index 23daaff11..f4fdad599 100644
--- a/boxes/generators/gear.py
+++ b/boxes/generators/gear.py
@@ -15,6 +15,7 @@
from boxes import *
+
class Gears(Boxes):
"""Gears"""
diff --git a/boxes/generators/gearbox.py b/boxes/generators/gearbox.py
index 3aa83b9c3..e93e28655 100644
--- a/boxes/generators/gearbox.py
+++ b/boxes/generators/gearbox.py
@@ -92,6 +92,3 @@ def sideCB():
for i in range(self.stages):
self.gears(teeth=self.teeth1, dimension=self.modulus, angle=pressure_angle,
mount_hole=mh, profile_shift=profile_shift, move="down")
-
-
-
diff --git a/boxes/generators/gridfinitybase.py b/boxes/generators/gridfinitybase.py
index 5652bc890..66f2603ba 100644
--- a/boxes/generators/gridfinitybase.py
+++ b/boxes/generators/gridfinitybase.py
@@ -16,11 +16,12 @@
from boxes import *
from boxes import lids
+
class GridfinityBase(Boxes):
"""A parameterized Gridfinity base"""
description = """This is a configurable gridfinity base. This
- design is based on
+ design is based on
Zach Freedman's Gridfinity system"""
ui_group = "Tray"
@@ -50,7 +51,7 @@ def generate_grid(self):
lx = col*pitch+pitch/2
ly = row*pitch+pitch/2
self.rectangularHole(lx, ly, opening, opening)
-
+
def create_base_plate(self):
pitch = self.pitch
nx, ny = self.x, self.y
diff --git a/boxes/generators/gridfinitytraylayout.py b/boxes/generators/gridfinitytraylayout.py
index e888a1e7c..04c205804 100644
--- a/boxes/generators/gridfinitytraylayout.py
+++ b/boxes/generators/gridfinitytraylayout.py
@@ -1,8 +1,8 @@
import boxes
-from boxes import Boxes
-from boxes.generators.traylayout import TrayLayout
+from boxes import Boxes, lids, restore
from boxes.Color import Color
-from boxes import restore, lids
+from boxes.generators.traylayout import TrayLayout
+
class GridfinityTrayLayout(TrayLayout):
"""A Gridfinity Tray Generator based on TrayLayout"""
@@ -10,7 +10,7 @@ class GridfinityTrayLayout(TrayLayout):
description = """
This is a general purpose gridfinity tray generator. You can create
somewhat arbitrarily shaped trays, or just do nothing for simple grid
-shaped trays.
+shaped trays.
The dimensions are automatically calculated to fit perfectly into a
gridfinity grid (like the GridfinityBase, or any other Gridfinity
@@ -20,7 +20,7 @@ class GridfinityTrayLayout(TrayLayout):
You can replace the hyphens and vertical bars representing the walls
with a space character to remove the walls. You can replace the space
characters representing the floor by a "X" to remove the floor for
-this compartment.
+this compartment.
"""
def __init__(self) -> None:
Boxes.__init__(self)
@@ -38,7 +38,7 @@ def __init__(self) -> None:
self.argparser.add_argument("--county", type=int, default=3, help="split y into this many grid sections. 0 means same as --ny")
self.argparser.add_argument("--margin", type=float, default=0.75, help="Leave this much total margin on the outside, in mm")
self.argparser.add_argument("--layout", type=str, help="You can hand edit this before generating", default="\n");
-
+
def generate_layout(self):
layout = ''
countx = self.countx
@@ -47,7 +47,7 @@ def generate_layout(self):
countx = self.nx
if county == 0:
county = self.ny
-
+
stepx = self.x / countx
stepy = self.y / county
for i in range(countx):
@@ -58,7 +58,7 @@ def generate_layout(self):
layout += "| " * countx + f"|{stepy}mm\n"
layout += "+-" * countx + "+\n"
return layout
-
+
@restore
def rectangularEtching(self, x, y, dx, dy, r=0, center_x=True, center_y=True):
"""
@@ -94,7 +94,7 @@ def baseplate_etching(self):
self.set_source_color(Color.ETCHING)
self.rectangularEtching(x+p/2+xx*p, y+p/2+yy*p, o-m, o-m)
self.ctx.stroke()
-
+
def render(self):
# Create a layout
self.x = self.pitch * self.nx - self.margin
diff --git a/boxes/generators/halfbox.py b/boxes/generators/halfbox.py
index 8e864dcbf..b5184eda1 100644
--- a/boxes/generators/halfbox.py
+++ b/boxes/generators/halfbox.py
@@ -15,6 +15,7 @@
from boxes import *
+
class HalfBox(Boxes):
"""Configurable half of a box which can be: a bookend, a hanging shelf, an angle clamping jig, ..."""
@@ -45,16 +46,16 @@ def __init__(self) -> None:
self.argparser.add_argument("--ClampingSize", action="store", type=float, default=25.0, help="diameter of clamping holes")
self.argparser.add_argument("--Mounting", action="store", type=boolarg, default=False, help="add mounting holes")
self.argparser.add_argument("--Sturdy", action="store", type=boolarg, default=False, help="create sturdy construction (e.g. shelf, clamping jig, ...)")
-
+
def polygonWallExt(self, borders, edge="f", turtle=False, callback=None, move=None):
- # extended polygon wall.
+ # extended polygon wall.
# same as polygonWall, but with extended border parameters
# each border dataset consists of
# length
# turn angle
# radius of turn (without radius correction)
# edge type
-
+
for i in range(0, len(borders), 4):
self.cc(callback, i)
length = borders[i]
@@ -81,19 +82,19 @@ def hHoles(self):
for y in reversed(self.sy[1:]):
posy += y + self.thickness
self.fingerHolesAt(posy, 0, self.h)
-
+
def render(self):
# adjust to the variables you want in the local scope
-
+
x, h = self.x, self.h
d = self.ClampingSize
t = self.thickness
-
+
# triangle with sides: x (horizontal), h (upwards) and l
# angles: 90° between x & h
# b between h & l
# c between l & x
-
+
l = math.sqrt(x * x + h * h)
b = math.degrees(math.asin(x / l))
c = math.degrees(math.asin(h / l))
@@ -104,22 +105,22 @@ def render(self):
if 90 + b + c < 179:
c = 180 - c
- # small triangle top: 2*t, h1, l1
+ # small triangle top: 2*t, h1, l1
h1 = (2*t)/x*h
l1 = (2*t)/x*l
- # small triangle left: x2, 2*t, l2
+ # small triangle left: x2, 2*t, l2
x2 = (2*t)/h*x
l2 = (2*t)/h*l
-
+
# render your parts here
-
+
if self.Sturdy:
width = sum(self.sy) + (len(self.sy) - 1) * t
self.rectangularWall(x, width, "fffe", callback=[None, self.xHoles, None, None], move="right", label="bottom")
self.rectangularWall(h, width, "fGfF" if self.Mounting else "fefF", callback=[None, None, None, self.hHoles], move="up", label="back")
self.rectangularWall(x, width, "fffe", callback=[None, self.xHoles, None, None], move="left only", label="invisible")
-
+
for i in range(2):
self.move(x+x2+2*t + self.edges["f"].margin(), h+h1+2*t + self.edges["f"].margin(), "right", True, label="side " + str(i))
self.polygonWallExt(borders=[x2, 0, 0, "e", x, 0, 0, "h",2*t, 90, 0, "e", 2*t, 0, 0, "e", h, 0, 0, "h",h1, 180-b, 0, "e", l+l1+l2, 180-c, 0, "e"])
diff --git a/boxes/generators/heart.py b/boxes/generators/heart.py
index 4eb10a1c6..191e07038 100644
--- a/boxes/generators/heart.py
+++ b/boxes/generators/heart.py
@@ -15,6 +15,7 @@
from boxes import *
+
class HeartBox(Boxes):
"""Box in the form of a heart"""
@@ -41,7 +42,7 @@ def CB(self):
if self.top == "closed":
return
-
+
for i in range(2):
self.moveTo(t, t)
self.polyline((l, 2), (180, r), (d, 1), -90,
@@ -58,7 +59,7 @@ def render(self):
l = 2/3. * x
r = l/2. - 0.5*t
-
+
borders = [l, (180, r), t, -90, t, (180, r), l, 90]
self.polygonWalls(borders, h)
self.rectangularWall(0, h, "FFFF", move="up only")
diff --git a/boxes/generators/hingebox.py b/boxes/generators/hingebox.py
index bb2b523c5..d25dda43b 100644
--- a/boxes/generators/hingebox.py
+++ b/boxes/generators/hingebox.py
@@ -15,6 +15,7 @@
from boxes import *
+
class HingeBox(Boxes):
"""Box with lid attached by cabinet hinges"""
@@ -43,7 +44,7 @@ def render(self):
x, y, h, hl = self.x, self.y, self.h, self.lidheight
s = self.splitlid
-
+
if self.outside:
x = self.adjustSize(x)
y = self.adjustSize(y)
@@ -85,6 +86,3 @@ def render(self):
self.edges['u'].parts(move="up")
if s:
self.edges['u'].parts(move="up")
-
-
-
diff --git a/boxes/generators/holepattern.py b/boxes/generators/holepattern.py
index ff2f638ec..ac795449c 100644
--- a/boxes/generators/holepattern.py
+++ b/boxes/generators/holepattern.py
@@ -60,7 +60,7 @@ def render(self):
(d2*x, y), (d*x, y), (0, d2*y), (0, d*y)]
else: # "rectangle"
border = [(0, 0), (x, 0), (x, y), (0, y)]
-
+
self.fillHoles(
pattern=self.fillHoles_fill_pattern,
border=border,
diff --git a/boxes/generators/hooks.py b/boxes/generators/hooks.py
index 874a31736..393c16a4d 100644
--- a/boxes/generators/hooks.py
+++ b/boxes/generators/hooks.py
@@ -78,11 +78,11 @@ def back_callback(self, n):
self.hole(x_h, y1, d=3)
self.hole(x_h, y2, d=3)
self.hole(x_h, y3, d=3)
-
+
@property
def height_back(self):
-
+
return self.strength + self.height + self.h_a
@property
diff --git a/boxes/generators/integratedhingebox.py b/boxes/generators/integratedhingebox.py
index 19c6b8b6a..4288bc5dd 100644
--- a/boxes/generators/integratedhingebox.py
+++ b/boxes/generators/integratedhingebox.py
@@ -29,7 +29,7 @@ def __init__(self) -> None:
self.argparser.add_argument(
"--lidheight", action="store", type=float, default=20.0,
help="height of lid in mm")
-
+
def render(self):
@@ -60,6 +60,3 @@ def render(self):
self.rectangularWall(y, x, "ffff", move="up")
self.rectangularWall(y, x, "ffff")
-
-
-
diff --git a/boxes/generators/jigsaw.py b/boxes/generators/jigsaw.py
index 1b20fff85..f47a7ff18 100644
--- a/boxes/generators/jigsaw.py
+++ b/boxes/generators/jigsaw.py
@@ -81,5 +81,3 @@ def render(self):
self.burn = 0.0
self.moveTo(10, 10)
self.hilbert(self.depth)
-
-
diff --git a/boxes/generators/jointpanel.py b/boxes/generators/jointpanel.py
index cf4fd83dd..be6e5e6cf 100644
--- a/boxes/generators/jointpanel.py
+++ b/boxes/generators/jointpanel.py
@@ -15,6 +15,7 @@
from boxes import *
+
class JointPanel(Boxes):
"""Create pieces larger than your laser cutter by joining them with Dove Tails"""
@@ -27,7 +28,7 @@ class JointPanel(Boxes):
For plywood this method works well with a very stiff press fit. Aim for needing a hammer to join the pieces together. This way they will feel like they have been welder together.
"""
-
+
ui_group = "Misc"
def __init__(self) -> None:
diff --git a/boxes/generators/keyboard.py b/boxes/generators/keyboard.py
index a6bc1b61c..f19bd12c2 100644
--- a/boxes/generators/keyboard.py
+++ b/boxes/generators/keyboard.py
@@ -281,4 +281,4 @@ def simple_plate_cutout(self, radius=0.2, with_notch=False):
self.moveTo(0, 0, -90)
self.moveTo(half_size - self.burn)
else:
- self.rectangularHole(0, 0, size, size, r=radius)
\ No newline at end of file
+ self.rectangularHole(0, 0, size, size, r=radius)
diff --git a/boxes/generators/keypad.py b/boxes/generators/keypad.py
index 23291c5c8..1696356e7 100644
--- a/boxes/generators/keypad.py
+++ b/boxes/generators/keypad.py
@@ -4,6 +4,7 @@
from boxes import Boxes, boolarg
from boxes.edges import FingerJointSettings
+
from .keyboard import Keyboard
diff --git a/boxes/generators/lamp.py b/boxes/generators/lamp.py
index 65a59e9ec..03ad9adf9 100644
--- a/boxes/generators/lamp.py
+++ b/boxes/generators/lamp.py
@@ -127,6 +127,3 @@ def render(self):
self.rectangularWall(x, h, edges='hFFF', holesMargin=5, move="right")
self.rectangularWall(x, h, edges='hFFF', holesMargin=5)
-
-
-
diff --git a/boxes/generators/laserclamp.py b/boxes/generators/laserclamp.py
index 1a6468e51..5370a4e28 100644
--- a/boxes/generators/laserclamp.py
+++ b/boxes/generators/laserclamp.py
@@ -15,6 +15,7 @@
from boxes import *
+
class LaserClamp(Boxes):
"""A clamp to hold down material to a knife table"""
@@ -74,7 +75,7 @@ def bottomPart(self, h_min, h_extra, move=None):
else:
self.polyline(6*t)
self.polyline(4*t, (90, 2*t), 3*t, 135, 2*ls, 45, 1*t, -90, 6*t, -90)
-
+
self.polyline(h_min, (90, t), 2*t, (90, t),
h_min+h_extra-0*t, (-90, t), t, (180, t),
0, 90, 0, (-180, 0.5*t), 0 , 90)
@@ -87,7 +88,7 @@ def render(self):
if h_extra and h_extra < 2*t:
h_extra = 2*t
-
+
self.topPart(h_max+h_extra, move="right")
self.bottomPart(h_min, h_extra, move="right")
self.roundedPlate(4*t, h_min+h_extra+4*t, edge="e", r=t,
diff --git a/boxes/generators/laserholdfast.py b/boxes/generators/laserholdfast.py
index f8ebd305f..cd293a69e 100644
--- a/boxes/generators/laserholdfast.py
+++ b/boxes/generators/laserholdfast.py
@@ -15,6 +15,7 @@
from boxes import *
+
class LaserHoldfast(Boxes):
"""A holdfast for honey comb tables of laser cutters"""
@@ -33,7 +34,7 @@ def __init__(self) -> None:
def render(self):
# adjust to the variables you want in the local scope
- x, hh, h, sw = self.x, self.hookheight, self.h, self.shaftwidth
+ x, hh, h, sw = self.x, self.hookheight, self.h, self.shaftwidth
t = self.thickness
a = 30
diff --git a/boxes/generators/lbeam.py b/boxes/generators/lbeam.py
index 127182973..d360b3e71 100644
--- a/boxes/generators/lbeam.py
+++ b/boxes/generators/lbeam.py
@@ -15,6 +15,7 @@
from boxes import *
+
class LBeam(Boxes):
"""Simple L-Beam: two pieces joined with a right angle"""
@@ -37,5 +38,3 @@ def render(self):
self.rectangularWall(x, h, "eFee", move="right")
self.rectangularWall(y, h, "eeef")
-
-
diff --git a/boxes/generators/magazinefile.py b/boxes/generators/magazinefile.py
index 5c8fd7100..771690117 100644
--- a/boxes/generators/magazinefile.py
+++ b/boxes/generators/magazinefile.py
@@ -16,6 +16,7 @@
from boxes import *
from boxes.lids import _TopEdge
+
class MagazineFile(Boxes):
"""Open magazine file"""
@@ -86,6 +87,3 @@ def render(self):
self.side(y, h, hi, t1)
self.moveTo(y + 15, h + hi + 15, 180)
self.side(y, h, hi, t3)
-
-
-
diff --git a/boxes/generators/makitapowersupply.py b/boxes/generators/makitapowersupply.py
index 71c761571..949ce0663 100644
--- a/boxes/generators/makitapowersupply.py
+++ b/boxes/generators/makitapowersupply.py
@@ -15,6 +15,7 @@
from boxes import *
+
class MakitaPowerSupply(Boxes):
"""Bench power supply powered with Maktia 18V battery or laptop power supply"""
diff --git a/boxes/generators/microrack.py b/boxes/generators/microrack.py
index 7a51cec70..92cd3f430 100644
--- a/boxes/generators/microrack.py
+++ b/boxes/generators/microrack.py
@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
-from boxes import Boxes, edges, boolarg
+from boxes import Boxes, boolarg, edges
class SBCMicroRack(Boxes):
@@ -137,7 +137,7 @@ def paint_netusb_holes(self):
t = self.thickness
x = self.x
w = x + self.hole_dist_edge * 2
- height_per = self.clearance_z + t
+ height_per = self.clearance_z + t
usb_height = self.netusb_z
usb_width = self.netusb_x
for i in range(self.sbcs):
@@ -197,4 +197,3 @@ def render(self):
"efef",
callback=[self.paint_mounting_holes],
move="up")
-
diff --git a/boxes/generators/nemamount.py b/boxes/generators/nemamount.py
index bbfe91962..6ccc4d29e 100644
--- a/boxes/generators/nemamount.py
+++ b/boxes/generators/nemamount.py
@@ -15,6 +15,7 @@
from boxes import *
+
class NemaMount(Boxes):
"""Mounting bracket for a Nema motor"""
@@ -51,4 +52,3 @@ def render(self):
self.fingerHolesAt(0.5*t, t, x, 90)
self.fingerHolesAt(1.5*t+x, t, x, 90)
self.fingerHolesAt(t, 0.5*t, x, 0)
-
diff --git a/boxes/generators/nemapattern.py b/boxes/generators/nemapattern.py
index 3f8165e0b..0976f665a 100644
--- a/boxes/generators/nemapattern.py
+++ b/boxes/generators/nemapattern.py
@@ -15,6 +15,7 @@
from boxes import *
+
class NemaPattern(Boxes):
"""Mounting holes for a Nema motor"""
diff --git a/boxes/generators/notesholder.py b/boxes/generators/notesholder.py
index 744d26899..90c616194 100644
--- a/boxes/generators/notesholder.py
+++ b/boxes/generators/notesholder.py
@@ -14,7 +14,8 @@
# along with this program. If not, see .
from boxes import *
-from boxes.edges import Edge, CompoundEdge
+from boxes.edges import CompoundEdge, Edge
+
class USlotEdge(Edge):
diff --git a/boxes/generators/openbox.py b/boxes/generators/openbox.py
index a43ee86b1..5fd0c7220 100644
--- a/boxes/generators/openbox.py
+++ b/boxes/generators/openbox.py
@@ -15,6 +15,7 @@
from boxes import *
+
class OpenBox(Boxes):
"""Box with top and front open"""
diff --git a/boxes/generators/organpipe.py b/boxes/generators/organpipe.py
index 9383582ae..39e1e2d9f 100644
--- a/boxes/generators/organpipe.py
+++ b/boxes/generators/organpipe.py
@@ -40,7 +40,7 @@ def getFrequency(self, pitch, octave, base_freq=440):
def getRadius(self, pitch, octave, intonation):
steps = pitches.index(pitch) + (octave-2)*12 + intonation
return 0.5 * 0.15555 * 0.957458**steps
-
+
def getAirSpeed(self, wind_pressure, air_density=1.2):
return (2.0 * (wind_pressure / air_density))**.5
@@ -49,7 +49,7 @@ def __init__(self) -> None:
self.addSettingsArgs(edges.FingerJointSettings, finger=3.0, space=3.0,
surroundingspaces=1.0)
-
+
"""
air_temperature: f64,
"""
@@ -90,7 +90,7 @@ def render(self):
f = self.getFrequency(self.pitch, self.octave, 440)
self.windpressure *= pressure_units.get(self.windpressure_units, 1.0)
-
+
speed_of_sound = 343.6 # XXX util::speed_of_sound(self.air_temperature); // in m/s
air_density = 1.2
air_speed = self.getAirSpeed(self.windpressure, air_density)
@@ -124,11 +124,11 @@ def render(self):
air_hole_diameter = 2.0 * ((mouth_width * jet_thickness * 10.0)**.5 / pi)
total_length = resonator_length + base_length
-
+
e = ["f", "e",
edges.CompoundEdge(self, "fef", (resonator_length - mouth_height - 10*t, mouth_height + 10*t, base_length)), "f"]
-
+
self.rectangularWall(total_length, pipe_depth, e, callback=[
lambda: self.fingerHolesAt(base_length-0.5*t, 0, pipe_depth-jet_thickness)],
move="up")
@@ -145,4 +145,3 @@ def render(self):
self.rectangularWall(mouth_width, pipe_depth, "fFfF", callback=[
lambda:self.hole(mouth_width/2, pipe_depth/2, d=air_hole_diameter)], move="right")
self.rectangularWall(mouth_width, pipe_depth - jet_thickness, "ffef", move="right")
-
diff --git a/boxes/generators/ottobody.py b/boxes/generators/ottobody.py
index e7d0d8afb..4b15c8540 100644
--- a/boxes/generators/ottobody.py
+++ b/boxes/generators/ottobody.py
@@ -56,7 +56,7 @@ def leftBottomCB(self):
self.hole(6, self.y/2+9, 0.9)
self.rectangularHole(6, self.y/2-5.5, 12, 23)
self.hole(6, self.y/2-20, 0.9)
-
+
def rightBottomCB(self):
self.hole(7, self.y-5, 2)
@@ -95,7 +95,7 @@ def PCB_Clip(self, x , y, move=None):
def PCB_Clamp(self, w, s, h, move=None):
t = self. thickness
f = 2**0.5
-
+
if self.move(w+4, h+8+t, move, True):
return
self.polyline(w, 90, s, -90, 1, (90, 1), (h-s-1, 2), 90, w-2, 90,
@@ -109,7 +109,7 @@ def render(self):
self.y = y = 60.
self.h = h = 35.
self.hl = hl = 30.
-
+
t = self.thickness
hx = self.edges["O"].startwidth()
@@ -123,7 +123,7 @@ def render(self):
self.moveTo(hx)
self.rectangularWall(x, h-hx, "FfOf", ignore_widths=[2], move="up", label=_("Left bottom side"))
self.rectangularWall(x, hl-hx2, "pfFf", ignore_widths=[1], move="up", label=_("Left top side"))
- self.moveTo(-hx)
+ self.moveTo(-hx)
self.rectangularWall(x, h-hx, "Ffof", ignore_widths=[5], callback=[
lambda: self.rectangularHole(y-7.5, h-4-7.5, 6.2, 7.)],
move="up", label=_("Right bottom side"))
@@ -161,6 +161,3 @@ def render(self):
self.rectangularWall(y-5.6, 14, callback=[
None, None, None, self.rightBottomCB], move="up",
label=_("Servo mount"))
-
-
-
diff --git a/boxes/generators/ottolegs.py b/boxes/generators/ottolegs.py
index caa220415..8ab065078 100644
--- a/boxes/generators/ottolegs.py
+++ b/boxes/generators/ottolegs.py
@@ -16,6 +16,7 @@
from boxes import *
from boxes import edges
+
class LegEdge(edges.BaseEdge):
def __call__(self, l, **kw):
@@ -55,7 +56,7 @@ def foot(self, x, y, ly, l, r=5., move=None):
for l in (x, y, x, y):
self.polyline((l - 2*r, 2), 45, r*2**0.5, 45)
-
+
self.move(x, y, move)
def ankles(self, x, h, edge="f", callback=None, move=None):
@@ -90,7 +91,7 @@ def servoring(self, move=""):
self.moveTo(3.45, 0, -90)
self.polyline(0, (-264, 3.45), 0, 36, 6.55, 108, 0, (330, 9.0, 4), 0, 108, 6.55)
self.move(20, 20, move)
-
+
def ankle2(self):
# from vertical edge
@@ -147,4 +148,3 @@ def render(self):
self.ankles(30, 25, callback=[None, self.ankle1], move="right")
self.ankles(30, 25, callback=[None, self.ankle2], move="right")
self.partsMatrix(2, 2, "right", self.servoring)
-
diff --git a/boxes/generators/ottosoles.py b/boxes/generators/ottosoles.py
index b507409c5..20e66084b 100644
--- a/boxes/generators/ottosoles.py
+++ b/boxes/generators/ottosoles.py
@@ -15,6 +15,7 @@
from boxes import *
+
class OttoSoles(Boxes):
"""Foam soles for the OttO bot"""
@@ -44,7 +45,7 @@ def render(self):
w2 = w * 2**0.5 - c2 / 2
d = w * math.tan(math.radians(22.5))
-
+
self.edges["d"].settings.setValues(w, size=0.4, depth=0.3,
radius=0.05)
diff --git a/boxes/generators/paintbox.py b/boxes/generators/paintbox.py
index ba12fee48..3020d39d7 100644
--- a/boxes/generators/paintbox.py
+++ b/boxes/generators/paintbox.py
@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
-from boxes import Boxes, edges, boolarg
+from boxes import Boxes, boolarg, edges
class PaintStorage(Boxes):
diff --git a/boxes/generators/piratechest.py b/boxes/generators/piratechest.py
index baeb9e818..c3da9581b 100644
--- a/boxes/generators/piratechest.py
+++ b/boxes/generators/piratechest.py
@@ -15,13 +15,14 @@
from boxes import *
+
class PirateChest(Boxes):
"""Box with polygon lid with chest hinges."""
- description = """Do not assemble sides before attaching the lid!
- Hinge of the lid has to be placed first because it is impossible
- to get it in position without removing the side wall. The lid can
- be a bit tricky to assemble. Keep track of how the parts fit together.
+ description = """Do not assemble sides before attaching the lid!
+ Hinge of the lid has to be placed first because it is impossible
+ to get it in position without removing the side wall. The lid can
+ be a bit tricky to assemble. Keep track of how the parts fit together.
Part with label "lid back" is placed in the hinges"""
ui_group = "Box"
@@ -49,7 +50,7 @@ def render(self):
if (n < 3):
raise ValueError("number of sides on the lid must be greater or equal to 3 (got %i)" % n)
-
+
hy = self.edges["O"].startwidth()
h -= hy
if (h < 0):
@@ -102,7 +103,7 @@ def topside(self, y, n, bottom, move=None, label=""):
tx = y + 2 * self.edges.get('f').spacing()
lidheight = hp if n % 2 else radius
ty = lidheight + self.edges.get('f').spacing() + self.edges.get(bottom).spacing()
-
+
if self.move(tx, ty, move, before=True):
return side/2 + self.edges.get(bottom).spacing(), side, side/2
@@ -115,7 +116,7 @@ def topside(self, y, n, bottom, move=None, label=""):
self.edges.get('f')(side/2 + self.edges.get(bottom).spacing())
else:
self.edges.get('f')(side/2)
-
+
self.corner(180 / (n - 1))
for _ in range(n-2):
self.edges.get('f')(side)
@@ -125,7 +126,7 @@ def topside(self, y, n, bottom, move=None, label=""):
self.edges.get('f')(side/2 + self.edges.get(bottom).spacing())
else:
self.edges.get('f')(side/2)
-
+
self.corner(90)
self.move(tx, ty, move, label=label)
diff --git a/boxes/generators/pizzashovel.py b/boxes/generators/pizzashovel.py
index f6c00e3ec..8038c6100 100644
--- a/boxes/generators/pizzashovel.py
+++ b/boxes/generators/pizzashovel.py
@@ -15,13 +15,14 @@
from boxes import *
+
class PizzaShovel(Boxes):
"""Pizza shovel with conveyor belt action"""
description = """
You need (permanent) baking paper to create the conveyor. With that you can pick up and put down the pizza by moving the handle attached to the belt.
"""
-
+
ui_group = "Misc"
def __init__(self) -> None:
@@ -71,7 +72,7 @@ def render(self):
ce = edges.CompoundEdge(self, "fe", [y/2, y/2])
ec = edges.CompoundEdge(self, "ef", [y/2, y/2])
-
+
self.rectangularWall(x, y, ["e", ce, "e", ec], move="up")
self.rectangularWall(x, 40, "efef", callback=[self.gripCB(top=True)], move="up")
self.rectangularWall(x, 80, "efef", callback=[self.gripCB(top=False)], move="up")
diff --git a/boxes/generators/planetary.py b/boxes/generators/planetary.py
index edfcb1dd4..eb92c3fdd 100644
--- a/boxes/generators/planetary.py
+++ b/boxes/generators/planetary.py
@@ -99,6 +99,3 @@ def render(self):
self.gears(teeth=self.planetteeth, dimension=self.modulus,
angle=pressure_angle,
mount_hole=self.shaft, profile_shift=profile_shift, move="up")
-
-
-
diff --git a/boxes/generators/planetary2.py b/boxes/generators/planetary2.py
index 54bdd6bb5..c6c592856 100644
--- a/boxes/generators/planetary2.py
+++ b/boxes/generators/planetary2.py
@@ -29,7 +29,7 @@ def __init__(self) -> None:
self.argparser.add_argument(
"--profile", action="store", type=str, default="GT2_2mm",
choices=pulley.Pulley.getProfiles(),
- help="profile of the teeth/belt")
+ help="profile of the teeth/belt")
self.argparser.add_argument(
"--sunteeth", action="store", type=int, default=20,
help="number of teeth on sun gear")
diff --git a/boxes/generators/platonic.py b/boxes/generators/platonic.py
index 7b36566cc..56fd0d063 100644
--- a/boxes/generators/platonic.py
+++ b/boxes/generators/platonic.py
@@ -41,7 +41,7 @@ def __call__(self, length, bedBolts=None, bedBoltSettings=None, **kw):
leftover -= play
shift = (f + s) / 2 # we shift all fingers to make them un even
- if (leftover < shift):
+ if (leftover < shift):
leftover = shift
self.edge((leftover + shift)/2, tabs=1) # Whole point of this class
@@ -75,7 +75,7 @@ def __call__(self, length, bedBolts=None, bedBoltSettings=None, **kw):
self.edge((leftover - shift)/2, tabs=1) # Whole point of this class
# Unstable
-class UnevenFingerJointEdgeCounterPart(UnevenFingerJointEdge):
+class UnevenFingerJointEdgeCounterPart(UnevenFingerJointEdge):
"""Uneven finger joint edge - other side"""
char = 'U'
description = "Uneven Finger Joint (opposing side)"
@@ -122,5 +122,3 @@ def render(self):
for _ in range(faces):
self.regularPolygonWall(corners, side=e, edges="u", move="right")
-
-
diff --git a/boxes/generators/polehook.py b/boxes/generators/polehook.py
index 5be0440ae..1d0b4cd1e 100644
--- a/boxes/generators/polehook.py
+++ b/boxes/generators/polehook.py
@@ -15,9 +15,10 @@
from boxes import *
+
class PoleHook(Boxes): # change class name here and below
"""Hook for pole like things to be clamped to another pole"""
-
+
def __init__(self) -> None:
Boxes.__init__(self)
@@ -50,7 +51,7 @@ def fork(self, d, w, edge="e", full=True, move=None):
e = self.edges.get(edge, edge)
-
+
self.moveTo(0, e.margin())
if e is self.edges["e"]:
@@ -64,7 +65,7 @@ def fork(self, d, w, edge="e", full=True, move=None):
else:
self.polyline(0, 90, d, 90, w, 90, 0, (-180, d/2),
0.5*d, (180, w/2), 1.5 * d, 90)
-
+
self.move(tw, th, move)
def lock(self, l1, l2, w, move=None):
@@ -124,5 +125,3 @@ def render(self):
for i in range(2):
self.parts.disc(ww, move="up")
-
-
diff --git a/boxes/generators/pulley.py b/boxes/generators/pulley.py
index fc58dd8a2..e76aabd2a 100644
--- a/boxes/generators/pulley.py
+++ b/boxes/generators/pulley.py
@@ -75,6 +75,3 @@ def render(self):
for i in range(int(math.ceil(self.h / self.thickness))):
self.pulley(self.teeth, self.profile, insideout=self.insideout, r_axle=self.axle / 2.0, move="right")
-
-
-
diff --git a/boxes/generators/rack10box.py b/boxes/generators/rack10box.py
index 50c0d69e5..edd864d5d 100644
--- a/boxes/generators/rack10box.py
+++ b/boxes/generators/rack10box.py
@@ -15,6 +15,7 @@
from boxes.generators.rack19box import Rack19Box
+
class Rack10Box(Rack19Box):
"""Closed box with screw on top for mounting in a 10" rack."""
diff --git a/boxes/generators/rack19box.py b/boxes/generators/rack19box.py
index 4cc6135bf..c4a85aea3 100644
--- a/boxes/generators/rack19box.py
+++ b/boxes/generators/rack19box.py
@@ -45,22 +45,22 @@ def wallxCB(self):
t = self.thickness
self.fingerHolesAt(0, self.h-1.5*t, self.triangle, 0)
self.fingerHolesAt(self.x, self.h-1.5*t, self.triangle, 180)
-
+
def wallxfCB(self): # front
t = self.thickness
for x in (8.5, self.x+2*17.+2*t-8.5):
for y in (6., self.h-6.+t):
self.rectangularHole(x, y, 10, 6.5, r=3.25)
-
+
self.moveTo(t+17., t)
self.wallxCB()
-
+
def wallyCB(self):
t = self.thickness
self.fingerHolesAt(0, self.h-1.5*t, self.triangle, 0)
self.fingerHolesAt(self.y, self.h-1.5*t, self.triangle, 180)
-
-
+
+
def _render(self, type):
t = self.thickness
diff --git a/boxes/generators/rackbox.py b/boxes/generators/rackbox.py
index 6093bf001..a495f7c39 100644
--- a/boxes/generators/rackbox.py
+++ b/boxes/generators/rackbox.py
@@ -45,33 +45,33 @@ def wallxCB(self):
t = self.thickness
self.fingerHolesAt(0, self.h-1.5*t, self.triangle, 0)
self.fingerHolesAt(self.x, self.h-1.5*t, self.triangle, 180)
-
+
def wallxfCB(self): # front
t = self.thickness
hd = self.holedist
for x in (hd, self.x+3*hd+2*t):
for y in (hd, self.h-hd+t):
self.hole(x, y, self.d3/2.)
-
+
self.moveTo(t+2*hd, t)
self.wallxCB()
-
+
def wallyCB(self):
t = self.thickness
self.fingerHolesAt(0, self.h-1.5*t, self.triangle, 0)
self.fingerHolesAt(self.y, self.h-1.5*t, self.triangle, 180)
-
-
+
+
def render(self):
t = self.thickness
self.h = h = self.h + 2*t # compensate for lid
x, y, h = self.x, self.y, self.h
d1, d2, d3 =self.d1, self.d2, self.d3
- hd = self.holedist
+ hd = self.holedist
tr = self.triangle
trh = tr / 3.
-
+
if self.outside:
self.x = x = self.adjustSize(x)
self.y = y = self.adjustSize(y)
@@ -91,6 +91,3 @@ def render(self):
self.rectangularTriangle(tr, tr, "ffe", num=4,
callback=[None, lambda: self.hole(trh, trh, d=d1)])
-
-
-
diff --git a/boxes/generators/rectangularWall.py b/boxes/generators/rectangularWall.py
index 110b54c8d..97d425c7f 100644
--- a/boxes/generators/rectangularWall.py
+++ b/boxes/generators/rectangularWall.py
@@ -15,6 +15,7 @@
from boxes import *
+
class RectangularWall(Boxes):
"""Simple wall with options for different edges"""
@@ -24,8 +25,8 @@ def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.CabinetHingeSettings)
- self.addSettingsArgs(edges.ClickSettings)
- self.addSettingsArgs(edges.DoveTailSettings)
+ self.addSettingsArgs(edges.ClickSettings)
+ self.addSettingsArgs(edges.DoveTailSettings)
self.addSettingsArgs(edges.FingerJointSettings)
self.addSettingsArgs(edges.GearSettings)
self.addSettingsArgs(edges.GripSettings)
@@ -52,7 +53,7 @@ def __init__(self) -> None:
"--left_edge", action="store",
type=ArgparseEdgeType("cCdDeEfFghiIjJkKlLmMnNoOpPqQRsSšŠuUvV"), choices=list("cCdDeEfFghiIjJkKlLmMnNoOpPqQRsSšŠuUvV"),
default="e", help="edge type for left edge")
-
+
def cb(self, nr):
t = self.thickness
@@ -67,4 +68,3 @@ def render(self):
self.moveTo(3*t, 3*t)
self.rectangularWall(self.x, self.h, self.edgetypes, callback=self.cb)
-
diff --git a/boxes/generators/regularbox.py b/boxes/generators/regularbox.py
index 09eaa323c..0bdce89fc 100644
--- a/boxes/generators/regularbox.py
+++ b/boxes/generators/regularbox.py
@@ -24,7 +24,7 @@ class RegularBox(BayonetBox):
The lids needs to be glued. For the bayonet lid all outside rings attach to the bottom, all inside rings to the top.
"""
-
+
ui_group = "Box"
def __init__(self) -> None:
diff --git a/boxes/generators/regularstarbox.py b/boxes/generators/regularstarbox.py
index 3cbfe119a..7ba4b2c9f 100644
--- a/boxes/generators/regularstarbox.py
+++ b/boxes/generators/regularstarbox.py
@@ -30,9 +30,9 @@ def __call__(self, length, **kw):
lo = (length-li-2*ls1)/2
li = li - 2*ls2 # correct for overlap of wall
-
+
d = h/2
-
+
if li > 0:
poly = [lo-1, (90, 1), d+t-1, -90, ls1+ls2, -90, d-t, (90, t)]
self.polyline(*(poly + [li-2*t] + list(reversed(poly))))
diff --git a/boxes/generators/robotarm.py b/boxes/generators/robotarm.py
index df4b5c57e..9f8ac6d37 100644
--- a/boxes/generators/robotarm.py
+++ b/boxes/generators/robotarm.py
@@ -16,11 +16,12 @@
from boxes import *
from boxes import robot, servos
+
class RobotArm(Boxes): # change class name here and below
"""Segments of servo powered robot arm"""
ui_group = "Part"
-
+
def __init__(self) -> None:
Boxes.__init__(self)
@@ -55,4 +56,3 @@ def render(self):
servoClsA = getattr(servos, servoA)
servoClsB = getattr(servos, servoB)
armcls(self, servoClsA(self), servoClsB(self))(length, move="up")
-
diff --git a/boxes/generators/rollholder.py b/boxes/generators/rollholder.py
index a850a21b6..8581f1d39 100644
--- a/boxes/generators/rollholder.py
+++ b/boxes/generators/rollholder.py
@@ -15,11 +15,12 @@
from boxes import *
+
class RollHolder(Boxes):
"""Holder for kitchen rolls or other rolls"""
description = """Needs a dowel or pipe as axle."""
-
+
ui_group = "WallMounted"
def __init__(self) -> None:
@@ -69,7 +70,7 @@ def side(self, move=None):
self.edge(((h-2*r)**2+(d/2)**2)**0.5)
self.corner(90-alpha, r)
self.corner(90)
-
+
self.move(tw, th, move)
def backCB(self):
@@ -79,7 +80,7 @@ def backCB(self):
w = self.width
plate = w + 2*t + h/2 if self.one_piece else h/2 + t
-
+
self.fingerHolesAt(h/4+t/2-3*t, 0, h, 90)
self.fingerHolesAt(h/4-3*t, h-3*t-a/2, h/4, 180)
@@ -95,14 +96,14 @@ def rings(self):
a = self.axle
r = a/2
t = self.thickness
-
+
self.moveTo(0, a+1.5*t, -90)
for i in range(2):
self.polyline(r-1.5*t, (180, r+3*t), 0, (180, 1.5*t), 0,
(-180, r), r-1.5*t, (180, 1.5*t))
self.moveTo(a-t, a+12*t, 180)
-
-
+
+
def render(self):
t = self.thickness
w = self.width
diff --git a/boxes/generators/rotary.py b/boxes/generators/rotary.py
index d659ff9bf..f40ea574a 100644
--- a/boxes/generators/rotary.py
+++ b/boxes/generators/rotary.py
@@ -290,7 +290,7 @@ def render(self):
self.rectangularWall(ow, h, edges="hFFH", move="right")
self.rectangularWall(ow, h, edges="hFFH", move="right")
self.rectangularWall(ow, h, edges="hFFH", move="up only")
-
+
# Motor block
mw = 40
self.rectangularWall(3.6 * d, h, edges=["h", "f", MotorEdge(self, None),"f"], callback=[self.mainPlate], move="up")
@@ -322,6 +322,3 @@ def render(self):
hole=self.axle, move="right")
self.parts.disc(self.diameter - 2 * self.rubberthickness + 4,
hole=self.axle, move="right up")
-
-
-
diff --git a/boxes/generators/roundedbox.py b/boxes/generators/roundedbox.py
index aafbd408f..429a8c236 100644
--- a/boxes/generators/roundedbox.py
+++ b/boxes/generators/roundedbox.py
@@ -35,7 +35,7 @@ def __init__(self) -> None:
boxes.Boxes.__init__(self)
self.addSettingsArgs(boxes.edges.FingerJointSettings)
self.addSettingsArgs(boxes.edges.DoveTailSettings)
- self.addSettingsArgs(boxes.edges.FlexSettings)
+ self.addSettingsArgs(boxes.edges.FlexSettings)
self.buildArgParser("x", "y", "outside", sh="100.0")
self.argparser.add_argument(
"--radius", action="store", type=float, default=15,
@@ -134,5 +134,3 @@ def render(self):
self.surroundingWall(x, y, r, h, pe, pe, pieces=self.wallpieces,
callback=self.cb)
-
-
diff --git a/boxes/generators/royalgame.py b/boxes/generators/royalgame.py
index ed56abed8..a1dfeb7c3 100644
--- a/boxes/generators/royalgame.py
+++ b/boxes/generators/royalgame.py
@@ -15,6 +15,7 @@
from boxes import *
+
class RoyalGame(Boxes):
"""The Royal Game of Ur"""
@@ -72,7 +73,7 @@ def _castle(self, x, y, s):
l = s/7*2**0.5
self.moveTo(x-s/2 + s/14, y-s/2, 45)
self.polyline(*([l, -90, l, 90]*3 + [l/2, 90])*4)
-
+
def castle(self, x, y, s):
self._castle(x, y, 0.9*s)
self._castle(x, y, 0.5*s)
@@ -159,7 +160,7 @@ def player2(self, x=0, y=0):
for dx in (-1, 1):
for dy in (-1, 1):
self.hole(x+dx*.2*s, y+dy*.2*s, 0.07*s)
-
+
def render(self):
x = self.x
@@ -177,10 +178,9 @@ def render(self):
self.rectangularWall(x, y, "fMff", move="up")
self.rectangularWall(x, y, "fNff", callback=[self.top,], move="up")
-
+
self.partsMatrix(7, 7, "up", self.parts.disc, 0.8*size, callback=self.player1)
self.partsMatrix(7, 7, "up", self.parts.disc, 0.8*size, callback=self.player2)
self.dice(size, 4, move="up")
self.dice(size, 4, move="up")
-
diff --git a/boxes/generators/sevensegment.py b/boxes/generators/sevensegment.py
index e0d40a2a4..fa4033a7c 100644
--- a/boxes/generators/sevensegment.py
+++ b/boxes/generators/sevensegment.py
@@ -15,6 +15,7 @@
from boxes import *
+
class SevenSegmentPattern(Boxes):
"""Holepatterns and walls for a seven segment digit"""
@@ -50,7 +51,7 @@ def seven_segments(self, x):
width = l + 2*w + d # 0.55 * x
#self.rectangularHole(width/2, x/2, width, x)
-
+
for px in [w/2 + d/2 , w/2 + l + 1.5*d]:
for py in [w + d/2, w + l + 1.5*d]:
with self.saved_context():
diff --git a/boxes/generators/sevensegmentclock.py b/boxes/generators/sevensegmentclock.py
index fdb40284d..dcbc1837c 100644
--- a/boxes/generators/sevensegmentclock.py
+++ b/boxes/generators/sevensegmentclock.py
@@ -14,8 +14,10 @@
# along with this program. If not, see .
from boxes import *
+
from .sevensegment import SevenSegmentPattern
+
class SevenSegmentClock(SevenSegmentPattern):
"""Seven segment clock build with LED stripe"""
diff --git a/boxes/generators/shoe.py b/boxes/generators/shoe.py
index 681d85205..db7965672 100644
--- a/boxes/generators/shoe.py
+++ b/boxes/generators/shoe.py
@@ -15,13 +15,14 @@
from boxes import *
+
class Shoe(Boxes):
"""Shoe shaped box"""
- description = """Shoe shaped box with flat sides and rounded top.
- Works best if flex if under slight compression.
- Make sure that the following conditions are met:
- y > tophole + r + fronttop;
+ description = """Shoe shaped box with flat sides and rounded top.
+ Works best if flex if under slight compression.
+ Make sure that the following conditions are met:
+ y > tophole + r + fronttop;
height > frontheight."""
ui_group = "Misc"
@@ -31,7 +32,7 @@ def __init__(self) -> None:
self.addSettingsArgs(edges.FingerJointSettings)
self.addSettingsArgs(edges.FlexSettings)
-
+
self.argparser.add_argument(
"--width", action="store", type=float, default=65,
help="width of the shoe")
@@ -81,7 +82,7 @@ def render(self):
dr = a*(r-t)/stretch
self.shoelip(x, tf, dr, lf, label="top")
-
+
def shoelip(self, x, tf, dr, lf, move=None, label=""):
w = self.edges["F"].spacing()
@@ -113,7 +114,7 @@ def shoeside(self, y, h, hf, yg, tf, r, move=None, label=""):
tx = y + 2 * self.edges.get('F').spacing()
ty = h + self.edges.get('f').spacing() + self.edges.get("e").spacing()
-
+
if self.move(tx, ty, move, before=True):
return
diff --git a/boxes/generators/shutterbox.py b/boxes/generators/shutterbox.py
index efee6caaa..55a9f00dc 100644
--- a/boxes/generators/shutterbox.py
+++ b/boxes/generators/shutterbox.py
@@ -15,6 +15,7 @@
from boxes import *
+
class ShutterBox(Boxes):
"""Box with a rolling shutter made of flex"""
@@ -29,7 +30,7 @@ class ShutterBox(Boxes):
def side(self, l, h, r, style, move=None):
t = self.thickness
-
+
if self.move(l+2*t, h+2*t, move, True):
return
@@ -75,7 +76,7 @@ def side(self, l, h, r, style, move=None):
else:
self.polyline(l-2*r, (90, r+t), 0, 90, t, -90)
self.edges["f"](h-r)
-
+
self.move(l+2*t, h+2*t, move)
def cornerRadius(self, r, two=False, move=None):
@@ -103,7 +104,7 @@ def rails(self, l, r, move=None):
self.polyline(l-r, (90, r-1.5*t), 0, 90, t, 90, 0, (-90, r-2.5*t), l-r, 90, t, 90)
self.moveTo(-t-s, t+s)
self.polyline(l-r, (90, r-1.5*t), 0, 90, t, 90, 0, (-90, r-2.5*t), l-r, 90, t, 90)
-
+
self.move(tw, th, move)
def rails2(self, l, r, move=None):
@@ -157,7 +158,7 @@ def render(self):
style = self.style
self.n = n = 3
-
+
if not r:
self.radius = r = h / 2
self.radius = r = min(r, h/2)
@@ -185,14 +186,14 @@ def render(self):
self.side(x, h, r, style, move="up only")
self.rectangularWall(x, y, "FFFF", move="right")
-
+
if style == "single":
self.door(x-r+0.5*math.pi*r + 3*t, y-0.2*t, move="right")
else:
self.door(x-2*r+math.pi*r + 3*t, y-0.2*t, move="right")
self.rectangularWall(2*t, y-2.2*t, edges="eeef", move="right")
-
+
a = 90. / n
ls = 2*math.sin(math.radians(a/2)) * (r-2.5*t)
@@ -216,16 +217,15 @@ def render(self):
self.rectangularWall(x-2*r, y, "fbfb", move="right")
else:
self.rectangularWall(x-r, y, "fbfe", move="right")
-
+
self.rectangularWall(ls, y, "fafB", move="right")
-
+
for i in range(n-2):
self.rectangularWall(ls, y, "fafA", move="right")
-
+
if h - 2*r > 2*t:
self.rectangularWall(ls, y, "fbfA", move="right")
self.rectangularWall(h - 2*r, y, "fefB", move="right")
else:
self.rectangularWall(ls, y, "fefA", move="right")
-
diff --git a/boxes/generators/sidedoorhousing.py b/boxes/generators/sidedoorhousing.py
index eca6074ed..1cbc66667 100644
--- a/boxes/generators/sidedoorhousing.py
+++ b/boxes/generators/sidedoorhousing.py
@@ -16,32 +16,33 @@
from boxes import *
from boxes.generators.console2 import Console2
+
class SideDoorHousing(Console2):
"""Box with service hatches on either one or both of the sides that are locked with latches"""
ui_group = "Box"
description = """
-This box is designed as a housing for electronic projects but could be used for other purposes. It has hatches that can be re-opened with simple tools. If built from thin enough material, it intentionally cannot be opened with bare hands.
+This box is designed as a housing for electronic projects but could be used for other purposes. It has hatches that can be re-opened with simple tools. If built from thin enough material, it intentionally cannot be opened with bare hands.
-The hatches are on the x sides.
+The hatches are on the x sides.
#### Assembly instructions
-The main body is easy to assemble:
-1. Starting with the floor and then add the four walls (for any removable sides, the wall will just be a small part on the base )
+The main body is easy to assemble:
+1. Starting with the floor and then add the four walls (for any removable sides, the wall will just be a small part on the base )
2. Add the top piece
-For the removable walls:
-1. Add the lips to the removable walls
-2. Sit the latches in place (it is importand to make sure the springs on the latches point inwards and the angled ends point to the side walls. See image below)
-3. Glue the U-shaped clamps in place (it is important **not** to glue the latches)
+For the removable walls:
+1. Add the lips to the removable walls
+2. Sit the latches in place (it is importand to make sure the springs on the latches point inwards and the angled ends point to the side walls. See image below)
+3. Glue the U-shaped clamps in place (it is important **not** to glue the latches)
![Wall details](static/samples/SideDoorHousing.jpg)
#### Re-Opening
-The latches lock in place when closed. To open them they need to be pressed in and can then be moved aside.
+The latches lock in place when closed. To open them they need to be pressed in and can then be moved aside.
![Closed Box](static/samples/SideDoorHousing-2.jpg)
@@ -58,7 +59,7 @@ def __init__(self) -> None:
"--double_door", action="store", type=boolarg, default=True,
help="allow removing the backwall, too")
-
+
def render(self):
x, y, h = self.x, self.y, self.h
t = self.thickness
@@ -90,7 +91,7 @@ def render(self):
self.rectangularHole(y-1.55*t, latchpos, 1.1*t, 1.1*t))],
move=move)
-
+
for i in range(2 if self.double_door else 1):
self.rectangularWall(x, t, (bottom, "F", "e", "F"),
ignore_widths=[1, 6], move="up")
diff --git a/boxes/generators/silverwarebox.py b/boxes/generators/silverwarebox.py
index 4a7d643f7..32287c20a 100644
--- a/boxes/generators/silverwarebox.py
+++ b/boxes/generators/silverwarebox.py
@@ -105,4 +105,3 @@ def render(self):
self.moveTo(-3.0 * (l + 2 * t + 8 * b), h - 10 + 2 * t + 8 * b)
self.basePlate(x, y, r)
-
diff --git a/boxes/generators/skadis.py b/boxes/generators/skadis.py
index 34e443525..593dc8961 100644
--- a/boxes/generators/skadis.py
+++ b/boxes/generators/skadis.py
@@ -15,6 +15,7 @@
from boxes import *
+
class SkadisBoard(Boxes):
"""Customizable Ikea like pegboard"""
@@ -37,7 +38,7 @@ def CB(self):
if (r+c) % 2 == 0:
continue
self.rectangularHole((c+1)*20 - 8, (r+1)*20, 5, 15, r=2.5)
-
+
def render(self):
self.roundedPlate((self.columns+1) * 20, (self.rows+1)*20, edge="e", r=8,
extend_corners=False, callback=[self.CB])
diff --git a/boxes/generators/slantedtray.py b/boxes/generators/slantedtray.py
index df5807fd1..2aee92886 100644
--- a/boxes/generators/slantedtray.py
+++ b/boxes/generators/slantedtray.py
@@ -13,9 +13,11 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
-from boxes import *
from functools import partial
+from boxes import *
+
+
class SlantedTray(Boxes):
"""One row tray with high back wall and low front wall"""
diff --git a/boxes/generators/slidingdrawer.py b/boxes/generators/slidingdrawer.py
index a90970903..559e66764 100644
--- a/boxes/generators/slidingdrawer.py
+++ b/boxes/generators/slidingdrawer.py
@@ -1,5 +1,6 @@
from boxes import *
+
class SlidingDrawer(Boxes):
"""Sliding drawer box"""
@@ -47,4 +48,3 @@ def render(self):
self.rectangularWall(y, h, "fffe", label="out box wall", move="up left")
self.rectangularWall(x, h, "fFfF", label="out box wall")
-
diff --git a/boxes/generators/smallpartstray.py b/boxes/generators/smallpartstray.py
index 201088a0b..bca0fa6e2 100644
--- a/boxes/generators/smallpartstray.py
+++ b/boxes/generators/smallpartstray.py
@@ -17,6 +17,7 @@
from boxes import lids
from boxes.edges import CompoundEdge
+
class SmallPartsTray(Boxes):
"""Tray with slants to easier get out game tokens or screws"""
@@ -42,7 +43,7 @@ def __init__(self) -> None:
self.argparser.add_argument(
"--front_panel", action="store", type=boolarg, default=True,
help="have a vertical wall at the ramp")
-
+
def innerWall(self, h, y, ramp_h, ramp_y, two_ramps, front=True,
move=None):
@@ -71,7 +72,7 @@ def cb():
if two_ramps:
self.moveTo(y-ramp_y, 0, a)
self.fingerHolesAt(0, -0.5*t, l, 0)
-
+
if two_ramps:
self.rectangularWall(
y, h,
@@ -88,7 +89,7 @@ def cb():
"e",
CompoundEdge(self, "FE", (h-ramp_h, ramp_h))],
callback=[cb], move=move)
-
+
def holeCB(self, sections, height):
def CB():
@@ -97,7 +98,7 @@ def CB():
pos += l + self.thickness
self.fingerHolesAt(pos, 0, height)
return CB
-
+
def render_simple_tray_divider(self, width, height, move):
"""
Simple movable divider. A wall with small feet for a little more stability.
@@ -241,7 +242,7 @@ def render(self):
self.rectangularWall(
x, h, "Ffef",
callback=[self.holeCB(sx, h)], move="up")
-
+
if self.two_sided:
with self.saved_context():
diff --git a/boxes/generators/smallpartstray2.py b/boxes/generators/smallpartstray2.py
index 6556304e1..ed767fa43 100644
--- a/boxes/generators/smallpartstray2.py
+++ b/boxes/generators/smallpartstray2.py
@@ -14,7 +14,8 @@
# along with this program. If not, see .
from boxes import *
-from boxes.lids import _TopEdge, LidSettings
+from boxes.lids import LidSettings, _TopEdge
+
class TopEdge(edges.BaseEdge):
@@ -22,7 +23,7 @@ def __init__(self, boxes, lengths, h):
super().__init__(boxes, None)
self.lengths = lengths
self.h = h
-
+
def __call__(self, length, **kw):
h = self.h
t = self.boxes.thickness
@@ -84,7 +85,7 @@ def CB():
self.fingerHolesAt(0, 0, l, 0)
self.moveTo(l+self.thickness)
return CB
-
+
def xHoles(self):
posx = -0.5 * self.thickness
@@ -103,14 +104,14 @@ def yHoles(self):
self.fingerHolesAt(-0.5*t, 0, self.hi*2**.5+t/2)
self.moveTo(posy+self.sy[-1]+0.5*t, self.hi, 135)
- self.fingerHolesAt(-0.5*t, 0, self.hi*2**.5+t/2)
+ self.fingerHolesAt(-0.5*t, 0, self.hi*2**.5+t/2)
def render(self):
# tmp settings
self.top_edge = "e"
self.bottom_edge = "F"
-
+
if self.outside:
self.sx = self.adjustSize(self.sx)
self.sy = self.adjustSize(self.sy)
@@ -166,7 +167,7 @@ def render(self):
x, floors[0], "ffef",
callback=[self.fingerHolesCB(self.sx, self.sy[0]-dy)],
move="up", label="floor back side")
- for y_ in self.sy[1:]:
+ for y_ in self.sy[1:]:
self.rectangularWall(
x, y_ - slot + t, "efef",
callback=[self.fingerHolesCB(self.sx, y_ - slot + t),
@@ -178,7 +179,7 @@ def render(self):
callback=[self.fingerHolesCB(self.sx, hi-t2)],
move="up", label="floor front side")
floors.append(hi-t2)
-
+
# Inner walls
be = "f" if b != "e" else "e"
@@ -230,7 +231,3 @@ def render(self):
edges.CompoundEdge(self, "fe", (hi-t*2**.5, t*2**.5)),
TopEdge(self, self.sy[::-1], hi), "f"]
self.rectangularWall(y, hi, e, move="up", label=f"inner y {i+1}")
-
-
-
-
diff --git a/boxes/generators/spicesrack.py b/boxes/generators/spicesrack.py
index 4bf884572..f954e5431 100644
--- a/boxes/generators/spicesrack.py
+++ b/boxes/generators/spicesrack.py
@@ -15,6 +15,7 @@
from boxes import *
+
class FrontEdge(edges.Edge):
def __call__(self, length, **kw):
@@ -30,7 +31,7 @@ def __call__(self, length, **kw):
def margin(self) -> float:
return self.edge_width
-
+
class SpicesRack(Boxes):
"""Rack for cans of spices"""
@@ -44,7 +45,7 @@ def __init__(self) -> None:
self.argparser.add_argument(
"--diameter", action="store", type=float, default=55.,
help="diameter of spice cans")
-
+
self.argparser.add_argument(
"--height", action="store", type=float, default=60.,
help="height of the cans that needs to be supported")
@@ -99,7 +100,7 @@ def holes(self):
a = self.base_angle
l = self.hole_length
self.moveTo(0, self.hole_distance)
-
+
with self.saved_context():
self.ctx.scale(1, l/self.base_h)
self.moveTo(self.space/2, 0, 90)
@@ -148,9 +149,9 @@ def render(self):
width = self.hole_distance + self.hole_length + self.space/2
inner_width = self.hole_distance + self.hole_length/3
-
+
self.edge_width = width - inner_width
-
+
for i in range(self.numy):
self.rectangularWall(x, inner_width,[
"f", "e", FrontEdge(self, self), "e"],
@@ -170,4 +171,3 @@ def render(self):
if self.feet:
self.partsMatrix(self.numx-1, self.numx-1, "up",
self.foot, width, (self.h-t)/2)
-
diff --git a/boxes/generators/spool.py b/boxes/generators/spool.py
index 15cc02040..52f22ae24 100644
--- a/boxes/generators/spool.py
+++ b/boxes/generators/spool.py
@@ -15,6 +15,7 @@
from boxes import *
+
class Spool(Boxes):
"""A simple spool"""
@@ -67,8 +68,8 @@ def reinforcementCB(self):
self.axle_diameter / 2, 0,
(self.inner_diameter - self.axle_diameter) / 2 + self.thickness, 0)
self.moveTo(0, 0, 360 / self.reinforcements)
-
-
+
+
def render(self):
t = self.thickness
r, h, side = self.regularPolygon(self.sides, radius=self.inner_diameter/2)
diff --git a/boxes/generators/stachel.py b/boxes/generators/stachel.py
index 3041ab80b..cb3538b67 100644
--- a/boxes/generators/stachel.py
+++ b/boxes/generators/stachel.py
@@ -18,7 +18,7 @@
class Stachel(Boxes):
"""Bass Recorder Endpin"""
-
+
ui_group = "Misc"
def __init__(self) -> None:
@@ -44,7 +44,7 @@ def layer(self, ri, ro, rp, holes=False, move=""):
tw = 2*ro + 2*rp
th = 2*ro + l
-
+
if self.move(tw, th, move, True):
return
@@ -79,10 +79,10 @@ def layer(self, ri, ro, rp, holes=False, move=""):
else:
self.polyline(l+l1-r)
self.polyline(0, (90, r), w-2*r, (90, r))
-
+
self.move(tw, th, move)
-
-
+
+
def render(self):
@@ -93,5 +93,3 @@ def render(self):
self.layer(ri-20, ro, rp, move="up")
self.layer(ri, ro, rp, True, move="up")
self.layer(ri, ro, rp, move="up")
-
-
diff --git a/boxes/generators/storagerack.py b/boxes/generators/storagerack.py
index eed810c5c..89e5576e8 100644
--- a/boxes/generators/storagerack.py
+++ b/boxes/generators/storagerack.py
@@ -15,6 +15,7 @@
from boxes import *
+
class StorageRack(Boxes):
"""StorageRack to store boxes and trays which have their own floor"""
@@ -33,7 +34,7 @@ def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)
self.addSettingsArgs(edges.StackableSettings)
-
+
self.argparser.add_argument(
"--depth", action="store", type=float, default=200,
help="depth of the rack")
@@ -58,7 +59,7 @@ def backHoles(self):
for nr, h in enumerate(self.sh[:-1]):
posh += h + self.thickness
if ((self.bottom_edge == "e" and nr == 0) or
- (self.top_edge == "e" and nr == len(self.sh) - 2)):
+ (self.top_edge == "e" and nr == len(self.sh) - 2)):
self.fingerHolesAt(0, posh, self.x, 0)
else:
self.fingerHolesAt(0, posh, self.rail, 0)
@@ -98,7 +99,7 @@ def render(self):
num -= 1
if t == "e":
num -= 1
-
+
for i in range(num):
self.rectangularWall(d, self.rail, "ffee", move="up")
self.rectangularWall(d, self.rail, "feef", move="up")
diff --git a/boxes/generators/storageshelf.py b/boxes/generators/storageshelf.py
index 686e1a535..fc6beab3d 100644
--- a/boxes/generators/storageshelf.py
+++ b/boxes/generators/storageshelf.py
@@ -16,6 +16,7 @@
from boxes import *
from boxes.lids import _TopEdge
+
class StorageShelf(_TopEdge):
"""StorageShelf can be used to store Typetray"""
@@ -34,8 +35,8 @@ def __init__(self) -> None:
self.argparser.add_argument(
"--retainer_hole_edge", action="store", type=boolarg, default=False,
help="use finger hole edge for retainer walls")
-
-
+
+
def ySlots(self):
posy = -0.5 * self.thickness
diff --git a/boxes/generators/tetris.py b/boxes/generators/tetris.py
index 02306d0ab..ab463d92d 100644
--- a/boxes/generators/tetris.py
+++ b/boxes/generators/tetris.py
@@ -39,7 +39,7 @@ def cb(self, nr):
s = self.blocksize
self.ctx.stroke()
self.set_source_color(Color.ETCHING)
-
+
if nr == 0:
if self.shape in "LT":
for i in range(1, 3):
@@ -65,15 +65,15 @@ def cb(self, nr):
self.ctx.stroke()
-
+
def render(self):
# adjust to the variables you want in the local scope
t = self.thickness
s = self.blocksize
-
+
if self.shape == "L":
borders = [3*s - 2*t, 90, 2*s - 2*t, 90, s - 2*t, 90,
- s, -90, 2*s, 90, s - 2*t, 90]
+ s, -90, 2*s, 90, s - 2*t, 90]
elif self.shape == "I":
borders = [4*s - 2*t, 90, s - 2*t, 90 ] * 2
elif self.shape == "S":
diff --git a/boxes/generators/trafficlight.py b/boxes/generators/trafficlight.py
index 3d784f418..5c47cd4e4 100644
--- a/boxes/generators/trafficlight.py
+++ b/boxes/generators/trafficlight.py
@@ -39,7 +39,7 @@ class TrafficLight(Boxes): # change class name here and below
description = """The traffic light was created to visualize the status of a Icinga monitored system.
When turned by 90°, it can be also used to create a bottle holder."""
-
+
def __init__(self) -> None:
Boxes.__init__(self)
@@ -111,7 +111,7 @@ def wall(self, h1, h2, w, edges="ffef", callback=None, move="", label=""):
self.edgeCorner(edges[3], edges[3 + 1], 90)
self.move(overallwidth, overallheight, move, label=label)
-
+
def addMountH(self, width, height):
ds = self.hole_dD[0]
@@ -149,7 +149,7 @@ def addMountV(self, width, height):
self.mountingHole(x, y1, ds, dh, 180)
self.mountingHole(x, y2, ds, dh, 180)
-
+
def render(self):
# adjust to the variables you want in the local scope
d, h, n = self.depth, self.h, self.n
@@ -157,7 +157,7 @@ def render(self):
t = self.thickness
th = n * (h + t) - t
-
+
self.addPart(ShadyEdge(self, None))
@@ -204,4 +204,3 @@ def render(self):
# Colored windows
for i in range(n):
self.parts.disc(h-2*t, move="right", label="colored windows")
-
diff --git a/boxes/generators/trayinsert.py b/boxes/generators/trayinsert.py
index 24f3dead6..dbd91af8e 100644
--- a/boxes/generators/trayinsert.py
+++ b/boxes/generators/trayinsert.py
@@ -45,6 +45,3 @@ def render(self):
for i in range(len(self.sy) - 1):
e = ["e", "e", edges.SlottedEdge(self, self.sx[::-1], "e", slots=0.5 * h), "e"]
self.rectangularWall(x, h, e, move="up")
-
-
-
diff --git a/boxes/generators/traylayout.py b/boxes/generators/traylayout.py
index 9e2a79058..b433a0c17 100644
--- a/boxes/generators/traylayout.py
+++ b/boxes/generators/traylayout.py
@@ -18,6 +18,7 @@
from boxes import *
from boxes import lids
+
class TrayLayoutFile(Boxes):
"""Generate a layout file for a typetray."""
# This class generates the skeleton text file that can then be edited
diff --git a/boxes/generators/trianglelamp.py b/boxes/generators/trianglelamp.py
index 05390792c..c36d71344 100644
--- a/boxes/generators/trianglelamp.py
+++ b/boxes/generators/trianglelamp.py
@@ -15,9 +15,10 @@
from boxes import *
+
class CornerEdge(edges.Edge):
char = "C"
-
+
def startwidth(self) -> float:
return self.boxes.thickness * math.tan(math.radians(90-22.5))
@@ -30,7 +31,7 @@ def __call__(self, length, bedBolts=None, bedBoltSettings=None, **kw):
self.ctx.stroke()
self.set_source_color(Color.BLACK)
super().__call__(length, bedBolts=None, bedBoltSettings=None, **kw)
-
+
class TriangleLamp(Boxes):
"""Triangle LED Lamp"""
@@ -104,7 +105,7 @@ def render(self):
self.rectangularWall(l, h, "F"+C+"e" + C,
callback=[self.CB(l, c*2**.5)], move="up")
-
+
self.rectangularTriangle(c, c, "ffe", num=2, move="right", callback=[
lambda:self.hole(2/3.*c,1/3.*c, r1)])
self.rectangularTriangle(c, c, "fef", num=4, move="up", callback=[
diff --git a/boxes/generators/two_piece.py b/boxes/generators/two_piece.py
index f664359e4..8ceffa8ac 100644
--- a/boxes/generators/two_piece.py
+++ b/boxes/generators/two_piece.py
@@ -17,7 +17,7 @@
class TwoPiece(Boxes):
- """A two piece box where top slips over the bottom half to form
+ """A two piece box where top slips over the bottom half to form
the enclosure.
"""
@@ -66,4 +66,3 @@ def render(self):
self.rectangularWall(x, y, "hhhh", bedBolts=None, move="right")
self.rectangularWall(x+d, y+d, "FFFF", bedBolts=None, move="right")
-
diff --git a/boxes/generators/typetray.py b/boxes/generators/typetray.py
index 3dfb32a90..80fd70106 100644
--- a/boxes/generators/typetray.py
+++ b/boxes/generators/typetray.py
@@ -14,8 +14,9 @@
# along with this program. If not, see .
from boxes import *
-from boxes import edges, Color
-from boxes.lids import _TopEdge, LidSettings
+from boxes import Color, edges
+from boxes.lids import LidSettings, _TopEdge
+
class FingerHoleEdgeSettings(edges.Settings):
"""Settings for FingerHoleEdge
diff --git a/boxes/generators/ubox.py b/boxes/generators/ubox.py
index 6e2a5a3a4..05f7e8f54 100644
--- a/boxes/generators/ubox.py
+++ b/boxes/generators/ubox.py
@@ -14,7 +14,7 @@
# along with this program. If not, see .
from boxes import *
-from boxes.lids import _TopEdge, LidSettings
+from boxes.lids import LidSettings, _TopEdge
class UBox(_TopEdge):
@@ -81,7 +81,7 @@ def Uwall(self, x, y, h, r, edges="ee", move=None, label=""):
self.edgeCorner("F", e[nr])
e[nr](h)
self.edgeCorner(e[nr], "F")
-
+
self.move(tw, th, move, label=label)
def render(self):
@@ -99,5 +99,3 @@ def render(self):
self.drawLid(x, h, self.top_edge)
self.lid(x, h, self.top_edge)
-
-
diff --git a/boxes/generators/unevenheightbox.py b/boxes/generators/unevenheightbox.py
index 871e9ea5d..b6318faa5 100644
--- a/boxes/generators/unevenheightbox.py
+++ b/boxes/generators/unevenheightbox.py
@@ -98,6 +98,3 @@ def render(self):
(" only" if h2 == h1 == 0.0 else ""))
self.trapezoidWall(x, h1, h0, "FF" + edge_types[0] + "F", move="right" +
(" only" if h1 == h0 == 0.0 else ""))
-
-
-
diff --git a/boxes/generators/universalbox.py b/boxes/generators/universalbox.py
index b3f136af1..9f1f6cfd5 100644
--- a/boxes/generators/universalbox.py
+++ b/boxes/generators/universalbox.py
@@ -14,9 +14,10 @@
# along with this program. If not, see .
from boxes import *
+from boxes import lids
from boxes.edges import Bolts
from boxes.lids import _TopEdge
-from boxes import lids
+
class UniversalBox(_TopEdge):
"""Box with various options for different styles and lids"""
@@ -101,5 +102,3 @@ def render(self):
self.rectangularWall(y, h, [b, "f", tr, "f"],
ignore_widths=[1, 6],
bedBolts=[d3], move="up", label="right")
-
-
diff --git a/boxes/generators/waivyknob.py b/boxes/generators/waivyknob.py
index 3004fa063..0d1fdf644 100644
--- a/boxes/generators/waivyknob.py
+++ b/boxes/generators/waivyknob.py
@@ -15,9 +15,10 @@
from boxes import *
+
class WaivyKnob(Boxes):
"""Round knob serrated outside for better gripping"""
-
+
ui_group = "Part"
def __init__(self) -> None:
@@ -54,5 +55,3 @@ def render(self):
callback=lambda: self.nutHole(self.hexhead),
move="right")
self.parts.waivyKnob(self.diameter, self.serrations, angle)
-
-
diff --git a/boxes/generators/wallcaliperholder.py b/boxes/generators/wallcaliperholder.py
index 1a34058e5..fe98af417 100644
--- a/boxes/generators/wallcaliperholder.py
+++ b/boxes/generators/wallcaliperholder.py
@@ -15,6 +15,7 @@
from boxes.walledges import _WallMountedBox
+
class WallCaliper(_WallMountedBox):
"""Holds a single caliper to a wall"""
@@ -40,7 +41,7 @@ def side(self, move=None):
if self.move(tw, h, move, True):
return
-
+
self.moveTo(self.edges["b"].startwidth())
self.polyline(5*t+hc, (90, 2*t), h/2-2*t, (180, 1.5*t), 0.25*h,
-90, hc, -90, 0.75*h-2*t, (90, 2*t), 2*t, 90)
@@ -54,7 +55,7 @@ def render(self):
t = self.thickness
h = self.h
-
+
self.side(move="right")
self.side(move="right")
w = self.width
diff --git a/boxes/generators/wallchiselholder.py b/boxes/generators/wallchiselholder.py
index cd2cde92c..848aab4b4 100644
--- a/boxes/generators/wallchiselholder.py
+++ b/boxes/generators/wallchiselholder.py
@@ -16,6 +16,7 @@
from boxes import *
from boxes.walledges import _WallMountedBox
+
class FrontEdge(edges.Edge):
def __call__(self, length, **kw):
@@ -29,8 +30,8 @@ def __call__(self, length, **kw):
for i in range(self.number):
self.polyline(l, (180-a, r), 0, (-360+2*a, rh), 0, (180-a, r), l)
-
-
+
+
class WallChiselHolder(_WallMountedBox):
"""Wall tool holder for chisels, files and similar tools"""
@@ -85,11 +86,11 @@ def backCB(self):
rt = self.holediameter
wt = self.tooldiameter
t = self.thickness
-
+
d = min(2*t, (wt-rt)/4.)
self.wallHolesAt(d, 0, self.h, 90)
self.wallHolesAt(n*wt-d, 0, self.h, 90)
-
+
for i in range(1, n):
if self.brace(i):
self.wallHolesAt(i*wt, 0, self.h, 90)
@@ -100,11 +101,11 @@ def topCB(self):
wt = self.tooldiameter
t = self.thickness
l = self.depth
-
+
d = min(2*t, (wt-rt)/4.)
self.fingerHolesAt(d, 0, l, 90)
self.fingerHolesAt(n*wt-d, 0, l, 90)
-
+
for i in range(1, n):
if self.brace(i):
self.fingerHolesAt(i*wt, 0, l, 90)
diff --git a/boxes/generators/wallconsole.py b/boxes/generators/wallconsole.py
index ebdf7e332..6b769c1c2 100644
--- a/boxes/generators/wallconsole.py
+++ b/boxes/generators/wallconsole.py
@@ -15,6 +15,7 @@
from boxes.walledges import _WallMountedBox
+
class WallConsole(_WallMountedBox):
"""Outset and angled plate to mount stuff to"""
@@ -56,7 +57,7 @@ def render(self):
bd = self.bottom_depth
self.front = (h**2 + (td-bd)**2)**0.5
-
+
self.rectangularWall(x, h, "eCec", callback=[self.backHoles],
move="up")
self.rectangularWall(x, self.front, "eFeF",
diff --git a/boxes/generators/walldrillbox.py b/boxes/generators/walldrillbox.py
index dc3b7e24f..17891262d 100644
--- a/boxes/generators/walldrillbox.py
+++ b/boxes/generators/walldrillbox.py
@@ -15,6 +15,7 @@
from boxes import *
from boxes.walledges import _WallMountedBox
+
from .drillstand import DrillStand
@@ -47,7 +48,7 @@ def render(self):
self.xOutsideWall(sh[-1], "hCec", move="up")
self.rectangularWall(x/math.cos(bottom_angle)-t*math.tan(bottom_angle), y, "fefe", callback=[self.bottomCB], move="up")
-
+
self.sideWall(edges="eBf", foot_height=2*t, move="right")
for i in range(1, len(sx)):
self.yWall(i, move="right")
diff --git a/boxes/generators/walledges.py b/boxes/generators/walledges.py
index 90ccc3d2c..71c597826 100644
--- a/boxes/generators/walledges.py
+++ b/boxes/generators/walledges.py
@@ -15,6 +15,7 @@
from boxes.walledges import _WallMountedBox
+
class WallEdges(_WallMountedBox):
"""Shows the different edge types for wall systems"""
diff --git a/boxes/generators/wallpinrow.py b/boxes/generators/wallpinrow.py
index 81f0216fb..18ff72e5a 100644
--- a/boxes/generators/wallpinrow.py
+++ b/boxes/generators/wallpinrow.py
@@ -16,6 +16,7 @@
from boxes import *
from boxes.walledges import _WallMountedBox
+
class PinEdge(edges.BaseEdge):
def __call__(self, length, **kw):
w2 = self.settings.pinwidth/2
@@ -23,7 +24,7 @@ def __call__(self, length, **kw):
s = self.settings.pinspacing
inc = self.settings.pinspacing_increment
t = self.settings.thickness
-
+
pin = [0, -90, l+t-w2, (180, w2), l+t-w2, -90]
self.edge(s/2-w2)
@@ -67,7 +68,7 @@ def __init__(self) -> None:
self.argparser.add_argument(
"--h", action="store", type=float, default=50.0,
help="height of the front plate (in mm) - needs to be at least 7 time the thickness")
-
+
def frontCB(self):
s = self.pinspacing
inc = self.pinspacing_increment
@@ -83,7 +84,7 @@ def frontCB(self):
for i in range(1, self.hooks-1):
self.fingerHolesAt(i*self.x/(self.hooks-1), self.h/2, self.h/2)
-
+
def backCB(self):
t = self.thickness
self.fingerHolesAt(0, 2*t, self.x, 0)
@@ -99,14 +100,14 @@ def sideWall(self, move=None):
t = self.thickness
sh = math.sin(ar)*6*t + math.cos(ar)*h
-
+
tw = self.edges["a"].margin() + math.sin(ar)*h + math.cos(ar)*6*t
th = sh + 6
if self.move(tw, th, move, True):
return
self.moveTo(self.edges["a"].margin())
-
+
self.polyline(math.sin(ar)*h, a, 4*t)
self.fingerHolesAt(-3.5*t, 0, h/2, 90)
self.edgeCorner("e", "h")
@@ -114,10 +115,10 @@ def sideWall(self, move=None):
self.polyline(0, 90-a, math.cos(ar)*6*t, 90)
self.edges["a"](sh)
self.corner(90)
-
+
self.move(tw, th, move)
-
+
def supportWall(self, move=None):
a = self.angle
ar = math.radians(a)
@@ -125,7 +126,7 @@ def supportWall(self, move=None):
t = self.thickness
sh = math.sin(ar)*6*t + math.cos(ar)*h
-
+
tw = self.edges["a"].margin() + max(
math.sin(ar)*h/2 + math.cos(ar)*5*t,
math.sin(ar)*h)
@@ -148,10 +149,10 @@ def supportWall(self, move=None):
else:
self.edges["a"](h/2)
self.corner(90)
-
+
self.move(tw, th, move)
-
-
+
+
def render(self):
self.generateWallEdges()
diff --git a/boxes/generators/wallplaneholder.py b/boxes/generators/wallplaneholder.py
index 5e67bdbd1..e4e9acade 100644
--- a/boxes/generators/wallplaneholder.py
+++ b/boxes/generators/wallplaneholder.py
@@ -15,6 +15,7 @@
from boxes.walledges import _WallMountedBox
+
class WallPlaneHolder(_WallMountedBox):
"""Hold a plane to a wall"""
diff --git a/boxes/generators/wallpliersholder.py b/boxes/generators/wallpliersholder.py
index 0c511b0f6..40a62f3a0 100644
--- a/boxes/generators/wallpliersholder.py
+++ b/boxes/generators/wallpliersholder.py
@@ -16,6 +16,7 @@
from boxes import *
from boxes.walledges import _WallMountedBox
+
class WallPliersHolder(_WallMountedBox):
"""Bar to hang pliers on"""
@@ -30,7 +31,7 @@ def __init__(self) -> None:
def brace(self, h, d, a, outside=False, move=None):
t = self.thickness
-
+
tw = d + self.edges["b"].spacing() + self.edges["f"].spacing()
th = self.h_t
@@ -74,15 +75,14 @@ def render(self):
if self.outside:
self.sx = self.adjustSize(self.sx)
-
+
sx, y, h = self.sx, self.y, self.h
t = self.thickness
r = y / 4
self.h_t = h + (y+t-r) * math.tan(math.radians(90-self.angle)) + r
-
+
self.rectangularWall(sum(sx) + (len(sx)-1) * t, h, "efef", callback=[self.frontCB], move="up")
self.rectangularWall(sum(sx) + (len(sx)-1) * t, self.h_t, "eCec", callback=[self.backCB], move="up")
for i in range(len(sx)+1):
self.brace(h, y, self.angle, i<2, move="right")
-
diff --git a/boxes/generators/wallrack.py b/boxes/generators/wallrack.py
index 88717a1d4..d28b7f807 100644
--- a/boxes/generators/wallrack.py
+++ b/boxes/generators/wallrack.py
@@ -13,9 +13,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
-from boxes import *
from functools import partial
+from boxes import *
+
class WallRack(Boxes):
"""Wall mountable rack for spices or other items"""
diff --git a/boxes/generators/wallrollholder.py b/boxes/generators/wallrollholder.py
index 8728974a0..579c0c4ed 100644
--- a/boxes/generators/wallrollholder.py
+++ b/boxes/generators/wallrollholder.py
@@ -16,11 +16,12 @@
from boxes import *
from boxes.walledges import _WallMountedBox
+
class WallRollHolder(_WallMountedBox):
"""Holder for kitchen rolls or other rolls"""
description = """Needs a dowel or pipe as axle."""
-
+
ui_group = "WallMounted"
def __init__(self) -> None:
@@ -65,7 +66,7 @@ def side(self, move=None):
self.corner(90-alpha, r)
self.edge(self.edges["B"].startwidth())
self.corner(90)
-
+
self.move(tw, th, move)
def backCB(self):
@@ -75,7 +76,7 @@ def backCB(self):
w = self.width
plate = w + 2*t + h/2
-
+
self.wallHolesAt(h/4+t/2-3*t, 0, h, 90)
self.fingerHolesAt(h/4-3*t, h-3*t-a/2, h/4, 180)
@@ -86,14 +87,14 @@ def rings(self):
a = self.axle
r = a/2
t = self.thickness
-
+
self.moveTo(0, a+1.5*t, -90)
for i in range(2):
self.polyline(r-1.5*t, (180, r+3*t), 0, (180, 1.5*t), 0,
(-180, r), r-1.5*t, (180, 1.5*t))
self.moveTo(a-t, a+12*t, 180)
-
-
+
+
def render(self):
self.generateWallEdges()
diff --git a/boxes/generators/wallslottedholder.py b/boxes/generators/wallslottedholder.py
index 10ee721cd..61bf43dc7 100644
--- a/boxes/generators/wallslottedholder.py
+++ b/boxes/generators/wallslottedholder.py
@@ -16,6 +16,7 @@
from boxes import *
from boxes.walledges import _WallMountedBox
+
class FrontEdge(edges.Edge):
def __call__(self, length, **kw):
@@ -27,7 +28,7 @@ def __call__(self, length, **kw):
w = (wt-ws)/2 - r1
for i in range(self.number):
self.polyline(w, (90, r1), ds-r1-r2, (-90, r2), ws-2*r2,
- (-90, r2), ds-r1-r2, (90, r1), w)
+ (-90, r2), ds-r1-r2, (90, r1), w)
class WallSlottedHolder(_WallMountedBox):
"""Wall tool holder with slots"""
@@ -85,11 +86,11 @@ def backCB(self):
ws = self.slot_width
wt = self.tool_width
t = self.thickness
-
+
d = min(2*t, (wt-ws)/4.)
self.wallHolesAt(d, 0, self.h, 90)
self.wallHolesAt(n*wt-d, 0, self.h, 90)
-
+
for i in range(1, n):
if self.brace(i):
self.wallHolesAt(i*wt, 0, self.h, 90)
@@ -100,11 +101,11 @@ def topCB(self):
wt = self.tool_width
t = self.thickness
l = self.additional_depth + self.slot_depth
-
+
d = min(2*t, (wt-ws)/4.)
self.fingerHolesAt(d, 0, l, 90)
self.fingerHolesAt(n*wt-d, 0, l, 90)
-
+
for i in range(1, n):
if self.brace(i):
self.fingerHolesAt(i*wt, 0, l, 90)
diff --git a/boxes/generators/wallstairs.py b/boxes/generators/wallstairs.py
index 16c75531a..f67518e67 100644
--- a/boxes/generators/wallstairs.py
+++ b/boxes/generators/wallstairs.py
@@ -15,6 +15,7 @@
from boxes.walledges import _WallMountedBox
+
class WallStairs(_WallMountedBox):
"""Platforms in different heights e.g. for screw drivers"""
@@ -29,10 +30,10 @@ def __init__(self) -> None:
self.argparser.add_argument(
"--braceheight", action="store", type=float, default=30,
help="height of the brace at the bottom back (in mm). Zero for none")
-
+
def yWall(self, move=None):
t = self.thickness
- x, sx, y, sy, sh = self.x, self.sx, self.y, self.sy, self.sh
+ x, sx, y, sy, sh = self.x, self.sx, self.y, self.sy, self.sh
tw, th = sum(sy), max(sh) + t
@@ -49,7 +50,7 @@ def yWall(self, move=None):
self.step(sh[i-1]-sh[i])
self.edges["f"](sy[0])
self.polyline(0, 90, sh[0], 90)
-
+
self.move(tw, th, move)
def yCB(self, width):
@@ -58,7 +59,7 @@ def yCB(self, width):
for dx in self.sx[:-1]:
posx += dx + t
self.fingerHolesAt(posx, 0, width, 90)
-
+
def render(self):
self.generateWallEdges()
@@ -76,6 +77,6 @@ def render(self):
self.rectangularWall(
x, self.braceheight, "eheh",
callback=[lambda:self.yCB(self.braceheight)], move="up")
-
+
for i in range(len(sx) + 1):
self.yWall(move="right")
diff --git a/boxes/generators/walltypetray.py b/boxes/generators/walltypetray.py
index ca39f3151..3d84fb912 100644
--- a/boxes/generators/walltypetray.py
+++ b/boxes/generators/walltypetray.py
@@ -17,6 +17,7 @@
from boxes.lids import _TopEdge
from boxes.walledges import _WallMountedBox
+
class WallTypeTray(_WallMountedBox, _TopEdge):
"""Type tray - allows only continuous walls"""
@@ -30,7 +31,7 @@ def __init__(self) -> None:
self.argparser.add_argument(
"--radius", action="store", type=float, default=0.0,
help="radius for strengthening walls with the hooks")
-
+
def xSlots(self):
posx = -0.5 * self.thickness
@@ -66,7 +67,7 @@ def render(self):
self.generateWallEdges()
b = self.bottom_edge
-
+
if self.outside:
self.sx = self.adjustSize(self.sx)
self.sy = self.adjustSize(self.sy)
@@ -120,7 +121,3 @@ def render(self):
e = [edges.SlottedEdge(self, self.sy, be, slots=0.5 * hi),
"f", "e", "f"]
self.rectangularWall(y, hi, e, move="up")
-
-
-
-
diff --git a/boxes/generators/wallwrenchholder.py b/boxes/generators/wallwrenchholder.py
index aef113c85..6d22c2d83 100644
--- a/boxes/generators/wallwrenchholder.py
+++ b/boxes/generators/wallwrenchholder.py
@@ -16,17 +16,18 @@
from boxes import *
from boxes.walledges import _WallMountedBox
+
class SlottedEdge(edges.Edge):
def __call__(self, length, **kw):
n = self.number
t = self.thickness
-
+
self.polyline(t, 45)
l = t
-
+
for i in range(n):
w = self.min_width * ((n-i)/n) + self.max_width * (i / n)
s = self.min_strength * ((n-i)/n) + self.max_strength * (i / n)
@@ -82,7 +83,7 @@ def render(self):
+ self.max_width)
t = self.thickness
x = self.x-2*t
-
+
self.rectangularWall(self.depth, h,
["e", "B", "e", SlottedEdge(self, None)],
move="right")
diff --git a/boxes/generators/winerack.py b/boxes/generators/winerack.py
index db0efe57e..de89971f2 100644
--- a/boxes/generators/winerack.py
+++ b/boxes/generators/winerack.py
@@ -15,9 +15,10 @@
from boxes import *
+
class WineRack(Boxes):
"""Honey Comb Style Wine Rack"""
-
+
ui_group = "Shelf"
def __init__(self) -> None:
@@ -58,7 +59,7 @@ def wallCB(self, frontwall=False, backwall=False):
self.moveTo((x-dx*2*cx)/2, (y-ty) / 2)
wmin = self.walls == "minimal"
-
+
for i in range(cy//2 + cy % 2):
if not frontwall and self.walls == "all":
self.hexFingerHoles(0, (2*r+2*dy)*i+dy, r, 90)
@@ -96,13 +97,13 @@ def wallCB(self, frontwall=False, backwall=False):
if j < cx -1:
self.hexFingerHoles(j*2*dx+dx, (2*r+2*dy)*i, r, 30)
-
+
def render(self):
x, y, h, radius = self.x, self.y, self.h, self.radius
t = self.thickness
r = self.r = 2 * (radius + t) * math.tan(math.pi/6)
-
+
self.dx = dx = r * math.cos(math.pi/6)
self.dy = dy = r * math.sin(math.pi/6)
self.cx = cx = int((x-2*t) // (2*dx))
@@ -128,5 +129,3 @@ def render(self):
tc += 2 * cx - 2 # very top row
self.partsMatrix(tc, cx, "up", self.rectangularWall, r-2*self.delta, h, "fefe")
-
-
diff --git a/boxes/lids.py b/boxes/lids.py
index ffadbde47..8c8da449a 100644
--- a/boxes/lids.py
+++ b/boxes/lids.py
@@ -13,10 +13,12 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
-from boxes import edges, Boxes
-import boxes
import math
+import boxes
+from boxes import Boxes, edges
+
+
class LidSettings(edges.Settings):
"""Settings for the Lid
@@ -168,7 +170,7 @@ def knobHandle(self, x, y, style, move=None):
poly = [(90, t/2), t/2, 90, t/2, -90]
poly += [hh - 2*t, (90, 3*t)]
-
+
for bottom, top in (([3*t, 90, 2*t + hh/2, -90, t, -90, hh/2 + 2*t, 90, 3*t], [t]),
([7*t], [0, 90, hh/2, -90, t, -90, hh/2, 90, 0])) :
self.moveTo(0.5*t)
@@ -335,4 +337,3 @@ def drawLid(self, x, y, top_edge, bedBolts=[None, None]):
else:
return False
return True
-
diff --git a/boxes/parts.py b/boxes/parts.py
index 11c626da1..cc3f00280 100644
--- a/boxes/parts.py
+++ b/boxes/parts.py
@@ -20,7 +20,7 @@ def roundKnob(self, diameter, n=20, callback=None, move=""):
return
self.moveTo(size/2, size/2)
self.cc(callback, None, 0, 0)
-
+
self.move(size, size, move)
"""
diff --git a/boxes/qrcode_factory.py b/boxes/qrcode_factory.py
index 3d62be1fc..8760f4212 100644
--- a/boxes/qrcode_factory.py
+++ b/boxes/qrcode_factory.py
@@ -1,7 +1,9 @@
from decimal import Decimal
+
import qrcode.image.base
import qrcode.image.svg
+
class BoxesQrCodeFactory(qrcode.image.base.BaseImage):
"""
SVG image builder
diff --git a/boxes/servos.py b/boxes/servos.py
index f7c0b35b2..606b4f3e6 100644
--- a/boxes/servos.py
+++ b/boxes/servos.py
@@ -84,7 +84,7 @@ class Servo9g(Servo):
width = 12.0
axle_pos = 6.0
servo_axle = 4.6 # 6.9 for servo arm
-
+
def top(self, x=0.0, y=0.0, angle=90.0):
self.boxes.moveTo(x, y, angle)
self.boxes.hole(6, 0, 6)
diff --git a/boxes/walledges.py b/boxes/walledges.py
index b5556242f..4fb5c71ef 100644
--- a/boxes/walledges.py
+++ b/boxes/walledges.py
@@ -1,9 +1,11 @@
from __future__ import annotations
+
import math
from typing import Any
from boxes import Boxes, edges
-from .edges import Settings, BaseEdge
+
+from .edges import BaseEdge, Settings
class _WallMountedBox(Boxes):
diff --git a/documentation/boxes.xml b/documentation/boxes.xml
index 3f831f0b8..10253f5a3 100644
--- a/documentation/boxes.xml
+++ b/documentation/boxes.xml
@@ -133,4 +133,3 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/
-
diff --git a/documentation/boxesserver.xml b/documentation/boxesserver.xml
index 9bfd4cee6..d6d17a293 100644
--- a/documentation/boxesserver.xml
+++ b/documentation/boxesserver.xml
@@ -130,4 +130,3 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/
-
diff --git a/documentation/src/api_arguments.rst b/documentation/src/api_arguments.rst
index 8f35caf36..7b93e45bc 100644
--- a/documentation/src/api_arguments.rst
+++ b/documentation/src/api_arguments.rst
@@ -73,4 +73,3 @@ the Boxes instance before ``.render()`` is called. This is done by
``Boxes.parseArgs``. But most people won't need to care as this is
handled by the framework. Be careful to **not overwrite important
methods or attributes by using conflicting argument names**.
-
diff --git a/documentation/src/api_burn.rst b/documentation/src/api_burn.rst
index 7b68fe877..ea6552788 100644
--- a/documentation/src/api_burn.rst
+++ b/documentation/src/api_burn.rst
@@ -35,8 +35,8 @@ Programmer's perspective
------------------------
For this to work it is important that outside is drawn in a
-counterclockwise direction while holes are drawn in a
-clockwise direction.
+counterclockwise direction while holes are drawn in a
+clockwise direction.
:py:meth:`boxes.Boxes.corner` adjusts the radius automatically
according to **.burn**. This propagates to higher level
diff --git a/documentation/src/api_edges.rst b/documentation/src/api_edges.rst
index 93e3d3b50..7e77477c8 100644
--- a/documentation/src/api_edges.rst
+++ b/documentation/src/api_edges.rst
@@ -48,7 +48,7 @@ A set of instances are kept in the ``.edges`` attribute of the
* m : LidLeft
* N : LidSideRight
* n : LidRight
-* Oo : ChestHinge
+* Oo : ChestHinge
* Pp : ChestHingeTop
* Q : ChestHingeFront
* q : ChestHingePin
@@ -155,7 +155,7 @@ Dovetail Settings
.. autoclass:: boxes.edges.DoveTailSettings
:members:
-
+
Flex
----
.. autoclass:: boxes.edges.FlexEdge
@@ -173,7 +173,7 @@ Slots
CompoundEdge
------------
.. autoclass:: boxes.edges.CompoundEdge
-
+
Hinges
------
diff --git a/documentation/src/api_generator.rst b/documentation/src/api_generator.rst
index 34fb609e0..26be04453 100644
--- a/documentation/src/api_generator.rst
+++ b/documentation/src/api_generator.rst
@@ -12,7 +12,7 @@ write the ``.__init__()`` and ``.render()`` method.
The Boxes class keeps a canvas object (self.ctx) that all
drawing is made on. In addition it keeps a couple of global settings
used for various drawing operations. See the ``.__init__()`` method
-for the details.
+for the details.
For implementing a new generator forking an existing one or using the
``boxes/generators/_template.py`` is probably easier than starting
@@ -23,7 +23,7 @@ methods are the interface for the user interfaces to interact with the
generators:
.. automethod:: boxes.Boxes.__init__
-
+
.. automethod:: boxes.Boxes.parseArgs
.. automethod:: boxes.Boxes.render
@@ -32,7 +32,7 @@ generators:
Handling Generators
-------------------
-
+
To handle the generators there is code in the ``boxes.generators``
package.
diff --git a/documentation/src/boxes2rst.py b/documentation/src/boxes2rst.py
index 342639869..8dd98bce9 100755
--- a/documentation/src/boxes2rst.py
+++ b/documentation/src/boxes2rst.py
@@ -14,8 +14,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
-import sys
import os.path
+import sys
try:
import boxes.generators
diff --git a/documentation/src/index.rst b/documentation/src/index.rst
index 88e65f8e5..3cf232b18 100644
--- a/documentation/src/index.rst
+++ b/documentation/src/index.rst
@@ -10,7 +10,7 @@ Contents:
.. toctree::
:maxdepth: 1
-
+
README
faq
install
diff --git a/documentation/src/install.rst b/documentation/src/install.rst
index fa7d4fa86..6966fad9e 100644
--- a/documentation/src/install.rst
+++ b/documentation/src/install.rst
@@ -110,4 +110,3 @@ Platform specific instructions
:glob:
install/*
-
diff --git a/documentation/src/install/log-wsl-win11.txt b/documentation/src/install/log-wsl-win11.txt
index 90e9b8d54..d1c474bcc 100644
--- a/documentation/src/install/log-wsl-win11.txt
+++ b/documentation/src/install/log-wsl-win11.txt
@@ -170,4 +170,4 @@ BoxesServer serving on host:port :8000...
127.0.0.1 - - [13/Oct/2022 12:07:03] "GET /static/samples/TypeTray-thumb.jpg HTTP/1.1" 200 3553
127.0.0.1 - - [13/Oct/2022 12:07:03] "GET /static/samples/TrafficLight-thumb.jpg HTTP/1.1" 200 4100
127.0.0.1 - - [13/Oct/2022 12:07:05] "GET /static/samples/ HTTP/1.1" 404 9
-^CBoxesServer stops.
\ No newline at end of file
+^CBoxesServer stops.
diff --git a/documentation/src/install/windows.rst b/documentation/src/install/windows.rst
index fb350d279..ce6a3edc0 100644
--- a/documentation/src/install/windows.rst
+++ b/documentation/src/install/windows.rst
@@ -32,7 +32,7 @@ Following steps are known to work under Windows 10/11 (64-bit):
3. Run the command :code:`pip install Markdown affine shapely qrcode`
(Note: If the command pip is not found, you probably forgot to add the
Python installation to the PATH environment variable in step 2)
-
+
4. Download Boxes.py as ZIP archive from GitHub
.. figure:: windows_browser_download_boxespy.png
diff --git a/documentation/src/static b/documentation/src/static
index 382349a77..1bf4a07ba 120000
--- a/documentation/src/static
+++ b/documentation/src/static
@@ -1 +1 @@
-../../static/
\ No newline at end of file
+../../static/
diff --git a/documentation/src/usermanual.rst b/documentation/src/usermanual.rst
index c25f5170f..4428a7c5f 100644
--- a/documentation/src/usermanual.rst
+++ b/documentation/src/usermanual.rst
@@ -114,7 +114,7 @@ support this features but there may be some that don't.
For plywood values of 0.2 to 0.3mm still allow getting the parts out
by hand (Depending on you laser cutter and the exact material). With
-little more you will need a knife to cut them loose.
+little more you will need a knife to cut them loose.
inner_corners
.............
@@ -237,7 +237,7 @@ The generated files uses the following color conventions:
.. glossary::
- Black
+ Black
The outer edges of a part
Blue
@@ -249,5 +249,5 @@ The generated files uses the following color conventions:
Green
Etchings
-Normally you will cut things in the order: Green, Blue, Black. If other
+Normally you will cut things in the order: Green, Blue, Black. If other
colors are present, the meaning should hopefully be obvious.
diff --git a/po/de.po b/po/de.po
index b3f5a4b60..beefa1394 100644
--- a/po/de.po
+++ b/po/de.po
@@ -1335,7 +1335,7 @@ msgstr "Getriebe"
#. description of GearBox
#: boxes/generators/gearbox.py
msgid "Gearbox with multiple identical stages"
-msgstr "Getriebe mit mehreren gleichen Zahnradpaaren"
+msgstr "Getriebe mit mehreren gleichen Zahnradpaaren"
msgid "GearBox Settings"
msgstr "Einstellung Getriebe"
diff --git a/scripts/Dockerfile b/scripts/Dockerfile
index 7ee8af276..742fe22bb 100644
--- a/scripts/Dockerfile
+++ b/scripts/Dockerfile
@@ -5,7 +5,7 @@
# Build with
# docker build -t boxes.py .
-# Run with
+# Run with
# docker run -ti -p 4000:8000 boxes.py
# to get the web interface at localhost:4000
# First access may take a while as the Python files need to be complied
diff --git a/scripts/boxes b/scripts/boxes
index 1496b1012..1c049f095 100755
--- a/scripts/boxes
+++ b/scripts/boxes
@@ -15,9 +15,9 @@ Options:
--list List available generators.
"""
+import gettext
import os
import sys
-import gettext
try:
import boxes
diff --git a/scripts/boxes_proxy.py b/scripts/boxes_proxy.py
index 9ebef73c1..0800ab3b9 100755
--- a/scripts/boxes_proxy.py
+++ b/scripts/boxes_proxy.py
@@ -12,10 +12,11 @@
License: GNU GPL v3
"""
-import os
+pass
import subprocess
import sys
-import tempfile
+
+pass
from shlex import quote
from inkex.extensions import GenerateExtension
diff --git a/scripts/boxesserver b/scripts/boxesserver
index 56c84f4a6..ef4e86282 100755
--- a/scripts/boxesserver
+++ b/scripts/boxesserver
@@ -19,6 +19,7 @@ import argparse
import gettext
import glob
import html
+import io
import mimetypes
import os.path
import re
@@ -27,12 +28,11 @@ import threading
import time
import traceback
from typing import Any, NoReturn
-from urllib.parse import unquote_plus, quote
+from urllib.parse import quote, unquote_plus
from wsgiref.simple_server import make_server
import markdown
import qrcode
-import io
try:
import boxes.generators
@@ -334,10 +334,10 @@ class BServer:
{_(group.title)}
diff --git a/setup.py b/setup.py
index 22f3f4cbf..e87e54f05 100755
--- a/setup.py
+++ b/setup.py
@@ -3,8 +3,9 @@
import glob
import os
import sys
-from subprocess import check_output, CalledProcessError
-from setuptools import setup, find_packages
+from subprocess import CalledProcessError, check_output
+
+from setuptools import find_packages, setup
from setuptools.command.build_py import build_py
diff --git a/static/fonts.css b/static/fonts.css
index 05c4fbbf6..7747f4c61 100644
--- a/static/fonts.css
+++ b/static/fonts.css
@@ -38,4 +38,4 @@
font-weight: 400;
src: url('./fonts/luckiestguy/luckiest-guy-latin-400-normal.woff2') format('woff2');
unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
-}
\ No newline at end of file
+}
diff --git a/static/self.js b/static/self.js
index 06af0f6d8..df063e42a 100644
--- a/static/self.js
+++ b/static/self.js
@@ -29,7 +29,7 @@ function collapseId(id) {
h.classList.remove("open");
h.setAttribute("aria-expanded", "false");
}
-
+
function toggleId(id) {
const e = document.getElementById(id);
const h = document.getElementById("h-" + id);
@@ -96,7 +96,7 @@ function GridfinityTrayLayout_GenerateLayout(x, y, nx, ny, countx, county) {
// countx split x into this many
// county split y into this many
layout = '';
- if (countx == 0)
+ if (countx == 0)
countx = nx;
if (county == 0)
county = ny
@@ -151,7 +151,7 @@ function GridfinityTrayLayoutInit() {
layout_id = document.getElementById('layout');
layout_id.addEventListener('change', setUpdated);
layout_id.addEventListener('input', setUpdated);
-
+
GridfinityTrayUpdateLayout();
layout_id = document.getElementById('layout');
layout_id.rows = 20;
@@ -193,7 +193,7 @@ function TrayLayout_GenerateLayout(sx, sy) {
nx = 1;
if (ny <= 0)
ny = 1;
-
+
for (i = 0; i < nx; i++) {
line = ' |'.repeat(i) + ` ,> ${sx[i].toFixed(2)}mm\n`;
layout += line;