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

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

Abstract base class for all Edges

endAngle()[source]

Not yet supported

margin()[source]

Space needed right of the starting point

spacing()[source]

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

startAngle()[source]

Not yet supported

startwidth()[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=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.

checkValues()[source]

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

edgeObjects(boxes, chars='', add=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=True, **kw)[source]

Set values

Parameters
  • thickness – thickness of the material used

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

  • **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=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=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

checkValues()[source]

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

edgeObjects(boxes, chars='sS', add=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, **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=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

checkValues()[source]

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

edgeObjects(boxes, chars='fFh', add=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=1)[source]

Distribute a fixed number of bolts evenly

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

Edge with dove tail joints

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

edgeObjects(boxes, chars='dD', add=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=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

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

Edge with an slot to slid another pice through

class boxes.edges.SlottedEdge(boxes, sections, edge='e', slots=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=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

Hinge

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

HingePin

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