BoxesPy pour instance Profouzors
Go to file
Florian Festi 46ef5903c8 Add box2.py - a simple, open box 2014-03-15 15:03:38 +01:00
examples Add box2.py - a simple, open box 2014-03-15 15:03:38 +01:00
.gitignore Add .gitignore file 2014-02-24 19:33:47 +01:00
README.txt Fix typos 2013-04-17 20:20:30 +09:00
TODO.txt Fix hexHolesRectangle and add skip param 2013-04-16 23:52:06 +09:00
box.py box.py: Make sides symetric and add top 2014-01-21 22:48:20 +01:00
box2.py Add box2.py - a simple, open box 2014-03-15 15:03:38 +01:00
boxes.py Python 3 compatibility 2014-03-03 21:45:01 +01:00
castle.py Fix callback param in castle.py 2013-07-20 19:24:16 +02:00
drillbox.py Add boxes.text() and use it in drillbox.py 2014-01-21 22:48:20 +01:00
flexbox.py flexbox.py: Adjust canvas size 2014-03-15 13:23:02 +01:00
flexbox2.py Merge flex of flexbox2 if no space in between 2013-07-20 19:09:12 +02:00
flexbox3.py Use different finger joints and fix lid size 2013-09-15 19:20:34 +02:00
flextest.py Added flextest 2013-07-01 20:23:56 +02:00
lamp.py Lamp tweaks 2013-07-20 18:56:11 +02:00
magazinefile.py magazinefile.py: Export thickness param and adjust canvas size 2014-03-15 10:34:26 +01:00
presentation.odp First version of a presentation 2014-03-15 13:27:46 +01:00
printer.py Adjust canvas sizes 2014-03-15 13:24:06 +01:00
silverwarebox.py Adjust canvas sizes 2014-03-15 13:24:06 +01:00
typetray.py typetray.py: Adjust canvas and default output 2014-03-15 13:26:30 +01:00

README.txt

What is this?
=============

This is a small python library for generating SVG drawings used for
cutting out boxes or other structures from plywood using a laser cutter.

While there are a couple of other box generators they are all very
limited in what they can do. This library aims for supporting
complicated shapes while offering easy way to do simple things. To
achieve this there are several levels of abstactions.

Basic Concepts
==============

There is basically only one class that takes care of everything. You
are supposed to sub class it and implement the render() method
(actually just any method that does anything). This Boxes class keeps
a cairo 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.

Building blocks and coordinates
-------------------------------

To avoid too much coordinate calculations the coordinate system is
continuously moved to the current point. The most basic functions just
do drawings relative to the current coordinate system - without
changing the coordinate system. Those are found in the Builing Blocks section.

Turtle graphics commands
------------------------

These start at the current positions and move the coordinate system to
their end. It is assumed that you are (roughly) drawing into the
direction of the x axis, with the inside of the part being above the
line. You need to turn counter clockwise (mathematically positive) to
get a closed shape. These commands typically procude some sort of edges.

Finger joints
.............

Finger joints are a simple way of joining two sheets 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.

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.


Whole parts
===========

A couple of command can create whole parts like walls. Typically the
sizes given are the inner dimmensions not including additional space
needed for burn compensation or joints.


Callback parameter
..................

The callback parameter can take on of the following forms:

 * A function (or bound method) that expects one parameter: the number
   of the side the callback is currently called for. 
 * A dict with some of the numbers of the sides as keys and functions
   without parameters as values.
 * A list of functions without parameters. The list may contain None
   as place holder and be shorter than the number of sides. 

The callback functions are called with the side of the part at the
positive x and y axis. If the edge uses up space this space is below
the x axis. You do not have to restore the coordinate settings in the
callback.

Instead of functions it can be handy to use a lambda expression
calling the one building block funtion you need (e.g. fingerHolesAt).

Edge description
................

Some part building functions take a edges param or have other params
describing some edges. These descriptions are one or several character
strings. With the following meanings: 

 e : straight edge
 E : as above but extended outside by one thickness
 f, F : finger joints
 h : edge with holes for finger joints
 d, D : dove tail joints