customized coffe mug with processing

Nikolaus Gradwohl2018-11-07T04:18:42+00:00

I got a coffee mug as an advertising present recently but it hat a huge company logo on it and since I don't like to run around as an walking advertising board I didn't really use it. Fortunately I saw this weekend, that the inner part of the mug can be removed and the company logo is only on a sheet of paper between the outer and the inner shell of the mug - Sooooooo - I fired up processing created a cool pattern using lots and lots of sine wave plots and printed it on a sheet of paper - then I cut it to size using the original inlay as a template and voila! a new customized and exchangeable inlay for my coffee mug - now I can use it to bridge the coffee availability gap between the coffee machine at home and the coffee machine in the office.

coffee mug

if you want to recreate the pattern or use it as a basis for your own pattern generation sketches, you can see the code here.

if you run it, it generates a single pdf file containing the pattern - it won't open a window showing the pattern

import processing.pdf.*;

void setup() {
  size(840,1188, PDF, "waves.pdf");

void draw() {
  for( int x= 0; x<22; x++) {
    for( float f = -1; f<1 ; f+=0.2) {
      for(int i=0; i<121; i++) {
        if ( x % 2 ==0 ) {
          vertex(40*x +f* abs(sin(float(i)/5)*40), i*10);
        } else {
          vertex(40*x +f* abs(cos(float(i)/5)*40), i*10);
Tweet This! submit to reddit Digg! Tags: | no comments | no trackbacks

See also:

sketch experiment 7 - osc events
nested cubes in processing
processing phaseflower
Time Perception
de jong attractor



Leave a response

Leave a comment