Category: Processing / Java
Demo of Lee Byron\'s Mesh library

MeshLibDemo.pde - Demo of Lee Byron’s Mesh library

Lee Byron has written a neat little Processing library called Mesh which allows for easy calculation and display of Voronoi, Delaunay and Convex Hull diagrams.

Given a set of points, these diagrams calculate the minimal regions around the points (Voronoi), an optimal triangulation of the points (Delaunay) or the polygon shape that contains all the points (Convex Hull). So far the library only supports the 2D versions of the diagrams, but it is in part based on the QuickHull3D java library which also handles 3D hulls.

Byron didn’t include any code examples in the current release, so I hacked up a quick demo.

Code: MeshLibDemo.pde

To run this example, download MeshLibDemo.zip and unzip it inside your Processing sketches folder. The Mesh library is included in a “libraries” subfolder, but you’ll have to restart Processing for the library to be recognized.

I’m posting the full code below for easy reference.

Read the rest of this entry »

1 Comment »

I just got an email from Casey saying that processinghacks.com has finally officially been integrated into the main Processing web site. The new URL is http://processing.org/hacks/. Processinghacks was a great initiative by Toxi and Tom Carden, but has ended up in an inactive limbo over the years. Wikis are perfect for letting users contribute their own content, but they also requires a dedicated community to work properly. Sadly, that never quite happened.

Hopefully, the integration into processing.org will provide a little extra motivation for would-be contributors to step up to the plate. There are already links to empty pages indicating topics that should be filled, giving some useful starting points. I know there are some things in unlekkerLib that would fit, but I’ll have to see when I have the time to write them up.

In any case, congratulations to the Processing team for adding a new feature, and thanks to Toxi and Tom Carden for having the Processing hacks idea in the first place…

No Comments »

I’ve decided to put my Processing hacks from the Code & hacks page and consolidate them into a downloadable archive. Thus the Code & Form code library is born. It will contain various demos and hacks, as well as example code for the unlekkerLib library. It should be much easier to publish code this way, since students etc. can simply download the archive and dump the contents in their sketchbook folder for quick access.

I’ve started a Google Code repository for this purpose, which seems a good way to go. I’m still figuring out SVN etc, hopefully I can switch to publishing the unlekkerLib source “live” through SVN once I figure it out. I’ll also publish archives of code written during past workshops to the repository.

There seems to be a growing list of Processing-related Google Code repositories out there, examples include Toxi’s Toxiclibs, interfascia and jddaniels. Do a search for processing.org to find more.

2 Comments »

Akron 001 Object #1 Akron 019 Possible series - Grid distortion

ElectroPlastiques: Object #1 / Grid distortion

I have a new exhibition coming up in Akron, Ohio as part of an artist in residence stay at the Myers School of Art. Titled "ElectroPlastiques", it is my first ever solo show. Interesting that it would take a show in the US for that to happen, although not really so surprising given that the European media art scene is geared towards festivals. The exceptions are the few European media artists who have found gallery representation, a process that seems to be going even slower in Europe than in the US.

I’m using this show to highlight some of the existing topics of my work with realtime animation, as well as a new direction dealing with physical output. I will screen a series of my generative animations, such as Neon Organic, ElectroPlastique #1 & #2 and Illuminations A. These pieces explore the plastic qualities of parametric software processes, where a single set of rules gives rise to an infinite sequence of possible configurations. The title of the show is intended to refer to the plasticity of digital media.

As a counter-point, I will be showing manifestations of my work in physical formats, where animation gives way to other qualities. My rapid prototyping pieces Object #1 - #3 and new work like the Grid distortion laser cuts explore the tactile possibilities of digital fabrication, while prints like the Packing series go beyond the limited resolution of the screen to explore issues of graphic detail.

Read the rest of this entry »

3 Comments »

HyperCNC 47 Corian test #2

SinSurf, CNC-milled Corian panel, produced from STL files generated with Processing.

I just got an email with images from Lenny at HyperWerk, turns out my first foray into the world of CNC milling is done. And it looks better than I had ever expected, which is great news for me since I can now use it for my upcoming ElectroPlastiques solo show in Akron, Ohio next week.

The radial milling paths really make the piece come alive, of course it doesn’t hurt that Corian is such a beautiful material to begin with. I’ll definitely have to explore CNC more as a possible output medium, it provides some of the fine detail of rapid prototyping while allowing for much larger pieces. And the organic quality provided by the milling paths is very appealing, especially considering the digital origin of the form.

See my Flickr stream for more images. My thanks to Andreas and Lenny for their help with milling and photos!

No Comments »

The following Processing example shows how to set up a separate thread for loading images into a sketch. I wrote it up in response to this post on the Processing forums, figuring it will be useful to some of my students too.

Code: ThreadImageLoader.pde

Read the rest of this entry »

7 Comments »

We’re making good progress at the HyperWerk digital fabrication workshop, see the new Fabbing @ HyperWerk Flickr group for details.

Hyper0802 201 Martin Fuchs - Polygon form Hyper0802 171 Martin Fuchs - Polygon form Hyper0802 182 Philip Whitfield Hyper0802 003 Martin Fuchs Hyper0802 102 Leander Herzog Hyper0802 095 Martin Fuchs Hyper0802 133 Roland von Tessin

1 Comment »

Turns out Java has no mechanism for discovering the names of disk volumes. You can use java.io.File.listRoots() to get the root paths for multiple disks, but you can’t auto-discover their names.

Here’s a quick hack that will work on Windows. It uses Runtime.getRuntime().exec() to run “cmd /c dir “, the output of which is parsed to get the volume name.

import java.io.*; 

void setup() {
  println("Testing getVolName");

  String path="D:";
  println("Volume name for "+path+" is: "+
    "'"+getDiskVolumeName(path)+"'");
}

public static String getDiskVolumeName(String path) {
  String volname="Unknown";
  String check="Volume in drive "+path.charAt(0)+" is ";
  try  {
    Process p=Runtime.getRuntime().exec("cmd /c dir "+path);
    //p.waitFor(); 

    BufferedReader reader=new BufferedReader(
      new InputStreamReader(p.getInputStream()));
    String line=reader.readLine();
    while(line!=null) {
      if(line.indexOf(check)!=-1)
        volname=line.substring(line.indexOf(check)+check.length());

//      System.out.println(line);
      line=reader.readLine();
    }
  }
  catch(Exception e1) {
    println("Failure: "+e1.toString());
  }
  return volname;
}

No Comments »

I am teaching a 3-day workshop in Digital Architecture at the Oslo School of Architecture & Design (AHO) this week, as part of a course by Søren Sørensen. The workshop will give an introduction to Processing, with a focus on synthesis of spatial form. If time permits we’ll also look briefly at Rhinoscript.

Be sure to look at the page I have prepared with links related to computational architecture. Code will be uploaded to:
http://workshop.evolutionzone.com/workshops/080211_aho.

Workshop contents
  • Basic Processing syntax
  • Simple animation
  • Control structures: If / else, loops, keyPressed(), mousePressed()
  • Transformations: translate(), scale(), rotate()
  • Complex drawing: beginShape(), endShape()
  • Data structures: Arrays, classes
  • Polygon mesh generation
  • Output: PDF, STL, DXF
Possible advanced topics

No Comments »

I just finished a set of concerts with Alexander Rishaug, starting in Berlin at CTM.08 / Generator.x 2.0: Audio-Visual. This week we did two more gigs, first at VJ picks DJ in Bergen and finally on our home turf at Kabinett #3 in Oslo. For an impression of the set you can have a look at the clip above, posted by Pablo Sanz. For a short interview you can take a look at WatchBerlin's coverage of the concert and exhibition opening.

It was great to play with Alexander and develop our collaboration further, his cinematic soundscapes are a treat to work with. Audience responses seem to indicate that we’re doing something right, so hopefully we’ll find more chances to play together in the near future.

Rishaug & Watz- - Kabinett #3 GX20 Concert 0006 Alexander Rishaug & Marius Watz

GX20 Concert 0005 Alexander Rishaug & Marius Watz GX20 Concert 0002 Alexander Rishaug & Marius Watz

Kabinett poster by Diogo Valerio / photos from performance at Generator.x 2.0

3 Comments »