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 how 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 symetrical to unsure they fit together even when drawn from different directions. Although there are a few exception - 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 has often to be drawn elsewhere. Best example if probably
the F
Edge that matches the normal finger joints. It has to start
one material thickness outside of the virual 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 kind of offsets.
A set of instances are kept the .edges
attribute of the
Boxes
class. It is a dict with strings of length one as keys:
- d : DoveTailJoint
- D : DoveTailJointCounterPart
- e : Edge
- E : OutSetEdge
- f : FingerJointEdge
- F : FingerJointEdgeCounterPart
- g : GrippingEdge
- h : FingerHoleEdge
- ijk : Hinge (start, end, both sides)
- IJK : HingePin (start, end, both sides)
- s : StackableEdge
- S : StackableEdgeTop
Edge base class¶
Settings Class¶
-
class
boxes.edges.
Settings
(thickness, relative=True, **kw)[source]¶ Generic Settings class
Used by different other classes to store messurements 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 suported keys and default values. The values are available via attribute access.
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=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
- width : 4.0 : width of the feet
- holedistance : 1.0 : distance from finger holes to bottom edge
- absolute_params
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, **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=True, **kw)[source]¶ Settings for Finger Joints
Values:
- absolute * style : “rectangular” : style of the fingers * surroundingspaces : 2 : maximum space at the start and end in multiple of normal spaces * angle: 90 : Angle of the walls meeting
- relative (in multiples of thickness)
- space : 2.0 : space between fingers
- finger : 2.0 : width of the fingers
- width : 1.0 : width of finger holes
- edge_width : 1.0 : space below holes of FingerHoleEdge
- play : 0.0 : extra space to allow finger move in and out
Dove Tail 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
Dove Tail Settings¶
-
class
boxes.edges.
DoveTailSettings
(thickness, relative=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
- depth : 1.5 : how far the dove tails stick out of/into the edge
- radius : 0.2 : radius used on all four corners
- absolute
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=True, **kw)[source]¶ Settings for Flex
Values:
- absolute
- stretch : 1.05 : Hint of how much the flex part should be shortend
- relative (in multiples of thickness)
- distance : 0.5 : width of the pattern perpendicular to the cuts
- connection : 1.0 : width of the gaps in the cuts
- width” : 5.0 : width of the pattern in direction of the cuts
Slots¶
CompoundEdge¶
Hinges¶
Hinge Settings¶
-
class
boxes.edges.
HingeSettings
(thickness, relative=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
- axle : 2 : diameter of the pin hole
- grip_length : 0 : fixed length of the grips on he lids