Wrapping up the Makerbot

As we were approaching holiday season, it only seemed appropriate that Rune would require us to design some wrapping paper. The clever thing about this assignment was that we were designing wrapping paper for Makerbot, a company that makes 3D printers. So we had to create a 2D design that would express the idea of 3D–like I said, clever!

Below is my design. I decided to make a pseudo-3D version of the Makerbot “M” logo and repeat it in a crazy spiral pattern. This pattern is reminiscent of the way the Makerbot lays down plastic to build an object. I made the M’s red and green since nothing says Christmastime like red and green (otherwise those colors are pretty horrendous together).

This is the code for both the red and green versions of the “M” objects:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
class Mpattern
{
  float distX, distY;
  float xpos, ypos;
 
  Mpattern(float xpos_, float ypos_, float distX_) 
  {
    distX = distX_;  //1/2 width of M
    xpos = xpos_;  //xpos of top left corner of M
    ypos = ypos_;  //ypos of top left corner of M
    distY = 2.25*distX;  //full height of M
  }
 
  void displayR()
  {
    canvas.strokeWeight(distX/2);  //scale strokeWeight with distX
    //shadow
    canvas.pushMatrix();
    canvas.stroke(0, 100, 50);
    canvas.strokeJoin(BEVEL);
    canvas.line(xpos, ypos, xpos, ypos + distY);  //left vert line
    canvas.line(xpos, ypos, xpos + 2*distX, ypos);  //top horiz line
    canvas.line(xpos + distX, ypos, xpos + distX, ypos + distY);  //mid-top vert line
    canvas.line(xpos + 2*distX, ypos, xpos + 2*distX, ypos + distY);  //right vert line
    canvas.popMatrix();
    //foreground
    canvas.pushMatrix();
    canvas.strokeJoin(BEVEL);
    canvas.stroke(0, 100, 100);
    canvas.translate(distX/8, 0);
    canvas.line(xpos, ypos, xpos, ypos + distY);  //left vert line
    canvas.line(xpos, ypos, xpos + 2*distX, ypos);  //top horiz line
    canvas.line(xpos + distX, ypos, xpos + distX, ypos + distY);  //mid-top vert line
    canvas.line(xpos + 2*distX, ypos, xpos + 2*distX, ypos + distY);  //right vert line
    canvas.popMatrix();
  }
 
  void displayG()
  {
    canvas.strokeWeight(distX/2);  //scale strokeWeight with distX
    //shadow
    canvas.pushMatrix();
    canvas.stroke(90, 100, 50);
    canvas.strokeJoin(BEVEL);
    canvas.line(xpos, ypos, xpos, ypos + distY);  //left vert line
    canvas.line(xpos, ypos, xpos + 2*distX, ypos);  //top horiz line
    canvas.line(xpos + distX, ypos, xpos + distX, ypos + distY);  //mid-top vert line
    canvas.line(xpos + 2*distX, ypos, xpos + 2*distX, ypos + distY);  //right vert line
    canvas.popMatrix();
    //foreground
    canvas.pushMatrix();
    canvas.strokeJoin(BEVEL);
    canvas.stroke(90, 100, 100);
    canvas.translate(distX/8, 0);
    canvas.line(xpos, ypos, xpos, ypos + distY);  //left vert line
    canvas.line(xpos, ypos, xpos + 2*distX, ypos);  //top horiz line
    canvas.line(xpos + distX, ypos, xpos + distX, ypos + distY);  //mid-top vert line
    canvas.line(xpos + 2*distX, ypos, xpos + 2*distX, ypos + distY);  //right vert line
    canvas.popMatrix();
  }
}

This is the code that makes that cool spiral pattern (thank you, Nature of Code):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//Kim Ash
//Printing Code
//MBwrap - uses repetition to make a wrapping paper pattern for Makerbot
 
PGraphics canvas;
int canvas_width = 5100;
int canvas_height = 6600;
 
float ratioWidth = 1;
float ratioHeight = 1;
float ratio = 1;
 
ArrayList <Mpattern> pattern;
float theta = 0;
float r = canvas_width/35;
 
void setup()
{ 
  size(510, 660);
  canvas = createGraphics(canvas_width, canvas_height);
  calculateResizeRatio();
 
  pattern = new ArrayList<Mpattern>();
 
  canvas.beginDraw();
    canvas.colorMode(HSB, 360, 100, 100);
    canvas.background(360);
    canvas.smooth();
    spiral();
 
  canvas.endDraw();
 
  float resizedWidth = (float) canvas.width * ratio;
  float resizedHeight = (float) canvas.height * ratio;
  //displays canvas onscreen
  image(canvas, (width/2) - (resizedWidth/2), (height/2) - (resizedHeight/2), resizedWidth, resizedHeight);
 
  canvas.save("MBwrap.tiff");
}
 
 
/* resizing function */
void calculateResizeRatio()
{
  ratioWidth = (float) width / (float) canvas.width;
  ratioHeight = (float) height / (float) canvas.height;
 
  if(ratioWidth < ratioHeight)  ratio = ratioWidth;
  else                          ratio = ratioHeight;
}
 
 
//tiling function
void spiral()
{
  while (r < canvas.width)
  {
    float spX = r*cos(theta);
    float spY = r*sin(theta);
    float msize = canvas.width/75;
 
    pattern.add(new Mpattern(spX + canvas.width/2, spY + canvas.height/2, msize));
 
    for(int i=0; i<pattern.size()-1; i++)  {
      if(i % 2 == 0)  {
        pattern.get(i).displayG();
      }
      else  {
         pattern.get(i).displayR();
      }
    }
 
    theta += 1;
    r += canvas.width/350;
  }
}