POVRay mosaic: triangle/hexagon pattern, Regular plane partition 63

Converting 2D image into mosaic of 3D objects

POVRay mosaic is a set of programs, which read every pixel of source image and convert it into a virtual 3D object, packed side by side with objects created from other pixels, thus creating something like 3D-mosaic in POVRay format. You can download POVRay mosaic from GitHub and use it for free. 63Zaika is a part of this package, covering 63 Euclidean tiling.

This whole story begun decades ago when I needed some way to simulate real world colored sphere packing. There are some ad and deco technologies, based on constructing big pictures from plastic balls, and I needed a quick preview for expected result.

default output

Necessary program was created and successfully used. And forgotten, also successfully.

Until now.

63zaika program is a part of POVMosaic project, intended for opening source PNG image, and creating triangle-packed mosaics of 3D objects in POVRay format, colored after source image pixels.

Most important features of the program are:

Configurable output. Since POV files are text files, containing 3D scene description, they can be easily edited; 63zaika output is as human-friendly as possible, reasonably commented internally, and, besides, there is a help file with more prolific descriptions. You may easily switch 3D objects and their properties, except for color, which comes from the source image. Examples below will be added with short notation of change introduced between 63zaika output and rendering.

Any 63zaika output scene is already equipped with several predefined objects (below is an intersection of four cylinders coming along tetrahedron axes, with some rough pearl finish):

thingie_7; thingie_finish_4; rotate_rnd = <60, 60, 60>;

plus you can add external objects to the scene;

Mapping. It means you can map (make dependant of) some 3D object property to some source image pixel property. For example, on sample image below hexagonal prism (one of predefined objects) height is mapped to source brightness:

thingie_4; #declare map = function(c) {abs((2.0 * c) - 1.0)}; scale_map = <0, 0, 1.5>;

Since version 1.6.21, all predefined maps were replaced by generalized linear spline interpolation. Descriptive part in the beginning of POV file generated look like this:

    #declare Curve = function {
        spline { linear_spline
            0.0,   <0.0,   0>
            0.25,  <0.25,  0>
            0.5,   <0.5,   0>
            0.75,  <0.75,  0>
            1.0,   <1.0,   0>}
        }
    #declare map = function(c) {Curve(c).u}

This map is direct analog of Photoshop and GIMP "Curves", so general idea should be familiar: first column contain input values, second column contain corresponding output values (third column currently is not used for anything good, just leave it alone). By default, input=output, that is, map does not change anything. However, you can edit it.

Note that POVRay does not pay attention to the order of control points appearance, so you can add midpoints after endpoints in no particular order. Just remember to have endpoints 0 and 1 defined, since POVRay cannot use undefined functions; everything between 0 and 1 is up to you to edit.

Object texture, beside color and finish, include normal modifier, which can be modified independently of object itself:

thingie_normal_4; normal_rotate_rnd = <0, 0, 180>;

And finally, whole bunch of settings may be redefined by inserting external .inc file:

#include "63_icosa.inc"

"63_icosa.inc" is included in distribution and defines icosahedron. Sorry for a small preview, surely you'll find a use for icosahedron in something bigger. Icosahedra don't grow on trees, after all, they can't be left unused.

thingie_5 conic_sweep

External resources

Do you know that there are priceless collections of jewels you can get for free?

POV-Ray gems contain several gem examples in POVRay .inc format.

Above is an example of importing one of geometry files into casual scene with some random rotation. Note that current version of POVRay mosaic does not produce interior block per object to avoid complexity and complications, so I used very primitive interior per whole union.

POV-Ray gems, besides geometry files, provide realistic interiors for real minerals. They even implemented light dispersion lookup tables based on actual data!

Assuming you scrolled that far, I remind you that you can download POVRay mosaic from GitHub.


...or Move back to main page.