Documentation

()

Getting started

The API and the system is under heavy development. Right now we are "releasing" through a dropbox folder where each version can be found. Each version consists off added features and improvements.

Go to the folder here.

Open the PDE file in processing.

Press play to run it.This should present you with the generated design:

You can navigate the space by dragging the mouse. The scroll wheel zooms in and out of the sketch. Pressing the ā€˜pā€™ key generates a pdf of your drawing. It will be in your sketch folder. Choose show sketch folder in processing:

To make your own design edit the content in the setupElements() method.

    void setupElements()
    {


      canvas.addIsoTriangle(30, 10, 18, 10, LTZIPTIE); 
      mfab box = generateInsetBox(2, 10,11, 11, 15, canvas);

    }

Use the methods in the api described below to make your own design. Further, the different examples in the kits section includes example code that you can copy and paste into this method to generate and modify it yourself.

Material and project parameters

mfab canvas = createCanvas(4.0f, 0.3f, 0.2f, 100, 130, "Spirograph A4", "Mads Hobye");

The parameters:

mfab createCanvas(float _thickness, float _inset, float _offset, float _width, float _height, String _projectName, String _author)  

Basic example to make 3 tacky pieces:

void setupElements()  
{


  canvas.addTackyRectPiece(2, 10, 11, 11, "MyPiece");
  canvas.addTackyRectPiece(16, 10, 11, 11, "MyPiece");
  canvas.addTackyRectPiece(30, 10, 11, 11, "MyPiece");
  listMethods(canvas);

}

Basic example to manipulate a piece:

void setupElements()  
{


  mfab piece1 = canvas.addTackyRectPiece(2, 10, 11, 11, "MyPiece");
  piece1.left.lType = LTSTRAIGHT;
  piece1.right.lType = LTSTRAIGHT;

  listMethods(canvas);
}

Generators

The generators creates more complex shapes usually consisting of multiple pieces:

  mfab generateFingerBox(float _x, float _y, float _width, float _height, float _depth, mfab _canvas)

  mfab generateInsetBox(float _x, float _y, float _width, float _height, float _depth, mfab _canvas)

  mfab generateTestPattern(float _x, float _y, String _name, mfab _canvas)

Methods to add and manipulate different shapes:

These are methods intended to be used to generate and manipulate your drawing. New methods are developed extensively to get an overview of the latest methods look into the mfab tab where the base class resides.

Adding basic elements

mfab addText(float _x, float _y, String _name)  
mfab addSVG(float _x, float _y, String _shape)  
mfab addPopCircle(float _x, float _y, float _diameter)  
mfab addArc(float _x, float _y, float _diameter, float _arcStart, float _arcStop)  
mfab addLine( float _x, float _y, float _length, float _rotation, int _lType)  
mfab addLine(float _x, float _y, float _length, float _rotation)  
mfab addPolygon( float _x, float _y, float _length, float _sides, int _lType)  
mfab addCircle(float _x, float _y, float _diameter)  
mfab addSolidRect(float _x, float _y, float  _width, float _height)  
mfab addRect(float _x, float _y, float _width, float _height, int _lType)  
mfab addMountHole(float _x, float _y)  
mfab addContainer(float _x, float _y)  
mfab addMountHoleGrid(float _x, float _y, float _width, float _height)  
mfab addMountHoleRow(float _x, float _y, float _length, float _rotation)  
mfab addMountHoleRect(float _x, float _y, float _width, float _height)  
mfab addTackyLine(float _x, float _y, float _length, float _rotation)  
mfab addPopLine(float _x, float _y, float _length, float _rotation)  
mfab addServoMount(float _x, float _y)  
mfab addServoHole(float _x, float _y)  
mfab addIsoTriangle(float _x, float _y, float _base, float _height, int  _lType)  
mfab addRowOfIsoTriangle(float _x, float _y, float _base, float _height, int _no)  

Adding "pieces"

Pieces are basically complex pieces with multiple basic elements. They are per definition named so you get into the habit of classifying the objects you make.

mfab addRect(float _x, float _y, float  _width, float _height)  
mfab addTackyRectPiece(float _x, float _y, float _width, float _height, String _name)  
mfab addPopRect(float _x, float _y, float  _width, float _height)  
mfab addEmptyPiece(float _x, float _y, String _name)  
mfab addCirclePiece(float _x, float _y, float _diameter, String _name)  
mfab addCirclePopPiece(float _x, float _y, float _diameter, String _name)  
mfab addRectPiece(float _x, float _y, float _width, float _height, String _name)

// used to convert a "non-piece" into a piece
mfab convertToPiece(String _name)  

Basic three manipulation

canvas.add(mfab _item)  
canvas.addChild(mfab _child)  
canvas.remove(int i)  
canvas.get(int i)  
canvas.child(int i)  

Support methods

canvas.debug()  
canvas.toGrid(float _value) // converts from MM to GRID.  
canvas.toMM(float _value) // converts form GRID to MM  

The different line types

// Line types
 static final int LTSTRAIGHT = 0;
 static final int LTTACKY = 1;
 static final int LTINVERSED = 2;
 static final int LTIREFLECT = 3;
 static final int LTPOPSTRAIGHT = 4;
 static final int LTZIPTIE = 5;
Share on : Twitter, Facebook or Google+