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

class boxes.edges.BaseEdge(boxes, settings)[source]

Abstract base class for all Edges

endAngle() float[source]

Not yet supported

margin() float[source]

Space needed right of the starting point

spacing() float[source]

Space the edge needs outside of the inner space of the part

startAngle() float[source]

Not yet supported

startwidth() float[source]

Amount of space the beginning of the edge is set below the inner space of the part

abstract BaseEdge.__call__(length, **kw)[source]

Call self as a function.

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.

edgeObjects(boxes, chars: str = '', add: bool = True)[source]

Generate Edge objects using this kind of settings

Parameters:
  • boxes – Boxes object

  • chars – sequence of chars to be used by Edge objects

  • add – add the resulting Edge objects to the Boxes object’s edges

setValues(thickness, relative: bool = True, **kw)[source]

Set values

Parameters:
  • thickness – thickness of the material used

  • relative – Do scale by thickness (Default value = True)

  • kw – parameters to set

Straight Edges

class boxes.edges.Edge(boxes, settings)[source]

Straight edge

class boxes.edges.OutSetEdge(boxes, settings)[source]

Straight edge out set by one thickness

Grip

class boxes.edges.GripSettings(thickness, relative: bool = True, **kw)[source]

Settings for GrippingEdge Values:

  • absolute_params

  • style : “wave” : “wave” or “bumps”

  • outset : True : extend outward the straight edge

  • relative (in multiples of thickness)

  • depth : 0.3 : depth of the grooves

class boxes.edges.GrippingEdge(boxes, settings)[source]

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.

class boxes.edges.StackableEdgeTop(boxes, settings, fingerjointsettings)[source]

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)

checkValues() None[source]

Check if all values are in the right range. Raise ValueError if needed.

edgeObjects(boxes, chars: str = 'sSšŠ', add: bool = True, fingersettings=None)[source]

Generate Edge objects using this kind of settings

Parameters:
  • boxes – Boxes object

  • chars – sequence of chars to be used by Edge objects

  • add – add the resulting Edge objects to the Boxes object’s edges

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.FingerJointEdge(boxes, settings)[source]

Finger joint edge

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

class boxes.edges.FingerHoles(boxes, settings)[source]

Hole matching a finger joint edge

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!

checkValues() None[source]

Check if all values are in the right range. Raise ValueError if needed.

edgeObjects(boxes, chars: str = 'fFh', add: bool = True)[source]

Generate Edge objects using this kind of settings

Parameters:
  • boxes – Boxes object

  • chars – sequence of chars to be used by Edge objects

  • add – add the resulting Edge objects to the Boxes object’s edges

Bed Bolts

class boxes.edges.BoltPolicy[source]

Abstract class

Distributes (bed) bolts on a number of segments (fingers of a finger joint)

class boxes.edges.Bolts(bolts: int = 1)[source]

Distribute a fixed number of bolts evenly

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.DoveTailJoint(boxes, settings)[source]

Edge with dove tail joints

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)

edgeObjects(boxes, chars: str = 'dD', add: bool = True)[source]

Generate Edge objects using this kind of settings

Parameters:
  • boxes – Boxes object

  • chars – sequence of chars to be used by Edge objects

  • add – add the resulting Edge objects to the Boxes object’s edges

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

class boxes.edges.Slot(boxes, depth)[source]

Edge with a slot to slide another piece through

class boxes.edges.SlottedEdge(boxes, sections, edge: str = 'e', slots: int = 0)[source]

Edge with multiple slots

CompoundEdge

class boxes.edges.CompoundEdge(boxes, types, lengths)[source]

Edge composed of multiple different Edges

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)

Hinge

class boxes.edges.Hinge(boxes, settings=None, layout: int = 1)[source]

HingePin

class boxes.edges.HingePin(boxes, settings=None, layout: int = 1)[source]