Wiffle cube

Paul Bourke
March 1990

Source code to create a volumetric dataset


The wiffle cube is basically a rounded (soft) cube with the center sphere removed. The field function in 3 dimensions at a point p = (x,y,z) is given by the following where a is normally 1/2.3 and b = 1/2.

f(x,y,z) = 1 - [ a2 (x2 + y2 + z 2) ]-6 - [ b8 (x8 + y8 + z8) ]6

Isosurfaces of the above field function are wiffle cubes as shown below as wireframe and simple rendered form.

 

The following are slices along one axis (the other axes would be the same). The horizontal and vertical range is -2.5 to 2.5, the colour is a linear colour ramp from -20 (blue) to about 0.88 (red).

Further rendered views varying the isosurface level.


The PovRay model that created the above: wiffle.pov, wiffle.ini.