Category: Libraries

As documented in this thread on the Processing forums the TileSaver class seems to be broken for current versions of Processing. Sadly I’m not sure what the problem is and I don’t have time to fix it right now.

However, I tried the original TileSaver code posted back in 2006 and miraculously that still works. This would imply a larger issue with the unlekkerLib library and Processing 1.0, which I’ll have to address when I have the time.

For now, here is a link to a working Processing sketch using the old TileSaver code: TileSaverTest.zip

No Comments »

After several requests I’ve taken the time to make unlekkerLib compatible with Processing 1.0. Apologies to anyone who’s been inconvenienced by the lack of a 1.0 version.

In particular, STL export should work again. However I haven’t had the chance to test the code very much, so please let me know if you find any bugs.

Download

No Comments »

I’ve uploaded a new version of my unlekkerLib library. For some inexplicable reason version 0002 was missing some classes that were needed for certain examples to function. As a result the TileSaver class was broken, which was a serious omission.

You can download unlekkerLib-0003 from the Code & Form Google Code repository. I’ve added the missing classes, but otherwise the library is the same. If you still experience problems please report them here.

2 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.

3 Comments »

I just posted a quick update to unlekkerLib. It seems the first version I posted used Java 5 because I hadn’t configured Eclipse correctly. This version is compiled for 1.4. I have tested it with Processing 0125, but please give me feedback if it gives you trouble.

I added two new functions to the library, nothing big but could be useful for some people:

[071028] unlekkerLib-0002 features:
  • unlekker.data.POVRay: Primitive POV-Ray triangle geometry export.
  • unlekker.data.FeedReader: Feed reading utility class (requires installing extra JARs)

To use the feed classes simply use the code from this previous post, minus the class definitions.

1 Comment »

AHO RP 004 Object #1 - #3 [lo]

Rapid prototyping objects generated with Processing and output to STL using unlekkerLib.

I’ve just uploaded a new Processing library called unlekkerLib. It is a collection of tools and code snippets I use frequently, and which I’ve now just barely cleaned up enough for other people to use. Instead of releasing them piece by piece, I’ve decided to bundle them together in a package hierarchy.

The main reason I decided to release it now is the STL export code I’ve written for my rapid prototyping projects. Several people have asked for the code, so I wanted to get it out there for you to play with. Obviously, it works as well with Processing as it does with regular Java.

Caveat emptor:There’s not much documentation but I do provide the source code. This is v.0001 – the very first release, so it’s pretty basic. See below for an idea of what the library contains. Right now the most exciting new component is the unlekker.data.STL class, which supports export and import of STL stereolithography files for rapid prototyping. Have a look at the Javadoc for more details.

Updates will appear here: http://workshop.evolutionzone.com/unlekkerlib/.

Read the rest of this entry »

2 Comments »

After suggesting to my AHO class that they consider using RSS feeds in Processing, I realized that there is actually no built-in functionality to do so. The XML class built into Processing is too basic to handle feeds, it seems. To remedy the situation I’ve cooked up a quick hack using the ROME library for RSS / Atom syndication.

To run the code below you’ll need to download ROME and JDOM. Make a “code” subfolder in your sketch and paste “jdom.jar” and “rome-*.jar” into it, then run the code as given. The FeedReader and FeedEntry convenience classes take care of parsing the feed and returning the entries with the most common fields included. Error checking is rudimentary, however.

Code – feedParser.pde

Read the rest of this entry »

10 Comments »

Update: This hack is obsolete as of 0133. Read more here.

For those of you who have been using the hack I posted a while back to force anti-aliasing in Processing, here’s an updated version for Processing 0125. According to the source repository Ben has been fixing lots of little things in PGraphicsOpenGL, so it’s worth updating.

The hack is actually lying dormant in the PGraphicsOpenGL source, but it’s been commented out with the note “how to integrate this properly?”. Obviously, having to set hardware-specific settings goes against the ease of use that Processing is known for. I guess Ben and Casey are just trying to find a way to include it in a manner consistent with the rest of the application.

To use the hack simply download the ZIP archive below and unpack it to produce the hacked “opengl.jar” file. Drop the JAR into the “libraries\opengl\library” subfolder of your Processing application directory. Make sure to make a backup of the original opengl.jar. Once replaced, the new PGraphicsOpenGL class always initializes with 4x supersampling.

Downloads

5 Comments »

070324_tilesaver.gif

High-resolution images from Processing using tiling (1.6% / 20%)

UPDATE: This code currently doesn’t work with Processing 1.0 and later. Please use Karsten Schmidt’s TileSaver replacement instead.

A while back I posted about rendering very high-resolution images from Processing using a tiling technique. I had implemented a working version of a solution first described by "surelyyoujest", but didn’t have time to post a clean version of the code. (I did however post ImageStitcher.pde, which is code for stitching these tiled images back together.) But after a long delay, here is finally the more useful bit of code.

The code works by panning the camera over the original viewport area, subdividing the image into tiles. This way, OpenGL’s limitations on maximum resolution can be circumvented. As long as enough memory is allocated, the images created can be very big indeed. The images shown above are from a 15360 x 15360 pixel image, shown at 1.6% and 20% respectively. With 1.5 GB assigned to Java I have so far successfully saved 20k x 20k images. That’s large enough to print 2×2 meter prints at 260 DPI.

What follows is the aTileSaver class and a simple demo application. I will post a more complex example soon.

Update: I’ve changed a few minor details in the code. Make note of the version number if you have download it already. This code is likely to change..

Source code – aTileSaver.pde

Read the rest of this entry »

33 Comments »

Update 17 Jan 2008: This library is not available at the moment at the request of Sean Luke, who along with Michael Lecuyer were the original author of the Mersenne Twister code used in the library. In packaging the library for use with Processing I carelessly removed the copyright and license information from the original file, thereby falsely giving the impression that I had written the code myself.

I’m hoping to resolve the issue and provide the library in a different form in the near future.

1 Comment »