## Prototyping with Algorithms (Part I)

### July 9, 2013

Recently, being happily lost in my new world of 3d generative code art, i.e. 3d forms, fractals and geometric structures created out of functions and algorithms via the technique of Ray Marching, something made me stop and direct my focus to a real world application of this concept. This was the launch of the new Play Station and XBox consoles. I’ve been a fanboy of both machines over the years, and waited eagerly for the big reveal, as much to see what it looked like. I was kind of disappointed. Nothing more than square black boxes. Was this lack of imagination, or fear of being bold?

The old PS2 had its distinct corrugation, and the last XBox slim had its womanly curves. But since then, ever more conservative product design it seems.

I started to think of designing my own console, using functions and algorithms that established a framework, and through which, random mutation could create endless possibilities of physical design. I’m starting to believe more and more we need computers to augment and extend human imagination – and doing this through generative processes.

So I thought I’d kickstart a blog on this, and begin with something basic.

The fist stage is the overall ‘hull’ or superstructure.

Let me explain the above..

With Ray Marcing, imagine that the camera point of view is looking in the direction of every pixel on screen, sending every position in space from near to far into a single function, that function will return a number telling you whether you are on the surface of an object, or inside or outside the object.

Lets start with a simple box.

*float d2=sdBox2(cp, new PVector(1, .1, 1));*

Deform that box with some Perlin Noise to give it some random curves and mounds.

*float hull= d2-nv(cp); // nv is the noise function*

Wouldn’t be very console looking though. But add in some symmetry rules, i.e., mirror the horizontal plane, and mirror a vertical plane down the center of the console, so that left and right are symmetrical too.

if ( (cp.x)<0.) { // fold 1

cp.x=-cp.x;

}

if ( (cp.y)<0.) { // fold 1

cp.y=-cp.y;

}

Then quickly animate the deforming ‘noise field’ to see one new design automatically created after another.

After tweaking the algorithms, shaping the general framework of design possibilities, the last image above I was happiest with.

To breifly reiterate, Ray Marching is a 3d techinuqe that doesn’t require geometric meshes or wireframes to be created, instead, everything is expressed as a mathemcial function. This gives rise to very complex and experimental 3d graphics impossible in conventional 3d animation and software packages.

Next up is adding some heat vents. I’ll start with a basic sphere shape, and using boolean operations, cut away a cavity to create the vents.

–

I’ll now use the same sphere shape to do another boolean operation with a grill structure to create the vents structure.

–

now place the final vent structure back into the hull.

–

up the number of vents a bit

–

Finally, I want to add a nice bevelled edge around the vent structure. It’s another boolean operation that uses a slightly larger scaling of the original sphere that intersects with the hull to find a conforming rim.

–

So now that the basic hull, vent & rim elements are created, and importantly, all connected via a single algorithm / function, I can start playing around with mutating and randomizing the whole, by changing as little as one parameter / value.

Here I scale up the sphere. Remember, the whole object is based on a simple box and sphere that uses lots of boolean operations to create the final console prototype.

–

add left / right symmtery to the vent structure.

–

4 way symmetry, perhaps too much!

–

left / right symmetry, with noise deforming the sphere (which creates the vents)

–

So there it is, creating a random prototype out of algorithms. It’s just a start though, I’ve a lot more I want to develop with it.

This video I hope demonstrates best my overall philopsophy of using algorithms and random generation to discover new forms and conepts that would be impossible to us through conventional pen and paper and conventional software packages.

Next up is refining the algorithm, adding a nice abstract LED light panel. Texturing and surfacing – black plastic, metal chrome, neon blue lights etc..

Here’s a preview of the next stage, I discovered an better shape I was happy with, and put the vents flat in either side as a starting point (which can still be deformed in many ways) – and also with vents, I added some nice curving deformation on the grill structure, and you can also see the start of my abstract geometic thoughts on the LED lights – which will be added to the surface structure front and back.

Great stuff Glenn… that design could work well on DAB radios or even on High-End loudspeakers… All the best – Vinko

exactly Vinko -I also want to develop the idea for sports cars, architecture, jewelry etc etc

really cool and beautiful. which tools do you use? i suppose it’s processing. any libraries involved?

yep, processing, and a 3d ray marching lib

Interesting thing. This raymarching algorithm is written in processing and is your private thing, right? Or can I get the lib for my own tests somewhere?

Jens

read this

https://glennmarshall.wordpress.com/2013/01/15/distance-fractals/

what 3d raymarching lib did you use?