Edges¶
Edges are what makes Boxes.py work. They draw a – more or less – straight border to the current piece. They are part of the turtle graphics part of Boxes.py. This means they start at the current position and current direction and move the current position to the end of the edge.
Edge instances have a Settings object associated with them that keeps the details about what the edge should look like. Edges that are supposed to work together share the same Settings object to ensure they fit together - assuming they have the same length. Most edges are symmetrical to ensure they fit together even when drawn from different directions. Although there are a few exceptions - mainly edges that provide special features like hinges.
As edges started out as methods of the main Boxes class they still are
callables. It turned out that the edges need to provide a bit more
information to allow the surrounding code to handle them
properly. When drawing an Edge there is a virtual straight line that
is the border the shape of the part (e.g. an rectangle). But the
actual Edge often has to be drawn elsewhere. The best example is probably
the F
Edge that matches the normal finger joints. It has to start
one material thickness outside of the virtual border of the part so the
cutouts for the opposing fingers just touch the border. The Edge
classes have a number of methods to deal with these kinds of offsets.
A set of instances are kept in the .edges
attribute of the
Boxes
class. It is a dict with strings of length one as keys:
aAbB : reserved to be used in generators
c : ClickConnector
C : ClickEdge
d : DoveTailJoint
D : DoveTailJointCounterPart
e : Edge
E : OutSetEdge
f : FingerJointEdge
F : FingerJointEdgeCounterPart
g : GrippingEdge
G : MountingEdge
h : FingerHoleEdge
ijk : Hinge (start, end, both sides)
IJK : HingePin (start, end, both sides)
L : LidHoleEdge
l : LidEdge
M : LidSideLeft
m : LidLeft
N : LidSideRight
n : LidRight
Oo : ChestHinge
Pp : ChestHingeTop
Q : ChestHingeFront
q : ChestHingePin
R : RackEdge
s : StackableEdge
S : StackableEdgeTop
š : StackableFeet
Š : StackableHoleEdgeTop
T : RoundedTriangleFingerHolesEdge
t : RoundedTriangleEdge
uUvV : CabinetHingeEdge
X : FlexEdge
y : HandleEdge
Y : HandleHoleEdge
Z : GroovedEdgeCounterPart
z : GroovedEdge
Edge base class¶
Settings Class¶
- class boxes.edges.Settings(thickness, relative: bool = True, **kw)[source]¶
Generic Settings class
Used by different other classes to store measurements and details. Supports absolute values and settings that grow with the thickness of the material used.
Overload the absolute_params and relative_params class attributes with the supported keys and default values. The values are available via attribute access.
Store values that are not supposed to be changed by the users in class or instance properties. This way API users can set them as needed while still be shared between all (Edge) instances using this settings object.
- checkValues() None [source]¶
Check if all values are in the right range. Raise ValueError if needed.
Straight Edges¶
Grip¶
Stackable Edges¶
- class boxes.edges.StackableEdge(boxes, settings, fingerjointsettings)[source]¶
Edge for having stackable Boxes. The Edge creates feet on the bottom and has matching recesses on the top corners.
Stackable Edge Settings¶
- class boxes.edges.StackableSettings(thickness, relative: bool = True, **kw)[source]¶
Settings for Stackable Edges
Values:
absolute_params
angle : 60 : inside angle of the feet
relative (in multiples of thickness)
height : 2.0 : height of the feet (multiples of thickness)
width : 4.0 : width of the feet (multiples of thickness)
holedistance : 1.0 : distance from finger holes to bottom edge (multiples of thickness)
bottom_stabilizers : 0.0 : height of strips to be glued to the inside of bottom edges (multiples of thickness)
Finger joints¶
Finger joints are a simple way of joining two sheets (e.g. of plywood). They work best at an 90° angle. There are two different sides matching each other. As a third alternative there are holes that the fingers of one sheet can plug into. This allows stable T connections especially useful for inner walls.
- class boxes.edges.FingerJointEdgeCounterPart(boxes, settings)[source]¶
Finger joint edge - other side
- class boxes.edges.FingerHoleEdge(boxes, fingerHoles=None, **kw)[source]¶
Edge with holes for a parallel finger joint
- class boxes.edges.CrossingFingerHoleEdge(boxes, height, fingerHoles=None, outset: float = 0.0, **kw)[source]¶
Edge with holes for finger joints 90° above
In addition there is
which is no Edge but fits FingerJointEdge
.
An instance of is accessible as Boxes.fingerHolesAt.
Finger Joint Settings¶
- class boxes.edges.FingerJointSettings(thickness, relative: bool = True, **kw)[source]¶
Settings for Finger Joints
Values:
absolute * style : “rectangular” : style of the fingers * surroundingspaces : 2.0 : space at the start and end in multiple of normal spaces
relative (in multiples of thickness)
space : 2.0 : space between fingers (multiples of thickness)
finger : 2.0 : width of the fingers (multiples of thickness)
width : 1.0 : width of finger holes (multiples of thickness)
edge_width : 1.0 : space below holes of FingerHoleEdge (multiples of thickness)
play : 0.0 : extra space to allow finger move in and out (multiples of thickness)
extra_length : 0.0 : extra material to grind away burn marks (multiples of thickness)
bottom_lip : 0.0 : height of the bottom lips sticking out (multiples of thickness) FingerHoleEdge only!
Bed Bolts¶
Dovetail Joints¶
Dovetails joints can only be used to join two pieces flatly. This limits their use to closing some round form created with flex areas or for joining several parts to a bigger one. For this use case they are much stronger than simple finger joints and can also bare pulling forces.
- class boxes.edges.DoveTailJointCounterPart(boxes, settings)[source]¶
Edge for other side of dove joints
Dovetail Settings¶
- class boxes.edges.DoveTailSettings(thickness, relative: bool = True, **kw)[source]¶
Settings for Dove Tail Joints
Values:
absolute
angle : 50 : how much should fingers widen (-80 to 80)
relative (in multiples of thickness)
size : 3 : from one middle of a dove tail to another (multiples of thickness)
depth : 1.5 : how far the dove tails stick out of/into the edge (multiples of thickness)
radius : 0.2 : radius used on all four corners (multiples of thickness)
Flex¶
- class boxes.edges.FlexEdge(boxes, settings)[source]¶
Edge with flex cuts - use straight edge for the opposing side
Flex Settings¶
- class boxes.edges.FlexSettings(thickness, relative: bool = True, **kw)[source]¶
Settings for Flex
Values:
absolute
stretch : 1.05 : Hint of how much the flex part should be shortened
relative (in multiples of thickness)
distance : 0.5 : width of the pattern perpendicular to the cuts (multiples of thickness)
connection : 1.0 : width of the gaps in the cuts (multiples of thickness)
width : 5.0 : width of the pattern in direction of the cuts (multiples of thickness)
Slots¶
CompoundEdge¶
Hinges¶
Hinge Settings¶
- class boxes.edges.HingeSettings(thickness, relative: bool = True, **kw)[source]¶
Settings for Hinges and HingePins Values:
absolute_params
style : “outset” : “outset” or “flush”
outset : False : have lid overlap at the sides (similar to OutSetEdge)
pinwidth : 1.0 : set to lower value to get disks surrounding the pins
grip_percentage” : 0 : percentage of the lid that should get grips
relative (in multiples of thickness)
hingestrength : 1 : thickness of the arc holding the pin in place (multiples of thickness)
axle : 2 : diameter of the pin hole (multiples of thickness)
grip_length : 0 : fixed length of the grips on he lids (multiples of thickness)